Forum

> > CS2D > Scripts > Strip Players when round start
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Strip Players when round start

16 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Strip Players when round start

GeoB99
Moderator Off Offline

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

alt Re: Strip Players when round start

GeoB99
Moderator Off Offline

Zitieren
@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!

alt Re: Strip Players when round start

GeoB99
Moderator Off Offline

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

alt Re: Strip Players when round start

Mora
User Off Offline

Zitieren
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

alt Re: Strip Players when round start

Mora
User Off Offline

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

alt Re: Strip Players when round start

_3yrus
User Off Offline

Zitieren
user GeoB99 hat geschrieben
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 ?

alt Re: Strip Players when round start

Mora
User Off Offline

Zitieren
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

alt Re: Strip Players when round start

Mora
User Off Offline

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

alt Re: Strip Players when round start

baRD
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht