Raised This Month: $ Target: $400
 0% 

How to block grenade throw


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 04-24-2013 , 06:05   Re: How to block grenade throw
Reply With Quote #4

Blocking the next throw grenades if the previous shots in less than 15 seconds.
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <csx>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "HeBlock"
#define VERSION "1.0"
#define AUTHOR "FromTheFuture"

 
 
#define IsValidPrivateData(%0)          ( pev_valid( %0 ) == 2 )
 
#define  m_flNextAttack                         83
 
#define OFFSET_LINUX_WEAPONS    4
#define OFFSET_LINUX                            5
#define OFFSET_WEAPONOWNER      41

new Floatg_fWaitTime[33];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHamHam_Item_Deploy"weapon_hegrenade""Deploy_Post", .Post true );
}

public 
Deploy_PostpEntity )
{
    if( !
IsValidPrivateDatapEntity ) )
    {
        return 
HAM_HANDLED;
    }

    new 
id get_pdata_cbasepEntity OFFSET_WEAPONOWNER OFFSET_LINUX_WEAPONS );
    new 
Float:Time get_gametime() - g_fWaitTime[id];
    
    if(
Time  15)
    {
        
client_print(idprint_center"Please, wait %0f seconds"15 Time);
        
set_pdata_float(idm_flNextAttackget_gametime( ), OFFSET_LINUX );
    }
    
    return 
HAM_IGNORED;
}

public 
grenade_throw(idgidwid)
{
    if(
wid != CSW_HEGRENADE)
    return;
    
    
g_fWaitTime[id] = get_gametime();
    

FromTheFuture 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 10:46.


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