PDA

View Full Version : Server Crashing.


MBilal
16/01/2018, 12:17 PM
Hello

My server start crashing badly after few hours, I'm using Crashdetect but it doesn't detect any errors.
server crash after few hours i almost deleted 25 percent gamemode to fix that crash issue kindly guide me
any other plugin that can detect crash. Because crashdetect not giving any error.

I also used -d3 in pawn.cfg but not able to detect any errors kindly guide Please.

Thanks

Dayrion
16/01/2018, 12:46 PM
What logs says?

MBilal
16/01/2018, 12:54 PM
What logs says?
Bro

Take a look at the pastebin
https://pastebin.com/UTbzS64C
But as u saw the last logs are clear before crash.

[13:14:23] [debug] Run time error 4: "Array index out of bounds"
[13:14:23] [debug] AMX backtrace:
[13:14:23] [debug] #0 000024b4 in public OnPlayerWeaponShot (playerid=3, weaponid=24, hittype=1, hitid=65535, Float:fX=0.05202, Float:fY=0.05553, Float:fZ=0.11593) at D:\Game\Samp\pawno\include\BustAim.inc:322

But i use to get this error rarely I am using Bustaim.inc

Here is that Include.
http://forum.sa-mp.com/showthread.php?t=573385
But i must say this error coming from 5 to 6 months but that doesn't crash server.
it's something else.

I just checking the logs server doesn't crash but i got this warnings.

[14:39:08] [debug] Run time error 4: "Array index out of bounds"
[14:39:08] [debug] AMX backtrace:
[14:39:08] [debug] #0 00114c8c in public cmd_warn (playerid=5, params[]=@01a8149c "39 yes?") at D:\Game\Samp\gamemodes\GGW.pwn:7899
[14:39:08] [debug] #1 native CallLocalFunction () from samp03svr
[14:39:08] [debug] #2 00073208 in public OnPlayerCommandText (playerid=5, cmdtext[]=@01a81464 "/warn 39 yes?") at D:\Game\Samp\pawno\include\zcmd.inc:112

CMD:warn(playerid, params[])
{
if(pInfo[playerid][pLevel] < 1 )return ShowMessage(playerid, COLOR_RED, 1);
new id,reason[128];
if(sscanf(params, "us[128]", id,reason)) return SCM(playerid, COLOR_YELLOW, "[SYSTEM] : /warn <Player ID/Part of Name> <Reason>");
if(pInfo[playerid][pLevel] < pInfo[id][pLevel]) return ShowMessage(playerid, COLOR_RED, 6);
if(!IsPlayerConnected(id) || id == playerid || id == INVALID_PLAYER_ID)return ShowMessage(playerid,COLOR_RED,3);
switch(pInfo[id][Warnings])
{
case 0,1:
{
format(Jstring,sizeof(Jstring),"Admin '%s' has given '%s' a Warning | Reason: %s |Warnings: %d/3|",GetName(playerid),GetName(id),reason,pInfo[id][Warnings]);
SCMToAll(COLOR_RED,Jstring);
GameTextForPlayer(id, "~n~~n~~n~~n~~n~~n~~r~~h~~h~You are Warned!", 3000, 3 );
PlayerPlaySound(id,17802,0.0,0.0,0.0);
}
case 2:
{
format(Jstring,sizeof(Jstring),"Admin '%s' has kicked '%s' for %s | Warnings: %d/3 |",GetName(playerid),GetName(id),reason,pInfo[id][Warnings]);
SCMToAll(COLOR_RED,Jstring);
SetTimerEx("KickPlayer",200,false,"d", id);
}
}
pInfo[id][Warnings]++;
return 1;
}

wow i get more errors lol

