Why do my server Crash when im using kill code
Code:
set_pev(ent, pev_flags, pev(ent, pev_flags) | FL_KILLME);
¨
or
Code:
engfunc(EngFunc_RemoveEntity, ent);
Code:
register_forward(FM_SetModel, "fwdSetModel", 1);
Code:
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
set_task( 4.0, "KILL")
}
Code:
public KILL(ent)
{
engfunc(EngFunc_RemoveEntity, ent);
}
When i throw some Dodgeball they disspear after 4 seconds but then the server crash
__________________