Hello, I have a Zombie Plague server and I have problems with lags. Often happens that one human is shooting to 10-20 zombies at once, so it causes the server to lag and sometimes it crash with this error message.
Code:
FATAL ERROR (shutting down): SZ_GetSpace: overflow without FSB_ALLOWOVERFLOW set on Server Spectator Buffer
So I think that the only sollution is to make human can shoot to only one zombie at a time.
So i need code that make bullets to stop in the first enemy who is hit. I think that there should be used the fwTraceLine but don't know how.
EDIT:
Maybee this is the right way but I dont know in which function and how can I use it
PHP Code:
new Float:vecStart[3] // This should be the original start position
new Float:vecEnd[3] // And this should be the end position
new iTraceHit // hitted entity
new iEntToIgnore = MyFirstEntityToIgnore // this would change at every trace
new iTraceHandle = create_tr2()// trace handle
while(engfunc(EngFunc_TraceLine, vecStart, vecEnd, DONT_IGNORE_MONSTERS, iEntToIgnore, iTraceHandle)) // will always return 1, see engfunc.cpp
{
iTraceHit = get_tr2(iTraceHandle, TR_pHit) // getting hitted entity
if(get_global_float(GL_trace_fraction) >= 1.0) // the traceline finished at the original end position, so we will stop here
break;
if(is_user_alive(iTraceHit) && cs_get_user_team(id) != cs_get_user_team(iTraceHit)) // if you want to stop the traceline when it hits a player, use this
break;
// your functions here
// the next traceline will start at the end of the last one
iEntToIgnore = iTraceHit
get_tr2(iTraceHandle, TR_vecEndPos, vecStart)
}
get_tr2(iTraceHandle, TR_vecEndPos, vecEnd) // out of the loop, this will get the last position of the last traceline. you can use a beam effect or something if you want