AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Server crash (https://forums.alliedmods.net/showthread.php?t=206694)

ironskillz1 01-25-2013 07:39

Server crash
 
Why do this make my server crash ?
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
 }
 if(task_exists(ent))
 remove_task(ent);
 set_task(2.0,"delete_it",ent);
 return FMRES_SUPERCEDE
}

Code:

public delete_it(ent) {
if(pev_valid(ent))
{  engfunc(EngFunc_RemoveEntity, ent);
 return FMRES_SUPERCEDE;
 }
return FMRES_IGNORED;
}



All times are GMT -4. The time now is 20:41.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.