crashdetect error {+rep}
#1

Код:
[debug] Run time error 4: "Array index out of bounds"
[debug]   Accessing element at index 65535 past array upper bound 499
[debug] AMX backtrace:
[debug] #0  0001c5a4 in public OnPlayerDeath (playerid=11, killerid=65535, reason=54) at C:\update\Gf.pwn:4476
line 4476
Код:
           if(DMON[killerid] == 1)//line 4476
	   { //4477
	         GetPlayerName(killerid,killername,sizeof(killername));
	         format(string,sizeof(string), "Ai fost omorat de catre %s !", killername);
                 SendClientMessage(playerid, COLOR_DBLUE, string);
	         return 1;
	   }// line 4481
Reply
#2

Quote:
Originally Posted by c0smin
Посмотреть сообщение
Код:
[debug] Run time error 4: "Array index out of bounds"
[debug]   Accessing element at index 65535 past array upper bound 499
[debug] AMX backtrace:
[debug] #0  0001c5a4 in public OnPlayerDeath (playerid=11, killerid=65535, reason=54) at C:\update\Gf.pwn:4476
line 4476
Код:
           if(DMON[killerid] == 1)//line 4476
	   { //4477
	         GetPlayerName(killerid,killername,sizeof(killername));
	         format(string,sizeof(string), "Ai fost omorat de catre %s !", killername);
                 SendClientMessage(playerid, COLOR_DBLUE, string);
	         return 1;
	   }// line 4481
65535 = 0xFFFF - aka INVALID_PLAYER_ID.
You'll need to do a check before the if(DMON[killerid] == 1) to see if killerid matches INVALID_PLAYER_ID:
pawn Код:
if( killerid == INVALID_PLAYER_ID )
{
    //dostuff
}
else if(DMON[killerid] == 1)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)