PHP Code:
public Event_DeathMsg( )
{
new iVictim = read_data( 2 );
static Float:flOrigin[ iCoords ];
pev( iVictim, pev_origin, flOrigin );
new iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );
/* --| Modify the origin a little bit. This is calculated to be set on floor */
flOrigin[ z ] -= 36;
engfunc( EngFunc_SetOrigin, iEnt, flOrigin );
if( !pev_valid( iEnt ) )
{
return PLUGIN_HANDLED;
}
set_pev( iEnt, pev_classname, gMedKitClassname );
engfunc( EngFunc_SetModel, iEnt, szModelKit );
dllfunc( DLLFunc_Spawn, iEnt );
set_pev( iEnt, pev_solid, SOLID_BBOX );
set_pev( iEnt, pev_movetype, MOVETYPE_TOSS );
engfunc( EngFunc_SetSize, iEnt, Float:{ -23.160000, -13.660000, -0.050000 }, Float:{ 11.470000, 12.780000, 6.720000 } );
engfunc( EngFunc_DropToFloor, iEnt );
set_rendering( iEnt, kRenderFxGlowShell, 255, 255, 255, kRenderFxNone, 27 )
set_task(12.0, "delete_entity", iVictim)
return PLUGIN_HANDLED;
}
public delete_entity(iVictim)
{
new iEntity = FM_NULLENT
while( ( iEntity = find_ent_by_class( iEntity, gMedKitClassname ) ) )
{
engfunc( EngFunc_RemoveEntity, iEntity )
}
}
Where is proper to add remove_task(iVictim),in public delete_entity(iVictim) or public Event_DeathMsg( ) ?