Nothing disappears now :S
code
Code:
public remove_ent(iEnt)
{
if(pev_valid(iEnt))
engfunc(EngFunc_RemoveEntity,iEnt);
}
Code:
public Ham_Touch_Grenade_Pre( iEntity, id, ent, entity_id)
{
if( GAME_SNOWBALL <= g_iCurrentGame <= GAME_ZMBOMBS || g_iCurrentGame == GAME_SNOWBALL )
{
if(is_user_alive(id))
{
ExecuteHamB(Ham_Killed, id, pev(iEntity, pev_owner), 0)
remove_entity(iEntity)
remove_task(entity_id)
}
}
}
public fwdSetModel(ent,const model[])
{
if(!pev_valid(ent) || !equal(model,"models/w_hegrenade.mdl"))
return FMRES_IGNORED
switch(g_iCurrentGame)
{
case GAME_DGBALL: engfunc(EngFunc_SetModel, ent, g_szDodgeball_World)
case GAME_ZMBOMBS: engfunc(EngFunc_SetModel, ent, g_szZombiebomb_World)
case GAME_SNOWBALL: engfunc(EngFunc_SetModel, ent, g_szSnowball_World)
case GAME_ANGRYBIRDS: engfunc(EngFunc_SetModel, ent, g_szAngryBirds_World)
default: return FMRES_IGNORED
}
return FMRES_SUPERCEDE
}
public think_grenade(iEntity, ent, entity_id)
{
if( GAME_SNOWBALL <= g_iCurrentGame <= GAME_ZMBOMBS || g_iCurrentGame == GAME_SNOWBALL || g_iCurrentGame == GAME_ANGRYBIRDS)
{
new model[32];
entity_get_string(ent, EV_SZ_model, model, 31)
if(equali(model,"models/w_dodgeball.mdl"))
{
return PLUGIN_CONTINUE
}
// stop grenade from blowing up
set_task(5.0,"remove_ent",entity_id);
return PLUGIN_HANDLED
}
}
__________________