PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
const m_bIsC4 = 385
const m_bStartDefuse = 384
const m_pBombDefuser = 388
const m_fNextDefuse = 107
const m_flDefuseCountDown = 99
#if AMXX_VERSION_NUM < 183
const INT_BYTES = 4
const BYTE_BITS = 8
stock bool:get_pdata_bool(ent, charbased_offset, intbase_linuxdiff = 5)
{
return !!(get_pdata_int(ent, charbased_offset / INT_BYTES, intbase_linuxdiff) & (0xFF<<((charbased_offset % INT_BYTES) * BYTE_BITS)))
}
#endif
public plugin_init()
{
RegisterHam(Ham_Think, "grenade", "CGrenade_Think", false)
}
public CGrenade_Think(const GrenadeEntity)
{
if(pev_valid(GrenadeEntity) && get_pdata_bool(GrenadeEntity, m_bIsC4))
{
if(get_pdata_bool(GrenadeEntity, m_bStartDefuse))
{
new DefuserIndex = get_pdata_ent(GrenadeEntity, m_pBombDefuser)
if(is_user_connected(DefuserIndex))
{
new Float:GameTime = get_gametime()
if(GameTime < get_pdata_float(GrenadeEntity, m_flDefuseCountDown))
{
new OnGround = pev(DefuserIndex, pev_flags) & FL_ONGROUND
if(GameTime > get_pdata_float(GrenadeEntity, m_fNextDefuse) || !OnGrounde)
{
client_print(0, print_chat, "%d stopped defusing", DefuserIndex)
//add your code here
}
}
}
}
}
}
__________________