Raised This Month: $ Target: $400
 0% 

Server Crash


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 02-03-2013 , 06:19   Server Crash
Reply With Quote #1

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
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 02-03-2013 at 06:19.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 02-03-2013 , 07:16   Re: Server Crash
Reply With Quote #2

Probably because variable ent in KILL function is 0. To make it store entity index you need to set task like this:
PHP Code:
set_task(4.0"KILL"ent
Also in code you posted set_task is never executed, and you should check if ent is valid in KILL function before trying to remove it.
__________________
Impossible is Nothing
Sylwester is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 02-03-2013 , 10:39   Re: Server Crash
Reply With Quote #3

Quote:
Originally Posted by Sylwester View Post
Probably because variable ent in KILL function is 0. To make it store entity index you need to set task like this:
PHP Code:
set_task(4.0"KILL"ent
Also in code you posted set_task is never executed, and you should check if ent is valid in KILL function before trying to remove it.
Still crashes
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
 }
 set_task(4.0, "KILL", ent) 
 return FMRES_SUPERCEDE
}
public KILL(ent, const model[])
{ 
 if(!pev_valid(ent) || !equal(model,"models/w_hegrenade.mdl")) 
 engfunc(EngFunc_RemoveEntity, ent);
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 02-03-2013 , 12:06   Re: Server Crash
Reply With Quote #4

You wrote that const model[] out of nowhere...
__________________
hleV is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 02-03-2013 , 12:29   Re: Server Crash
Reply With Quote #5

and the check in KILL function is wrong (right now you are trying to remove entity when it's not valid).
__________________
Impossible is Nothing
Sylwester is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 02-03-2013 , 12:29   Re: Server Crash
Reply With Quote #6

Quote:
Originally Posted by hleV View Post
You wrote that const model[] out of nowhere...
Works now thanks
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 02-04-2013 , 09:40   Re: Server Crash
Reply With Quote #7

Quote:
Originally Posted by ironskillz1 View Post
Works now thanks
Sorry its still crashes

When im spam throw dodgeball the server crashes
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
 }
 set_task(4.0, "KILL", ent) 
 return FMRES_SUPERCEDE
}
public KILL(ent)
{ 
 if(!pev_valid(ent))
return FMRES_IGNORED
 engfunc(EngFunc_RemoveEntity, ent);
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 02-04-2013 at 09:42.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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