thanks if you reply and you will get cookies
Forum
CS2D Scripts remove weapons from terroristremove weapons from terrorist
7 replies 1
thanks if you reply and you will get cookies
1
2
3
4
5
6
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
edited 2×, last 06.03.11 05:44:08 pm
edt:but it dont work
edited 1×, last 06.03.11 05:10:49 pm
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.
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
-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
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
Thanks for letting me know, Flacko. I sometimes just write the Lua without anything, just pure intuition.
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.
1