C:\Documents and Settings\Rodrigues І°№І\Meus documentos\Downloads\Arquivos samp\samp03e_svr_win32\gamemodes\BPW.pwn(231) : error 032: array index out of bounds (variable "Checkpoints")
C:\Documents and Settings\Rodrigues І°№І\Meus documentos\Downloads\Arquivos samp\samp03e_svr_win32\gamemodes\BPW.pwn(238) : error 032: array index out of bounds (variable "Checkpoints")
C:\Documents and Settings\Rodrigues І°№І\Meus documentos\Downloads\Arquivos samp\samp03e_svr_win32\gamemodes\BPW.pwn(245) : error 032: array index out of bounds (variable "Checkpoints")
C:\Documents and Settings\Rodrigues І°№І\Meus documentos\Downloads\Arquivos samp\samp03e_svr_win32\gamemodes\BPW.pwn(508) : error 032: array index out of bounds (variable "Checkpoints")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
public OnPlayerEnterCheckpoint(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
switch(Stats[playerid])
{
case 1:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], 10);
Stats[i] = 2;
return 1;
}
case 2:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], 10);
Stats[i] = 3;
return 1;
}
case 3:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3]-5, 10);
Stats[i] = 4;
return 1;
}
case 4:
{
DisablePlayerRaceCheckpoint(playerid);
GameTextForPlayer(playerid, "You have won the race!!", 3000, 1);
GivePlayerMoney(playerid, 10000);
return 1;
}
}
}
return 1;
}
Aumenta o Limite da Array Checkpoints
@nao tenho certeza se й isto! |
new Float:Checkpoints[4][3] = //4 = 4 coordenadas | 3 = 3 "valores" (X,Y,Z)
{
{1808.5759,1693.6014,6.3078},
{1808.3872,1900.6215,6.0992},
{1808.8514,2092.7910,3.4800},
{1822.8774,2203.6882,5.7719}
};
public OnPlayerEnterCheckpoint(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
switch(Stats[playerid])
{
case 1:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[0][1], Checkpoints[0][2], Checkpoints[0][3], Checkpoints[1][1], Checkpoints[1][2], Checkpoints[1][3], 10);
Stats[i] = 2;
return 1;
}
case 2:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[1][1], Checkpoints[1][2], Checkpoints[1][3], Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], 10);
Stats[i] = 3;
return 1;
}
case 3:
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], 10);
Stats[i] = 4;
return 1;
}
case 4:
{
DisablePlayerRaceCheckpoint(playerid);
GameTextForPlayer(playerid, "You have won the race!!", 3000, 1);
GivePlayerMoney(playerid, 10000);
return 1;
}
}
}
return 1;
}
Checkpoints[4][1]