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



Stock - FabioGTP - 09.11.2014

fiz uma stock sу que esta dando erro, nгo sei porque

Код:
 stock GetLevelAdmin(levelid)
{
    new str[50];
    if(levelid == 1)
    {
        str = "1";
    }
    else if (levelid == 2)
    {
        str = "2";
    }
    else if (levelid == 3)
    {
        str = "3";
    }
    else if (levelid == 4)
    {
        str = "4";
    }
    else if (levelid == 5)
    {
        str = "5";
    }
    return str;
}
oq estб de errado


Re: Stock - GM_KoDi - 09.11.2014

Quote:
Originally Posted by FabioGTP
Посмотреть сообщение
fiz uma stock sу que esta dando erro, nгo sei porque

Код:
 stock GetLevelAdmin(levelid)
{
    new str[50];
    if(levelid == 1)
    {
        str = "1";
    }
    else if (levelid == 2)
    {
        str = "2";
    }
    else if (levelid == 3)
    {
        str = "3";
    }
    else if (levelid == 4)
    {
        str = "4";
    }
    else if (levelid == 5)
    {
        str = "5";
    }
    return str;
}
oq estб de errado
bola de cristail fail...
que tipo de erro ?


Re: Stock - ProKillerpa - 09.11.2014

Vocк deve estar chamando a funзгo GetLevelAdmin(levelid) incorretamente. Poste aonde ela й chamada.


Re: Stock - FabioGTP - 09.11.2014

Erros
Код:
 C:\Users\Fбbio\Desktop\xx(187) : error 029: invalid expression, assumed zero
C:\Users\Fбbio\Desktop\xx(187) : error 029: invalid expression, assumed zero
C:\Users\Fбbio\Desktop\xx(187 -- 189) : warning 215: expression has no effect
C:\Users\Fбbio\Desktop\xx(189) : error 001: expected token: ";", but found "new"
C:\Users\Fбbio\Desktop\xx(189) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: Stock - ProKillerpa - 09.11.2014

Poste as linhas dos erros.


Re: Stock - FabioGTP - 09.11.2014

Код:
 /* linha 187 */ stock GetLevelAdmin(levelid)
pawn Код:
/* linha 188 */ {
    /* linha 189 */new str[50];



Re: Stock - GM_KoDi - 09.11.2014

com o cуdigo postado acima esta tudo certo, nгo vi nenhum problemas, exceto essas 50 celulas que voce estб declarando e estб usando apenas 2
poste a parte em que vocк chama ela.


Re: Stock - FabioGTP - 09.11.2014

Код:
 format(string, sizeof(string), "Vocк deu admin level %s para o %s", GetLevelAdmin(level), ganhou);
pawn Код:
format(string2, sizeof(string2), "O admin %s deu admin level %s para vocк.", deu , GetLevelAdmin(level));



Re: Stock - ProKillerpa - 09.11.2014

O Que seria 'level' ? uma variavel?


Re: Stock - MultiKill - 09.11.2014

Й mais fбcil converter a variбvel para string. E a string nгo precisa de 50 cйlulas.

pawn Код:
new str[2];
valstr(str, levelid);