Forum

> > CS2D > Scripts > Strip Players when round start
Forums overviewCS2D overview Scripts overviewLog in to reply

English Strip Players when round start

16 replies
To the start Previous 1 Next To the start

old Re: Strip Players when round start

GeoB99
Moderator Off Offline

Quote
1
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')
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 cs2d cmd strip.

old Re: Strip Players when round start

GeoB99
Moderator Off Offline

Quote
@user Bowlinghead: Ha, I just noticed that! Oops...
1
2
3
4
5
6
7
function WeaponStrip(mode)
  for _, id in pairs(0, 'tableliving') do
    parse('strip ' .. id)
  end
end

addhook('startround', 'WeaponStrip')
It should work since
id
has now a value anyway. Sorry for the mistake, user Jedediastwo!

old Re: Strip Players when round start

GeoB99
Moderator Off Offline

Quote
Take a look at the Console for any Lua errors. I might suspect this script throws something related to a "boolean value expected" but that's only my assumption.

old Re: Strip Players when round start

Mora
User Off Offline

Quote
you missed table, which table is it?
for _, id in pairs(0, 'tableliving') do

change it to
for _, id in pairs(player(0, 'tableliving')) do

old Re: Strip Players when round start

GeoB99
Moderator Off Offline

Quote
I'm kinda tired this day so I tend to make these stupid mistakes, welp...

@user Jedediastwo: Change the loop (the 2 line) from the code with
for _, id in pairs( player(0, 'tableliving') ) do
.

old Re: Strip Players when round start

Mora
User Off Offline

Quote
You can also do that:
IMG:https://i.imgur.com/Ke1XUbn.png

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).

old Re: Strip Players when round start

_3yrus
User Off Offline

Quote
user GeoB99 has written
1
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')
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 cs2d cmd strip.

a question . what is mode in weopenstrip function ?

old Re: Strip Players when round start

Mora
User Off Offline

Quote
Here cs2d lua hook startround

I wrote this for you, cuz u wont do it yourself i think:
1
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

old Re: Strip Players when round start

Mora
User Off Offline

Quote
I know but it wont work if you not remove all weapons via entity, cuz if you're on SD mode you will be equipped USP(for ct) and Glock(for tt).

old Re: Strip Players when round start

baRD
User Off Offline

Quote
Bruh just do this
1
2
3
4
5
6
7
addhook("startround","weaponStrip")

Items={} --Items You want to strip--

function weaponStrip()
	parse("strip "..id..""..Items)
end
There
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview