SA-MP Forums Archive
[Ajuda] Erro ao Copilar - 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] Erro ao Copilar (/showthread.php?tid=297454)



[Ajuda] Erro ao Copilar - Oakley_TwOPaCk - 16.11.2011

Galera to usando um sistema de ADM do meu Colega Lуs soque ta dano uns erros, Tipo coloquei ele no meu GM q estou criando de Corrida de Rua e os erros sгo os seguintes :
pawn Код:
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(91) : error 021: symbol already defined: "strtok"
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(105) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(123) : error 017: undefined symbol "IsNumeric"
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(133) : warning 217: loose indentation
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(160) : warning 217: loose indentation
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(160) : error 029: invalid expression, assumed zero
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(160) : error 017: undefined symbol "IsNumeric"
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(160) : error 029: invalid expression, assumed zero
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(160) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


7 Errors.
Erro Linha 105
pawn Код:
return result;
Erro Linha 133
pawn Код:
new len = strlen(text[pos]);
Erro Linha 160
pawn Код:
stock IsNumeric(const string[])
Me ajudem por favor ^^


Re: [Ajuda] Erro ao Copilar - Jason` - 16.11.2011

strtok deve estar definido jб em alguma local no proprio script ou em alguma include, veja isto.


Re: [Ajuda] Erro ao Copilar - Oakley_TwOPaCk - 16.11.2011

pawn Код:
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(105) : error 017: undefined symbol "IsNumeric"
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(115) : warning 217: loose indentation
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(142) : warning 217: loose indentation
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(142) : error 029: invalid expression, assumed zero
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(142) : error 017: undefined symbol "IsNumeric"
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(142) : error 029: invalid expression, assumed zero
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(142) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Tirei o Strtok e deu nisso '-' se Precisar das linha peзa


Re: [Ajuda] Erro ao Copilar - ViniBorn - 16.11.2011

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



Re: [Ajuda] Erro ao Copilar - Lуs - 16.11.2011

Meu sistema nгo usa strtok usa sscanf2, porque nгo pediu ajuda no prуprio tуpico? Tente colocar a stock que o Vini passou no seu GM, se nгo funcionar, poste os erros.

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
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;
}



Re: [Ajuda] Erro ao Copilar - Joker_OutLock - 16.11.2011

Use a strtok que o vini mostrou acima:

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
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;
}



Re: [Ajuda] Erro ao Copilar - Oakley_TwOPaCk - 16.11.2011

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
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;
}
Deu os seguintes Erros :

pawn Код:
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(104) : warning 217: loose indentation
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(104) : error 029: invalid expression, assumed zero
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(104) : error 017: undefined symbol "IsNumeric"
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(104) : error 029: invalid expression, assumed zero
C:\Documents and Settings\FAMILIA_\Desktop\GM Novo\gamemodes\Untitled.pwn(104) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Linha 104 Erro :
pawn Код:
stock IsNumeric(const string[])



Re: [Ajuda] Erro ao Copilar - Lуs - 16.11.2011

Poste a funзгo que a IsNumeric estб dentro, funзгo da linha 104. Poste a stock completa.


Re: [Ajuda] Erro ao Copilar - Oakley_TwOPaCk - 17.11.2011

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;
}
    new len = strlen(text[pos]);
    new count = 0;
    new name[MAX_PLAYER_NAME];
    for (new i = 0; i <MAX_PLAYERS; i++) {
        if (IsPlayerConnected(i)) {
            GetPlayerName(i, name, sizeof (name));
            if (strcmp(name, text[pos], true, len) == 0) {
                if (len == strlen(name)) {
                    return i;
                }
                else {
                    count++;
                    userid = i;
                }
            }
        }
    }
    if (count != 1) {
        if (playerid != INVALID_PLAYER_ID) {
            if (count){SendClientMessage(playerid, VERMELHO, "{FF1493}[ADMIN SYSTEM]{FF0000}  Vбrios jogadores encontrados, por favor, procure com mais especificaзгo.");}
            else{SendClientMessage(playerid, VERMELHO, "{FF1493}[ADMIN SYSTEM]{FF0000}  Nenhum jogador correspondente encontrado.");}

        userid = INVALID_PLAYER_ID;
    }
    return userid;
}

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



Re: [Ajuda] Erro ao Copilar - [KoS]Izaac - 17.11.2011

Quote:
Originally Posted by Joker_OutLock
Посмотреть сообщение
Use a strtok que o vini mostrou acima:
O que o vini mostro e uma stock nao uma strtok amigo...