Forum

> > CS2D > Scripts > Item removal on walkover
Forums overviewCS2D overview Scripts overviewLog in to reply

English Item removal on walkover

2 replies
To the start Previous 1 Next To the start

old Item removal on walkover

Powermonger
User Off Offline

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

old Re: Item removal on walkover

omg
User Off Offline

Quote
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)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview