Server stuck for few seconds
#1

Hi. Somewhen my server gets stuck for few seconds to all the players. All the timers are blocked, a command doesn't work anymore but i don't know why. Can I see with a plugin which part of script provoke it?


I don't have anything on ONPLAYERUPDATE.


PS: I use some trains and sometimes i receive those warnings :

Код HTML:
 Warning: Vehicle X was not deleted.
Do you think that is the reason?
Reply
#2

use crashdetect plugin
Reply
#3

Quote:
Originally Posted by Shinja
Посмотреть сообщение
use crashdetect plugin
I use it already but i didn't receive nothing about it. I am receiving some warnings which was until now.

Код HTML:
20:20:49] [debug] Run time error 4: "Array index out of bounds"
[20:20:49] [debug]  Accessing element at index 1000 past array upper bound 999
[20:20:49] [debug] AMX backtrace:
[20:20:49] [debug] #0 001459fc in public AB_OnPlayerDeath (playerid=119, killerid=17, reason=24) at D:\server\gmi.pwn:24084
[20:20:49] [debug] #1 0001fbf0 in public OnPlayerDeath (playerid=119, killerid=17, reason=24) at D:\server\pawno\include\OPA.inc:71
I don't know what's wrong on it.
OPA.INC code:

Код HTML:
public OnPlayerDeath(playerid, killerid, reason)
{
	g_abLastTick[playerid] = gettime() + 3;

	#if defined AB_OnPlayerDeath
	    AB_OnPlayerDeath(playerid, killerid, reason);
	#endif
	return 1;
}
Line 71 is :
Код HTML:
return 1;
Reply
#4

I'm not aware of the cause of your problem but for the run time error 4, you'll need to post line 24084 from gmi.pwn file and few lines before and after that line. Seeing the upper bound to be 999, it is most likely a player-array (MAX_PLAYERS is defined as 1000) and you probably use a loop with "... <= MAX_PLAYERS". I can't be sure though unless you post the code.
Reply
#5

Well, something is obviously hogging the CPU time. Experience has taught me that the likely cause is excessive file IO.
Reply
#6

I think that I found the problem. Until now i used /members with dialog. I had the dialog everywhere, and in the last update i changed it with ShowMember(playerid); - call function.

I use ' stock ShowMembers(playerid) ' to show that dialog.

Do I have to use it like ' public ShowMembers(playerid) ' no ? I saw that command makes lag/desync on server.

It could be the problem ( stock or public )?
Reply
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I'm not aware of the cause of your problem but for the run time error 4, you'll need to post line 24084 from gmi.pwn file and few lines before and after that line. Seeing the upper bound to be 999, it is most likely a player-array (MAX_PLAYERS is defined as 1000) and you probably use a loop with "... <= MAX_PLAYERS". I can't be sure though unless you post the code.
Код HTML:
	if(killerid != 255)
		{
			if(GetPlayerState(killerid) == 2)
			{
				SendClientMessage(killerid, COLOR_YELLOW, "DriveBy Kill!");
				return 1;
			}
		}
		if(PlayerData[playerid][pGroup] == 7 || PlayerData[playerid][pGroup] == 10 || PlayerData[killerid][pGroup] == 7 || PlayerData[killerid][pGroup] == 10)
		{
			foreach(Player, x)
			{
			    if(PlayerData[x][pGroup] == 7 || PlayerData[x][pGroup] == 10)
				{
					SendDeathMessageToPlayer(x, killerid, playerid, reason);
				}
            }
					if(PlayerData[killerid][pRKills] < 30)
					{
					    PlayerData[killerid][pRKills] += 1;
					}
					PlayerData[playerid][pMoney] -= 500;
					PlayerData[killerid][pMoney] += 500;

		}
Line 24084:
Код HTML:
 if(PlayerData[playerid][pGroup] == 7 || PlayerData[playerid][pGroup] == 10 || PlayerData[killerid][pGroup] == 7 || PlayerData[killerid][pGroup] == 10)
Also, i have this warnings from crashdetect:


Код HTML:
[09:56:40] [debug] Run time error 4: "Array index out of bounds"
[09:56:40] [debug]  Accessing element at index 43 past array upper bound 42
[09:56:40] [debug] AMX backtrace:
[09:56:40] [debug] #0 000f1104 in public IsPlayerInTurf (playerid=52, turfid=43) at D:\server\4iulie\gmi.pwn:18125
[09:56:40] [debug] #1 0014a448 in public AB_OnPlayerDeath (playerid=52, killerid=29, reason=29) at D:\server\gmi.pwn:24476
[09:56:40] [debug] #2 0001fbf0 in public OnPlayerDeath (playerid=52, killerid=29, reason=29) at D:\server\pawno\include\OPA.inc:71
From onplayerdeath:
Код HTML:
for(new i = 0; i <= sizeof(TurfInfo); i++)
			{
			    if(IsPlayerInTurf(playerid, i))
			    {
	new string[144];
		    if(WarInfo[i][wTime] > 0)
				{if(i == i)
					{
Line 24476:
Код HTML:
if(IsPlayerInTurf(playerid, i))
And from ISPLAYERINTURF:

Код HTML:
public IsPlayerInTurf(playerid, turfid)
{
		if(turfid == -1)
		{
			return 0;
		}
		new Float:x, Float:y, Float:z;
		GetPlayerPos(playerid,x,y,z);
		if(x >= TurfInfo[turfid][zMinX] && x < TurfInfo[turfid][zMaxX] && y >= TurfInfo[turfid][zMinY] && y < TurfInfo[turfid][zMaxY])
		{
	 		return 1;
		}
	return 0;
}
Line 18125:
Код HTML:
if(x >= TurfInfo[turfid][zMinX] && x < TurfInfo[turfid][zMaxX] && y >= TurfInfo[turfid][zMinY] && y < TurfInfo[turfid][zMaxY])
I use an enum with:
Код HTML:
new TurfInfo[43][zInfo];
Reply
#8

Have you modified the code since then? The line reported wouldn't cause this.

About the last report, in OnPlayerDeath, replace:
pawn Код:
for(new i = 0; i <= sizeof(TurfInfo); i++)
with:
pawn Код:
for(new i = 0; i < sizeof(TurfInfo); i++)
When declaring an array with N size, the valid indexes are always 0 to N-1. Any other value will result to run time error 4.
Reply
#9

I didn't modified anything.

Also, i reive now:

[15:22:29] [debug] Run time error 4: "Array index out of bounds"
[15:22:29] [debug] Accessing element at index 1000 past array upper bound 999
[15:22:29] [debug] AMX backtrace:
[15:22:29] [debug] #0 000cb3f0 in public Theft (playerid=1000) at D:\server\gmi.pwn:15196


Код HTML:
forward Theft(playerid);
public Theft(playerid)
{
	if(PlayerData[playerid][pTheftA] < 1000)
	{
	    if(PlayerData[playerid][pWarrants] + 1 > 6)
									{
										PlayerData[playerid][pWarrants] = 6;
										SetPlayerWantedLevel(playerid, 6);
									}
									else
									{
								    PlayerData[playerid][pWarrants] += 1;
								    SetPlayerWantedLevel(playerid, PlayerData[playerid][pWarrants]);
								    }
							new szTargetName[MAX_PLAYER_NAME];
							GetPlayerName(playerid, szTargetName, MAX_PLAYER_NAME);
							format(szMessage, sizeof(szMessage), "Dispecer: %s (%d)have wanted: 'theft'. Reporter: %s (%d). Wanted: +1 | Wanted Level: %d", szTargetName, playerid, PlayerData[PlayerData[playerid][pTheftA]][pNormalName], PlayerData[playerid][pTheftA], PlayerData[playerid][pWarrants]);
							sendDepartmentMessage(COLOR_RADIOCHAT, szMessage);
			PlayerData[PlayerData[playerid][pTheftA]][pTheft] = 1000;
			PlayerData[PlayerData[playerid][pTheftA]][pThefted] = 0;
			PlayerData[playerid][pTheftA] = 1000;
	}
	return 1;
}
What's wrong?
Reply
#10

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)