Server stuck for few seconds
#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


Messages In This Thread
Server stuck for few seconds - by Nin9r - 20.08.2016, 18:45
Re: Server stuck for few seconds - by Shinja - 20.08.2016, 18:52
Re: Server stuck for few seconds - by Nin9r - 20.08.2016, 19:16
Re: Server stuck for few seconds - by Konstantinos - 20.08.2016, 19:20
Re: Server stuck for few seconds - by Vince - 20.08.2016, 19:37
Re: Server stuck for few seconds - by Nin9r - 20.08.2016, 19:41
Re: Server stuck for few seconds - by Nin9r - 21.08.2016, 07:32
Re: Server stuck for few seconds - by Konstantinos - 21.08.2016, 08:49
Re: Server stuck for few seconds - by Nin9r - 21.08.2016, 10:35
Re: Server stuck for few seconds - by Nin9r - 21.08.2016, 12:37

Forum Jump:


Users browsing this thread: 2 Guest(s)