Raised This Month: $ Target: $400
 0% 

Some help to block flashbangs spam


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 08-24-2012 , 03:50   Some help to block flashbangs spam
Reply With Quote #1

Example code:

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <cl_buy>

const g_iFlash_Max_Carry 2// max boughts per round

new g_iFlash33 ];

new 
b_Blocked33 ];

public 
client_buyiditem )
{
    if( 
item == CSW_FLASHBANG )
    {
        
g_iFlashid ]++
        
        
g_iFlashid ] = cs_get_user_bpammoidCSW_FLASHBANG );
        
        if( 
g_iFlashid ] == g_iFlash_Max_Carry )
        {
            
b_Blockedid ] = true;
            
client_printidprint_center"You can't buy more flashbangs this round!" );
            return 
PLUGIN_HANDLED;
        }
    }
    return 
PLUGIN_CONTINUE;

I have used grenade_throw from csx and blocked the flash but this way I can't make sure he had bought 2 flashes... any ideas?

What I mean is - I can block the flashbang in grenade_throw, but the player should have bought 1 grenade so he wouldn't be able to buy another one until the new round, I hope you got what I want to say.


I res the bool's value at new round.

Last edited by dark_style; 08-24-2012 at 03:57.
dark_style is offline
 



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 05:44.


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