Try this
PHP Code:
#include <amxmodx>
#include <csx>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN "HeBlock"
#define VERSION "2.1"
#define AUTHOR "FromTheFuture"
const Float:THROW_HEGREN_DELAY = 15.0;
const XO_CBASEPLAYERITEM = 4;
const m_pPlayer = 41;
const XO_CBASEPLAYERWEAPON = 4;
const m_flNextPrimaryAttack = 46;
new Float: g_fNextThrowTime[33];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam( Ham_Item_Deploy, "weapon_hegrenade", "OnCHEGrenade_Deploy_Post", true );
RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_hegrenade", "OnCHEGrenade_PrimaryAttack", false );
}
public OnCHEGrenade_Deploy_Post( pEntity )
{
new id = get_pdata_cbase( pEntity , m_pPlayer , XO_CBASEPLAYERITEM );
new Float:flWaitTime = g_fNextThrowTime[id] - get_gametime();
if( flWaitTime > 0.0 )
{
client_print(id, print_center, "Please, wait %.0f seconds", flWaitTime);
set_pdata_float(pEntity, m_flNextPrimaryAttack, flWaitTime, XO_CBASEPLAYERWEAPON);
}
}
public OnCHEGrenade_PrimaryAttack( pEntity )
{
new id = get_pdata_cbase( pEntity , m_pPlayer , XO_CBASEPLAYERITEM );
new Float:flWaitTime = g_fNextThrowTime[id] - get_gametime();
if( flWaitTime > 0.0 )
{
client_print(id, print_center, "Please, wait %.0f seconds", flWaitTime);
set_pdata_float(pEntity, m_flNextPrimaryAttack, flWaitTime, XO_CBASEPLAYERWEAPON);
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public grenade_throw(id, gid, wid)
{
if(wid == CSW_HEGRENADE)
{
g_fNextThrowTime[id] = get_gametime() + THROW_HEGREN_DELAY;
}
}
__________________