Need help with Aduty
#1

[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

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;
}
I got that error.
Reply


Messages In This Thread
Need help with Aduty - by Biess - 17.06.2013, 12:21
Re: Need help with Aduty - by AldoT - 17.06.2013, 15:55
Re: Need help with Aduty - by Dragonsaurus - 17.06.2013, 16:10
Re: Need help with Aduty - by Jeffry - 17.06.2013, 16:23
Re: Need help with Aduty - by DetoNater - 17.06.2013, 16:26

Forum Jump:


Users browsing this thread: 1 Guest(s)