Forum
CS2D Scripts Strip Players when round startStrip Players when round start
16 replies 1
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
function WeaponStrip(mode) local Plexist = player(id, 'exists') if ( Plexist ) then parse('strip ' .. id) end end addhook('startround', 'WeaponStrip')
startround doesnt have id so you have to use a loop.
Use this for id :
1
2
3
4
2
3
4
local playerlist=player(0,"table") for _,id in pairs(playerlist) do print(player(id,"name")) end
1
2
3
4
5
6
7
2
3
4
5
6
7
function WeaponStrip(mode) for _, id in pairs(0, 'tableliving') do parse('strip ' .. id) end end addhook('startround', 'WeaponStrip')
idhas now a value anyway. Sorry for the mistake, Jedediastwo!
for _, id in pairs(0, 'tableliving') do
change it to
for _, id in pairs(player(0, 'tableliving')) do
@ Jedediastwo: Change the loop (the 2 line) from the code with
for _, id in pairs( player(0, 'tableliving') ) do.
btw via lua is not just parse("strip "..id). you need to type which weapon needed to strip, because this command is not recognize a number(simply bcs u not type it lel).
GeoB99 has written However keep in mind that knife will not be stripped anyway because a player must always have at least one item due to technical bugs. Note strip.
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
function WeaponStrip(mode) local Plexist = player(id, 'exists') if ( Plexist ) then parse('strip ' .. id) end end addhook('startround', 'WeaponStrip')
a question . what is mode in weopenstrip function ?
I wrote this for you, cuz u wont do it yourself i think:
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
addhook('startround', 'WeaponStrip') function WeaponStrip(mode) 	for _,id in pairs(player(0, 'tableliving')) do local itemlist=playerweapons(id) 		for _,s in pairs(itemlist) do 			if s~=50 then 				parse("strip "..id.." "..s) 			end 		end 	end end
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("startround","weaponStrip") Items={} --Items You want to strip-- function weaponStrip() 	parse("strip "..id..""..Items) end
idis undeclared in your code hence nil.
1