SA-MP Forums Archive
[Ajuda] invalid expression, assumed zero - 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] invalid expression, assumed zero (/showthread.php?tid=394784)



invalid expression, assumed zero - Renan_Sinister - 24.11.2012

Aff to com um erro na hr de compilar meu GM e nao sei oque pode ser mano ;S

Obs. : O erro tava apontando na linha do stock strtok(const string[])

Linha do erro:
pawn Код:
SendClientMessage(i, COLOR_GRAD1,"Vocк foi solto por pagar sua divida com a sociedade");
            PlayerInfo[i][pJailed] = 0;
            ClearCrime(i);
            stock strtok(const string[])
{
Espero que me ajudem urgente!


Re: invalid expression, assumed zero - alexcordeiro - 24.11.2012

Tenta por isso no final do gm

pawn Код:
stock strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {

        index++;
    }
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {

        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}



Re: invalid expression, assumed zero - rjjj - 24.11.2012

O erro й proveniente do nesting de funзхes que vocк fez .



Nгo se deve colocar a definiзгo de uma funзгo dentro do corpo de outra funзгo:


pawn Код:
stock Funcao1()
{
    stock Funcao2()
    {
        return 1;
    }
    return 1;
}


Espero ter ajudado .


Respuesta: invalid expression, assumed zero - Parka - 24.11.2012

PHP код:
#include a_samp


/// na sua respectivos CallBack
for(new 0GetMaxPlayers(); i++)
{
SendClientMessage(iCOLOR_GRAD1,"Vocк foi solto por pagar sua divida com a sociedade");
PlayerInfo[i][pJailed] = 0;
ClearCrime(i);
}


/// em qualquer lugar sua GM
stock strtok(const string[], &index)
{
    new 
length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {

        
index++;
    }
    new 
offset index;
    new 
result[20];
    while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
    {

        
result[index offset] = string[index];
        
index++;
    }
    
result[index offset] = EOS;
    return 
result;