Forum

> > CS2D > Scripts > What does the "collect" hook mean?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch What does the "collect" hook mean?

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt What does the "collect" hook mean?

Bowlinghead
User Off Offline

Zitieren
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?
1× editiert, zuletzt 06.09.11 18:56:40

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

DC
Admin On Online

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

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

Apache uwu
User Off Offline

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