Forum

> > CS2D > Scripts > Limit grenade ammount -- request
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Limit grenade ammount -- request

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Limit grenade ammount -- request

TimeQuesT
User Off Offline

Zitieren
I do not know if it is possible with vanilla means but it is definitely achievable with lua.
I used cs2d lua cmd playerweapons, which I do not know if it recognizes two flashbangs.

Untested code example >


Better copy that code into an editor that supports HL. This montone green text is unreadable.

alt Re: Limit grenade ammount -- request

TimeQuesT
User Off Offline

Zitieren
-------------------------------------------------------------
× do not use
-------------------------------------------------------------
Another way would be counting the grenades on certain events.

cs2d lua hook buy and cs2d lua hook walkover for increasing.
(cs2d lua hook attack / cs2d lua hook projectile), cs2d lua hook drop and cs2d lua hook die for decreasing.


-------------------------------------------------------------
√ use this
-------------------------------------------------------------
Edit: Okay it is much easier than expected.
You can use cs2d lua cmd playerammo to retrieve the amount of flashbangs carried.

the function p_count_grenades changes minorly by replacing
+ 1
with
+ playerammo(p_id, item_id);


Changed function >
2× editiert, zuletzt 16.08.20 17:07:40
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht