[AJUDA] Qual e o erro?
#1

PHP код:
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 (c1997-2006ITB CompuPhase
4 Errors

Linhas:
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    for(new 
0MAX_PLAYERSi++)
    {
        switch(
Stats[playerid])
        {
            case 
1:
            {
                
DisablePlayerRaceCheckpoint(playerid);
                
SetPlayerRaceCheckpoint(playerid0Checkpoints[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(playerid0Checkpoints[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(playerid1Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3]-510);
                
Stats[i] = 4;
                return 
1;
            }
            case 
4:
            {
                
DisablePlayerRaceCheckpoint(playerid);
                
GameTextForPlayer(playerid"You have won the race!!"30001);
                
GivePlayerMoney(playerid10000);
                return 
1;
            }
        }
    }
    return 
1;

Reply
#2

Aumenta o Limite da Array Checkpoints
@nao tenho certeza se й isto!
Reply
#3

Quote:
Originally Posted by blacktrindade
Посмотреть сообщение
Aumenta o Limite da Array Checkpoints
@nao tenho certeza se й isto!
Й isso msm!
Reply
#4

Nгo entendi.. ta ai a new..
PHP код:
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}
}; 
Reply
#5

Tenta assim

PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    for(new 
0MAX_PLAYERSi++)
    {
        switch(
Stats[playerid])
        {
            case 
1:
            {
                
DisablePlayerRaceCheckpoint(playerid);
                
SetPlayerRaceCheckpoint(playerid0Checkpoints[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(playerid0Checkpoints[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(playerid1Checkpoints[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!!"30001);
                
GivePlayerMoney(playerid10000);
                return 
1;
            }
        }
    }
    return 
1;

Reply
#6

Seu erro foi aki:
pawn Код:
Checkpoints[4][1]
O certo seria 3, pois ele comeзa pelo 0 atй o 3 ficando 4.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)