Forum

> > CS2D > Scripts > Limit grenade ammount -- request
Forums overviewCS2D overview Scripts overviewLog in to reply

English Limit grenade ammount -- request

4 replies
To the start Previous 1 Next To the start

old Re: Limit grenade ammount -- request

TimeQuesT
User Off Offline

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

old Re: Limit grenade ammount -- request

TimeQuesT
User Off Offline

Quote
-------------------------------------------------------------
× 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 >
edited 2×, last 16.08.20 05:07:40 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview