[ajuda]error checkpoints
#1

Esse sгo os erro =

pawn Код:
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(292) : error 001: expected token: "}", but found ")"
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(299) : error 010: invalid function or declaration
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(1180) : error 032: array index out of bounds (variable "PointCarteira")
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(1181) : error 017: undefined symbol "i"
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(1187) : error 032: array index out of bounds (variable "PointCarteira")
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(1188) : error 017: undefined symbol "i"
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(1194) : error 032: array index out of bounds (variable "PointCarteira")
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(1195) : error 017: undefined symbol "i"
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(1201) : error 032: array index out of bounds (variable "PointCarteira")
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(1202) : error 017: undefined symbol "i"
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(1208) : error 032: array index out of bounds (variable "PointCarteira")
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(1209) : error 017: undefined symbol "i"
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(1215) : error 032: array index out of bounds (variable "PointCarteira")
C:\Users\2248\Desktop\Samp\gamemodes\NovaBase.pwn(1216) : error 017: undefined symbol "i"
pawn Код:
new Float:PointCarteira[7][3] =
{
    {148.8507,-2168.2698,1.3438),
    {139.2712,-2185.3298,1.3438},
    {149.7258,-2199.6924,1.3438},
    {138.8406,-2214.6833,1.3438},
    {148.9574,-2222.3909,1.3438},
    {144.1487,-2250.9331,1.7188},
    {144.2233,-2303.0369,1.3438}
}; //error


    switch(Stats[playerid])
    {
        case 1:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[2][1], PointCarteira[2][2], PointCarteira[2][3], PointCarteira[3][1], PointCarteira[3][2], PointCarteira[3][3], 10);
            Stats[i] = 2;
            return 1;
        }
        case 2:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[3][1], PointCarteira[3][2], PointCarteira[3][3], PointCarteira[4][1], PointCarteira[4][2], PointCarteira[4][3], 10);
            Stats[i] = 3;
            return 1;
        }
        case 3:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[4][1], PointCarteira[4][2], PointCarteira[4][3], PointCarteira[5][1], PointCarteira[5][2], PointCarteira[5][3], 10);
            Stats[i] = 4;
            return 1;
        }
        case 4:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[5][1], PointCarteira[5][2], PointCarteira[5][3], PointCarteira[6][1], PointCarteira[6][2], PointCarteira[6][3], 10);
            Stats[i] = 5;
            return 1;
        }
        case 5:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[6][1], PointCarteira[6][2], PointCarteira[6][3], PointCarteira[7][1], PointCarteira[7][2], PointCarteira[7][3], 10);
            Stats[i] = 6;
            return 1;
        }
        case 6:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[7][1], PointCarteira[7][2], PointCarteira[7][3], PointCarteira[7][1], PointCarteira[7][2], PointCarteira[7][3]-5, 10);
            Stats[i] = 7;
            return 1;
        }
Reply
#2

pawn Код:
stock IsNumeric(const string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
        if(string[i] > '9' || string[i] < '0') return 0;

    return 1;
}
tenta ae
Reply
#3

Quote:
Originally Posted by histire
Посмотреть сообщение
pawn Код:
stock IsNumeric(const string[])
{
    for (new i = 0, j = strlen(string); i < j; i++)
        if(string[i] > '9' || string[i] < '0') return 0;

    return 1;
}
tenta ae
que isso vйi ?
Reply
#4

biscoito -.-, uso isso quando й para todos player [i]
Reply
#5

Quote:
Originally Posted by histire
Посмотреть сообщение
biscoito -.-, uso isso quando й para todos player [i]
new tendi :/
Mais alguem ?
Ajuda ??
Reply
#6

tu pois para testar almenos carA?
Reply
#7

Retirei os erros do seu cуdigo :



pawn Код:
//A variбvel array PointCarteira:

new Float:PointCarteira[7][3] =
{
    {148.8507,-2168.2698,1.3438},
    {139.2712,-2185.3298,1.3438},
    {149.7258,-2199.6924,1.3438},
    {138.8406,-2214.6833,1.3438},
    {148.9574,-2222.3909,1.3438},
    {144.1487,-2250.9331,1.7188},
    {144.2233,-2303.0369,1.3438}
};


//O switch:

switch(Stats[playerid])
    {
        case 1:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[0][0], PointCarteira[0][1], PointCarteira[0][2], PointCarteira[1][0], PointCarteira[1][1], PointCarteira[1][2], 10);
            Stats[playerid] = 2;
            return 1;
        }
        case 2:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[1][0], PointCarteira[1][1], PointCarteira[1][2], PointCarteira[2][0], PointCarteira[2][1], PointCarteira[2][2], 10);
            Stats[playerid] = 3;
            return 1;
        }
        case 3:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[2][0], PointCarteira[2][1], PointCarteira[2][2], PointCarteira[3][0], PointCarteira[3][1], PointCarteira[3][2], 10);
            Stats[playerid] = 4;
            return 1;
        }
        case 4:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[3][0], PointCarteira[3][1], PointCarteira[3][2], PointCarteira[4][0], PointCarteira[4][1], PointCarteira[4][2], 10);
            Stats[playerid] = 5;
            return 1;
        }
        case 5:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[4][0], PointCarteira[4][1], PointCarteira[4][2], PointCarteira[5][0], PointCarteira[5][1], PointCarteira[5][2], 10);
            Stats[playerid] = 6;
            return 1;
        }
        case 6:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[5][0], PointCarteira[5][1], PointCarteira[5][2], PointCarteira[6][0], PointCarteira[6][1], PointCarteira[6][2], 10);
            Stats[playerid] = 7;
            return 1;
        }
    }


Espero ter ajudado .
Reply
#8

Quote:
Originally Posted by rjjj
Посмотреть сообщение
Retirei os erros do seu cуdigo :



pawn Код:
//A variбvel array PointCarteira:

new Float:PointCarteira[7][3] =
{
    {148.8507,-2168.2698,1.3438},
    {139.2712,-2185.3298,1.3438},
    {149.7258,-2199.6924,1.3438},
    {138.8406,-2214.6833,1.3438},
    {148.9574,-2222.3909,1.3438},
    {144.1487,-2250.9331,1.7188},
    {144.2233,-2303.0369,1.3438}
};


//O switch:

switch(Stats[playerid])
    {
        case 1:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[0][0], PointCarteira[0][1], PointCarteira[0][2], PointCarteira[1][0], PointCarteira[1][1], PointCarteira[1][2], 10);
            Stats[playerid] = 2;
            return 1;
        }
        case 2:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[1][0], PointCarteira[1][1], PointCarteira[1][2], PointCarteira[2][0], PointCarteira[2][1], PointCarteira[2][2], 10);
            Stats[playerid] = 3;
            return 1;
        }
        case 3:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[2][0], PointCarteira[2][1], PointCarteira[2][2], PointCarteira[3][0], PointCarteira[3][1], PointCarteira[3][2], 10);
            Stats[playerid] = 4;
            return 1;
        }
        case 4:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[3][0], PointCarteira[3][1], PointCarteira[3][2], PointCarteira[4][0], PointCarteira[4][1], PointCarteira[4][2], 10);
            Stats[playerid] = 5;
            return 1;
        }
        case 5:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[4][0], PointCarteira[4][1], PointCarteira[4][2], PointCarteira[5][0], PointCarteira[5][1], PointCarteira[5][2], 10);
            Stats[playerid] = 6;
            return 1;
        }
        case 6:
        {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[5][0], PointCarteira[5][1], PointCarteira[5][2], PointCarteira[6][0], PointCarteira[6][1], PointCarteira[6][2], 10);
            Stats[playerid] = 7;
            return 1;
        }
    }


Espero ter ajudado .
BOM RJJJ
o seu ta perfeito e tal'z
Mas eu tenho um comando pra iniciar essses checkpoints.
no caso esse case 1:
....
tem que clocar ele como PointCarteira..[1][1]....[1][2] se comeзar do 0 vai bugar ne ?
Reply
#9

Quote:
Originally Posted by MagneticLove-
Посмотреть сообщение
BOM RJJJ
o seu ta perfeito e tal'z
Mas eu tenho um comando pra iniciar essses checkpoints.
no caso esse case 1:
....
tem que clocar ele como PointCarteira..[1][1]....[1][2] se comeзar do 0 vai bugar ne ?

Nгo necessariamente, isso dependeria desse comando .



Se o comando de iniciar a sequкncia de checkpoints for como este abaixo por exemplo, ocorreria tudo bem :



pawn Код:
if(!strcmp(cmdtext, "/iniciar", true))
    {
        SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[0][0], PointCarteira[0][1], PointCarteira[0][2], PointCarteira[0][0], PointCarteira[0][1], PointCarteira[0][2], 10);
        Stats[playerid] = 1;
        return true;
    }


Pois quando o jogador tocasse no checkpoint criado pelo comando este desapareceria para dar lugar ao primeiro da sequкncia, que seria idкntico a ele.



Espero ter ajudado .
Reply
#10

Quote:
Originally Posted by rjjj
Посмотреть сообщение
Nгo necessariamente, isso dependeria desse comando .



Se o comando de iniciar a sequкncia de checkpoints for como este abaixo por exemplo, ocorreria tudo bem :



pawn Код:
if(!strcmp(cmdtext, "/iniciar", true))
    {
        SetPlayerRaceCheckpoint(playerid, 0, PointCarteira[0][0], PointCarteira[0][1], PointCarteira[0][2], PointCarteira[0][0], PointCarteira[0][1], PointCarteira[0][2], 10);
        Stats[playerid] = 1;
        return true;
    }


Pois quando o jogador tocasse no checkpoint criado pelo comando este desaparecia para dar lugar ao primeiro da sequкncia, que seria idкntico a ele.



Espero ter ajudado .
Bom й um loop

pawn Код:
CMD:iniciarteste(playerid)
{
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected(i))
        {
            Stats[i] = 1;
            return 1;
        }
    }
    return 1;
}
tem problemas nгo ne ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)