SA-MP Forums Archive
[AJUDA] Qual e o erro? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA] Qual e o erro? (/showthread.php?tid=347481)



[AJUDA] Qual e o erro? - tonisantolia - 02.06.2012

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;




Re: [AJUDA] Qual e o erro? - blacktrindade - 02.06.2012

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


Re: [AJUDA] Qual e o erro? - paulor - 02.06.2012

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


Re: [AJUDA] Qual e o erro? - tonisantolia - 02.06.2012

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}
}; 



Re: [AJUDA] Qual e o erro? - Bruno Pereira - 02.06.2012

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;




Re: [AJUDA] Qual e o erro? - paulor - 02.06.2012

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