Quote:
Originally Posted by AntiBots
How I can get the Origen of a He When they Explote...
|
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
public plugin_init()
{
RegisterHam(Ham_Think, "grenade", "FwdExplosion");
}
public FwdExplosion(entity)
{
if( !pev_valid(entity) ) return HAM_IGNORED;
static Float:dmgtime;
pev(entity, pev_dmgtime, dmgtime);
// not exploding yet
if( get_gametime() > dmgtime ) return HAM_IGNORED;
static model[32];
pev(entity, pev_model, model, sizeof(model) - 1);
static CSW_type;
// 0123456789
// models/w_hegrenade.mdl
// models/w_flashbang.mdl
// models/w_smokegrenade.mdl
// models/w_c4.mdl
switch( model[9] )
{
case 'h': CSW_type = CSW_HEGRENADE;
case 'f': CSW_type = CSW_FLASHBANG;
case 's': CSW_type = CSW_SMOKEGRENADE;
case 'c': CSW_type = CSW_C4;
default: return HAM_IGNORED;
}
static Float:origin[3];
pev(entity, pev_origin, origin);
// "origin" contains the explosion origin
// "CSW_type" contains the CSW_* constant
return HAM_HANDLED;
}
__________________