Forum

> > CS2D > Scripts > remove weapons from terrorist
Forums overviewCS2D overview Scripts overviewLog in to reply

English remove weapons from terrorist

7 replies
To the start Previous 1 Next To the start

old Re: remove weapons from terrorist

KimKat
GAME BANNED Off Offline

Quote
I got the Lua for that.
1
2
3
4
5
6
addhook("spawn","remove_weapons")
function remove_weapons(p,t,w,x,y)
	if player(p,"exists") and (t==1) then
		parse("strip "..id.." "..w)
	end
end
That should work, unless I set the parameters wrong. If so fix it... I don't got the info.txt available right now.
edited 2×, last 06.03.11 05:44:08 pm

old Re: remove weapons from terrorist

KimKat
GAME BANNED Off Offline

Quote
Try again. I edited just after you left. -.-
If it's wrong, check the info.txt in your lua folder for right parameters and correct after it. This script would work for me.

old Re: remove weapons from terrorist

Flacko
User Off Offline

Quote
Kimkat7 has written
function remove_weapons(p,t,w,x,y)

Hm, it looks like you have a few extra parameters that shouldn't be there

info.txt has written
spawn(id)                              on spawn
-id: player id
>return:     "" - (nothing) spawn with regular items
          "x" - spawn with melee weapon only
          "typeid,typeid,..." - spawn with these items + melee


Also...
Quote
if player(p,"exists") and (t==1) then

There's no need for that since any player that calls the spawn hook must exist.

The right code would be:

1
2
3
4
5
6
addhook("spawn","remove_weapons")
function remove_weapons(id)
	if player(id,"team") == 1 then
		return "x" --Spawn with nothing but the knife
	end
end

old Re: remove weapons from terrorist

KimKat
GAME BANNED Off Offline

Quote
Flacko has already supplied the solution. Which doesn't contain a awful alot of variables, either you take it or leave it.

Thanks for letting me know, Flacko. I sometimes just write the Lua without anything, just pure intuition.

old Re: remove weapons from terrorist

Apache uwu
User Off Offline

Quote
Probably want to change it if you are still using this code in b.1.19.

The client side is delayed and sometimes with massive lags the player might think he does spawn with other weapons.

ex. Kicking a person @ hook_join.
ex. parse equip @ hook_spawn.
ex. equip @ hook_reload.

Just be aware of where you are putting this and whether you might need to add small delays.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview