Forum

> > CS2D > General > Equip nightvision
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Equip nightvision

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Equip nightvision

Alistaire
User Off Offline

Zitieren
1
2
3
4
if player(id, 'money') >= 195 then 
	parse('setmoney '..id..' '..player(id, 'money')-195) 
	parse('equip '..id..' '..59)
end

Lua Error #1 hat geschrieben
ERROR: strip - cannot strip 59 - Night Vision (this would lead to problems)!


So - I know this has been posted many times - is it possible to drop it under the player? So that I don't break DC's precious rules? And still make it possible?

alt Re: Equip nightvision

DC
Admin Off Offline

Zitieren
sure cs2d cmd spawnitem
but the player has to walk over it. spawning it on a tile on which the player is already standing will not make the player collect it. you can try to use cs2d cmd setpos twice (move to another position and back to the old one) this should make the player collect the item.

alt Re: Equip nightvision

Apache uwu
User Off Offline

Zitieren
@DC please make "equip" items such as bomb, nightvision, and gasmask

but for now:
1
2
3
4
5
6
if player(id, 'money') >= 195 then 
	parse("spawnitem 59 "..player(id,"tilex").." "..player(id,"tiley"))
	tmp={player(id,"x"),player(id,"y")}
	parse("setpos "..id.." 1 1")
	parse("setpos "..id.." "..tmp[1].." "..tmp[2])
end

I guess you could make a lua function for that like...

1
2
3
4
5
6
function equip(id,item)
	parse("spawnitem "..item.." "..player(id,"tilex").." "..player(id,"tiley"))
	local tmp={player(id,"x"),player(id,"y")}
	parse("setpos "..id.." " 1 1")
	parse("setpos "..id.." "..tmp[1].." "..tmp[2])
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht