[Ajuda] Run time error 4: "Array index out of bounds"
#1

Код:
[00:18:03] [debug] Run time error 4: "Array index out of bounds"
[00:18:03] [debug]  Accessing element at index 39565151 past array upper bound 69
[00:18:03] [debug] AMX backtrace:
[00:18:03] [debug] #0 000644b0 in ?? () from TrNewGM.amx
[00:18:03] [debug] #1 0002c584 in public cmd_pato () from TrNewGM.amx
[00:18:03] [debug] #2 native CallLocalFunction () [00472ad0] from samp-server.exe
[00:18:03] [debug] #3 00002258 in public OnPlayerCommandText () from TrNewGM.amx
Ajuda ?
Reply
#2

Код:
new array[ MAX_PLAYERS ];

array[ 39565151 ] = something;//indexed oob
Reply
#3

Verifique seu cуdigo, vocк estб tentando acessar valores que nгo foram criados, exemplo:

pawn Код:
new my_variable[10];


my_variable[21] = 'a';
Reply
#4

pawn Код:
stock RandomPlayerPato()
{
    new OnlineUser[MAX_PLAYERS], ContaPlayers = 0;
    for(new i = 0; i <= MAX_PLAYERS; i++)
        if(IsPlayerConnected(i))
            if(Afk[i] == false)
                if(PlayerLogado[i] == true)
                    if(GetPlayerState(i) != PLAYER_STATE_SPECTATING)
                        if(GetPlayerVirtualWorld(i) == 0)
                            if(!PlayerEsc(i))
                                if(!IsInTrampolim(i))
                                    if(!IsARCvehicle(GetPlayerVehicleID(i)))
                                        if(PlayerInfo[i][tempopreso] == 0)
                                            if(IsPlayerInArea(i,PatoArea))
                                                if(!IsPlayerNPC(i))
                                                    OnlineUser[ContaPlayers] = i, ContaPlayers++;
    return OnlineUser[random(ContaPlayers)];
}
Mas continua a dar esse erro...
Reply
#5

Alguem ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)