Forum

> > CS2D > Scripts > What does the "collect" hook mean?
Forums overviewCS2D overview Scripts overviewLog in to reply

English What does the "collect" hook mean?

5 replies
To the start Previous 1 Next To the start

old What does the "collect" hook mean?

Bowlinghead
User Off Offline

Quote
Hello,
Here is my question:

I saw in the info.txt a hook called "collect"!
1
2
3
4
5
6
7
collect(id,iid,type,ain,a,mode)				on collect
-id: player id
-iid: item id
-type: item type
-ain: ammo in weapon / item count
-a: additional ammo
-mode: item mode

What mean the different parameters?
Example type? Or item mode?
Where I get infos about that? In the info.txt is only that and in cs2d lua hook collect (CS2D) is nothing more.
Can anyone explain me what type and mode means?
edited 1×, last 06.09.11 06:56:40 pm

old Re: What does the "collect" hook mean?

DC
Admin Off Offline

Quote
yeah whenever you collect an item, no matter what kind of item (weapon, money, ammo, armor...)

mode is the current weapon mode. it is pretty irrelevant for nearly every script. only very few weapons actually have a mode.
silenced weapons: silencer on or off?
laser: current color
all other items will probably always have mode 0.

type is simply the weapon id that you have to use in all weapon related commands like cs2d cmd equip. you can also see this id in the env_item entity in the editor.

don't confuse the type with iid, which is the item id to identify the item instance on the ground. it's unique. each item on the ground gets such an id in order to be able to identify it. it's not related with the item type in any way!
this iid can be used with commands like cs2d cmd removeitem (well I think that's actually the only command which makes use of this id)

old Re: What does the "collect" hook mean?

Apache uwu
User Off Offline

Quote
Opps was thinking of

1
2
3
4
5
6
7
8
9
walkover(id,iid,type,ain,a,mode) on walking over an item
-id: player id
-iid: item id
-type: item type
-ain: ammo in weapon / item count
-a: additional ammo
-mode: item mode
>return:	0 - proceed normally (collect?)
		1 - don't collect
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview