I use this function to set the model + effects for players, but after throwing the grenade, it no longer disappears from the ground, w_grenade.mdl remains on the ground.
How do I get rid of them?
PHP Code:
public FwdSetModel(iEntity, const szModel[])
{
if( pev_valid(iEntity) && equal(szModel, "models/w_hegrenade.mdl"))
{
entity_set_model(iEntity, "models/w_hegrenade.mdl");
set_pev(iEntity, pev_dmgtime, 9999.0);
balls_effects(iEntity)
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
+++
public NadeTouch(ent,id)
{
if(!pev_valid(ent))
return FMRES_IGNORED
//Create some variables
new classname[20],classname2[20],Float:origin[3],owner = pev(ent,pev_owner)
pev(ent,pev_origin,origin)
pev(id,pev_classname,classname2,sizeof classname2 - 1)
pev(ent,pev_classname,classname,sizeof classname - 1)
//Player get's hit
if(equali(classname,"grenade") && equali(classname2,"player"))
{
if(is_user_alive(id))
{
engfunc(EngFunc_RemoveEntity,ent)
sw_kill(owner, id ) // effects on kill
}
}
return FMRES_IGNORED
}
}
https://i.imgur.com/mWVcDU9.png