[15:36:22] [debug] Run time error 4: "Array index out of bounds"
[15:36:22] [debug] AMX backtrace:
[15:36:22] [debug] #0 00025ad4 in AddRejectedHit (playerid=65535, damagedid=5, reason=19, weapon=49, i1=1111883777, i2=0, i3=0) at D:\Game\Samp\pawno\include\weapon-config.inc:5308
[15:36:22] [debug] #1 00015ecc in public OnPlayerTakeDamage (playerid=5, issuerid=65535, Float:amount=49.50000, weaponid=49, bodypart=3) at D:\Game\Samp\pawno\include\weapon-config.inc:3373
[15:36:29] [debug] Run time error 4: "Array index out of bounds"
[15:36:29] [debug] AMX backtrace:
[15:36:29] [debug] #0 00025ad4 in AddRejectedHit (playerid=65535, damagedid=5, reason=19, weapon=49, i1=1111883777, i2=0, i3=0) at D:\Game\Samp\pawno\include\weapon-config.inc:5308
[15:36:29] [debug] #1 00015ecc in public OnPlayerTakeDamage (playerid=5, issuerid=65535, Float:amount=49.50000, weaponid=49, bodypart=3) at D:\Game\Samp\pawno\include\weapon-config.inc:3373
[15:36:39] [connection] incoming connection: 150.129.198.123:23519 id: 61
[15:36:40] [join] Bawa has joined the server (61:150.129.198.123)
[15:36:53] [debug] Run time error 4: "Array index out of bounds"
[15:36:53] [debug] AMX backtrace:
[15:36:53] [debug] #0 00025ad4 in AddRejectedHit (playerid=65535, damagedid=5, reason=19, weapon=49, i1=1111883777, i2=0, i3=0) at D:\Game\Samp\pawno\include\weapon-config.inc:5308
[15:36:53] [debug] #1 00015ecc in public OnPlayerTakeDamage (playerid=5, issuerid=65535, Float:amount=49.50000, weaponid=49, bodypart=3) at D:\Game\Samp\pawno\include\weapon-config.inc:3373
These errors from this include

http://forum.sa-mp.com/showthread.php?t=563387

But this error appear first time.

Dayrion
16/01/2018, 06:10 PM
I think those includes are clean and the problem come from your own code. You'll need to show step by step, each errors and the code associate. More detailled and clear your explains are, more we can help you, I guess ;p

MBilal
17/01/2018, 09:35 AM
I think those includes are clean and the problem come from your own code. You'll need to show step by step, each errors and the code associate. More detailled and clear your explains are, more we can help you, I guess ;p
These are the only errors i got lol.

Misiur
17/01/2018, 09:56 AM
if(pInfo[playerid][pLevel] < pInfo[id][pLevel]) return ShowMessage(playerid, COLOR_RED, 6);
if(!IsPlayerConnected(id) || id == playerid || id == INVALID_PLAYER_ID)return ShowMessage(playerid,COLOR_RED,3);

Flip those lines to get rid of command's runtime error.

MBilal
17/01/2018, 11:29 AM
if(pInfo[playerid][pLevel] < pInfo[id][pLevel]) return ShowMessage(playerid, COLOR_RED, 6);
if(!IsPlayerConnected(id) || id == playerid || id == INVALID_PLAYER_ID)return ShowMessage(playerid,COLOR_RED,3);

Flip those lines to get rid of command's runtime error.

Oh shit i understand that if invalid id come and he camparing some one id with invalid id that will cause runtime
+1
I'll try to check all commands in server.
But kindly me help me out for fixing the other crash errors.

Dayrion
17/01/2018, 07:47 PM
You should check if the player is valid (connected) before treating the code. I'm talking about every callback/commands related to the players like Misiur said.
Do you have any problems left?

MBilal
18/01/2018, 12:45 PM
You should check if the player is valid (connected) before treating the code. I'm talking about every callback/commands related to the players like Misiur said.
Do you have any problems left?
Server still crashing but I'm getting no errors this time and it crashing after few hours sometime after 8 to 9 hours some time 5 to 6 hours.

Actually the problem started i tried to reduce the size of amx i removed many Global varaibles even timers and trying and start using SetPVarInt() and GetPVarInt this reduce the size of amx but they are slow i know that after adding them my server become shit. I even removed all of them where ever i used them but the crash issue not going.

I was even using SetPVarInt(playerid,"Timer",SetTimerEx("OnPlayerSomething",1000,0,"d",playerid));

KillTimer(playerid,GetPVarInt(playerid,"Timer"));

I even removed those timer and move them back to global varaibles but the crash not fixing still.