19.12.2017, 02:15
Olб amigos, estou criando um sistema de Fallout simples, o compilador atй passa, mas ingame estб crashando o servidor. Passei o Crashdetect e deu isso.
Poderiam me ajudar?
Code:
[01:05:28] [debug] Run time error 4: "Array index out of bounds" [01:05:28] [debug] Attempted to read/write array element at index 50 in array of size 50 [01:05:28] [debug] AMX backtrace: [01:05:28] [debug] #0 002c4958 in public IniciandoFallout () at C:\Users\User\Desktop\gamemodes\DME.pwn:45320
PHP Code:
function IniciandoFallout()
{
SetTimer("TimerFallout", 1000, 0);
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(Player[i][EmEvento] == 1) //Linha do Erro
{
new Random = random(sizeof(SpawnFallout));
SetPlayerPos(i, SpawnFallout[Random][0], SpawnFallout[Random][1], SpawnFallout[Random][2]);
SendClientMessage(i, COR_CV, "Evento Iniciado! Boa Sorte!");
TogglePlayerControllable(i, 1);
}
}
}