Raised This Month: $ Target: $400
 0% 

How to block grenade throw


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-24-2013 , 12:51   Re: How to block grenade throw
Reply With Quote #5

set m_flNextPrimaryAttack on grenade entity then.
Gonna be a little animation starting to play due to client prediction.

PHP Code:
#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 )

const XO_CBASEPLAYERITEM 4;
const 
m_pPlayer 41;

const 
XO_CBASEPLAYERWEAPON 4;
const 
m_flNextPrimaryAttack 46;

new 
Floatg_fNextThrowTime[33];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
RegisterHamHam_Item_Deploy"weapon_hegrenade""OnCHEGrenadeDeploy_Post"true );
}

public 
OnCHEGrenadeDeploy_PostpEntity )
{
    if( !
IsValidPrivateDatapEntity ) )
    {
        return;
    }

    new 
id get_pdata_cbasepEntity m_pPlayer XO_CBASEPLAYERITEM );
    new 
Float:flWaitTime g_fNextThrowTime[id] - get_gametime();

    if( 
flWaitTime 0.0 )
    {
        
client_print(idprint_center"Please, wait %.0f seconds"flWaitTime);
        
set_pdata_float(pEntitym_flNextPrimaryAttackflWaitTimeXO_CBASEPLAYERWEAPON);
    }
}

public 
grenade_throw(idgidwid)
{
    if(
wid == CSW_HEGRENADE)
    {
        
g_fNextThrowTime[id] = get_gametime() + 15.0;
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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