Raised This Month: $32 Target: $400
 8% 

Some help to block flashbangs spam


Post New Thread Reply   
 
Thread Tools Display Modes
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
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-24-2012 , 08:00   Re: Some help to block flashbangs spam
Reply With Quote #2

Spoiler
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 08-24-2012 , 08:07   Re: Some help to block flashbangs spam
Reply With Quote #3

Eh, thanks lucas. I thought I should make checks about the currently ammo etc .. and at the same time it should be created that simple...

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



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 09:46.


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