17.06.2013, 12:21
[07:22:03] [debug] Run time error 4: "Array index out of bounds"
[07:22:03] [debug] Accessing element at index 999 past array upper bound 500
[07:22:03] [debug] AMX backtrace:
[07:22:03] [debug] #0 0007730c in public OnPlayerStateChange (0x00000003, 0x00000001, 0x0000000
from EXRPu19.amx
I got that error.
[07:22:03] [debug] Accessing element at index 999 past array upper bound 500
[07:22:03] [debug] AMX backtrace:
[07:22:03] [debug] #0 0007730c in public OnPlayerStateChange (0x00000003, 0x00000001, 0x0000000
![Cool](images/smilies/cool.gif)
pawn Код:
CMD:aduty(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new string[120];
if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdminDuty] == 0)
{
SendClientMessage(playerid, COLOR_GREEN, " You are now on admin duty.");
SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
format(string, sizeof(string), "** Administrator %s is now on admin duty. (/report for assistance) **", GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_YELLOW, string);
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerHealth(playerid, 9999);
SetPlayerArmour(playerid, 9999);
}
else if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdminDuty] != 0)
{
SetPlayerColor(playerid,COLOR_WHITE);
SendClientMessageEx(playerid, COLOR_GREEN, " You are now off admin duty.");
format(string, sizeof(string), "** Administrator %s is now off admin duty. **", GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_YELLOW, string);
SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
PlayerInfo[playerid][pAdminDuty] = 0;
}
}
return 1;
}