Raised This Month: $ Target: $400
 0% 

Disable smoke grenade?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-11-2020 , 13:37   Re: Disable smoke grenade?
Reply With Quote #3

Quote:
Originally Posted by Vancold View Post
Hey,

it's rather simple.
All you have to use is the forward CS_OnBuyAttempt(id,item) and check if the item is a CSW_SMOKEGRENADE (constant)

That way you can block out anyone from buying smoke grenades.


What is important is that you have to write the code this way:

Return
PLUGIN_CONTINUE to let the buy attempt continue
PLUGIN_HANDLED to block the buy attempt

That means if the player is trying to buy a smokegrenade (which you check with an if-condition) you just return plugin_handled. IF the player buys something else you return plugin_continue.


Have fun
Vancold
Remember that this works only in AMXX 1.9 or above.
__________________

Last edited by OciXCrom; 02-11-2020 at 13:37.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode