Forum

> > CS2D > Scripts > Item removal on walkover
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Item removal on walkover

2 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Item removal on walkover

Powermonger
User Off Offline

Zitieren
Hello scripters,

I have problems with item removing / collecting.

I need to remove item (in my case Primary & Secondary ammo), when player walks over it.

My script uses more realistic clip system:
Always infinite ammo, but if clip[id] is empty, player cannot reload weapon.
... so infact he can't actually collect any Primary or Secondary ammos.
Ammo item should disappear and clip[id] value should rise, when player walks over an ammo.

I already tried to parse "removeitem", but I couldn't get it work.

Could anyone give me an example of "removeitem", or is there any easier way to do this?

Thanks beforehand.

alt Re: Item removal on walkover

omg
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("walkover","pillage")
function pillage(id,item,itemtype,ammocount,magazineammo,secondarymode)
	if itemtype>78 and itemtype<85 then
		parse("removeitem "..item)
		parse("setarmor "..id.." "..itemtype+122)
		return 1
	elseif (itemtype>56 and itemtype<61) or itemtype==70 or itemtype==71 then
		return 0
	else
		parse("removeitem "..item)
		parse("equip "..id.." "..itemtype)
		return 1
	end
end
this is my personal code
chances r, u just got the parameters confused. item is the global item object number and itemtype is the weapon number (example: i believe ak47 is weapon 30)
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht