Run time error 4 " array index out of bounds "
#1

Been getting this problem for a little while now.

This is showing up after i made the code for OnPlayerDeath.

Код:
[22:48:50] [debug] Run time error 4: "Array index out of bounds"
[22:48:50] [debug]  Attempted to read/write array element at index 65535 in array of size 1000
[22:48:50] [debug] AMX backtrace:
[22:48:50] [debug] #0 0000a98c in public OnPlayerDeath (0, 65535, 255) from apoc-rp.amx
Код:
forward OnPlayerDeath(playerid, killerid, reason);
public OnPlayerDeath(playerid, killerid, reason)
{    
    if(IsPlayerConnected(playerid))
    {
        ZombieTeam(playerid);
        if(killerid != INVALID_PLAYER_ID)
        {
            pInfo[playerid][Kills]++;
        }
    }
    if(pInfo[killerid][Human] == 1)
    {
        if(pInfo[playerid][Human] == 1)
        {
            new str[100];
            format(str, sizeof(str),"[LOG]: %s has been killed by %s",GetName(playerid), GetName(killerid));
            ResetPlayerWeapons(playerid);
            SendAdminsMessage(1, -1, str);
            ZombieTeam(playerid);
            printf("[LOG]: %s has been killed by %s",GetName(playerid), GetName(killerid));
        }
        else if(pInfo[playerid][Zombie] == 1)
        {
            pInfo[killerid][Tokens] += 250;
        }    
    }
    return 1;    
}
Any suggestion to why this, a fix if possible and a brief summary on how to avoid the problem in future.
Reply


Messages In This Thread
Run time error 4 " array index out of bounds " - by Stones - 02.06.2017, 22:22
Re: Run time error 4 " array index out of bounds " - by Variable™ - 02.06.2017, 22:25
Re: Run time error 4 " array index out of bounds " - by Stones - 02.06.2017, 22:31
Re: Run time error 4 " array index out of bounds " - by Variable™ - 02.06.2017, 22:33

Forum Jump:


Users browsing this thread: 1 Guest(s)