[AJUDA] No que eu Errei? [Resolvido por Guilherme_Canani]
#1

Tentei fazer o comandos /adquirirnivel mas deu alguns erros, no que eu errei?

pawn Код:
if (strcmp(cmd, "/adquirirnivel", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            if (gPlayerLogged[playerid] != 0)
            {
                if(PlayerInfo[playerid][pLevel] >= 0)
                {
                    new infostring[256];
                    if (PlayerInfo[playerid][pExp] ,expquantidade)
                    {
                        format(infostring, 256, "  Vocк precisa de %d pontos de respeito, vocк tem [%d] !",expquantidade, PlayerInfo[playerid][pExp]);
                        SendClientMessage(playerid, COLOR_GRAD1, infostring);
                        return 1;
                    }
                    else
                    {
                        format(string, sizeof(string), "~g~LEVEL adquirido~n~~w~agora voce esta no level %d", nxtlevel);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        PlayerPlayMusic(playerid);
                        PlayerInfo[playerid][pLevel]++;
                        PlayerInfo[playerid][pExp] = 0;
                        PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
                        GameTextForPlayer(playerid, string, 5000, 1);
                        format(infostring, 256, "  Vocк ganhou %d pontos de atualizaзгo",PlayerInfo[playerid][gPupgrade]);
                        SendClientMessage(playerid, COLOR_GRAD2, infostring);
                        levelexp[playerid] = 4;
                        if(PlayerInfo[playerid][pLevel] >= 8) { levelexp[playerid] = 5; }
                        if(PlayerInfo[playerid][pLevel] >= 11) { levelexp[playerid] = 6; }
                        if(PlayerInfo[playerid][pLevel] >= 14) { levelexp[playerid] = 7; }
                        if(PlayerInfo[playerid][pLevel] >= 17) { levelexp[playerid] = 8; }
                    }
                }
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "  Vocк nгo estб Logado");
            }
        }
        return 1;
    }
E estб dando os Seguintes erros:

Код:
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13061) : error 017: undefined symbol "expquantidade"
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13063) : error 017: undefined symbol "expquantidade"
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13069) : error 017: undefined symbol "nxtlevel"
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13078) : error 028: invalid subscript (not an array or too many subscripts): "levelexp"
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13078) : warning 215: expression has no effect
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13078) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13078) : error 029: invalid expression, assumed zero
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13078) : fatal error 107: too many error messages on one line
Reply
#2

Tenta isso

pawn Код:
if (strcmp(cmd, "/adquirirnivel", true) == 0)
{
new nxtlevel = PlayerInfo[targetid][pLevel]+1;
new expquantidade = PlayerInfo[playerid][pExp];
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] != 0)
{
if(PlayerInfo[playerid][pLevel] >= 0)
{
new infostring[256];
if (PlayerInfo[playerid][pExp] ,expquantidade)
{
format(infostring, 256, "  Vocк precisa de %d pontos de respeito, vocк tem [%d] !",expquantidade, PlayerInfo[playerid][pExp]);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
return 1;
}
else
{
format(string, sizeof(string), "~g~LEVEL adquirido~n~~w~agora voce esta no level %d", nxtlevel);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerPlayMusic(playerid);
PlayerInfo[playerid][pLevel]++;
PlayerInfo[playerid][pExp] = 0;
PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
GameTextForPlayer(playerid, string, 5000, 1);
format(infostring, 256, "  Vocк ganhou %d pontos de atualizaзгo",PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_GRAD2, infostring);
levelexp[playerid] = 4;
if(PlayerInfo[playerid][pLevel] >= 8) { levelexp[playerid] = 5; }
if(PlayerInfo[playerid][pLevel] >= 11) { levelexp[playerid] = 6; }
if(PlayerInfo[playerid][pLevel] >= 14) { levelexp[playerid] = 7; }
if(PlayerInfo[playerid][pLevel] >= 17) { levelexp[playerid] = 8; }
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "  Vocк nгo estб Logado");
}
}
return 1;
}

Reply
#3

Arrumou algumas Warnings, mas estб agora dб os Seguintes Erros:

Код:
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13054) : error 017: undefined symbol "targetid"
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13080) : error 028: invalid subscript (not an array or too many subscripts): "levelexp"
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13080) : warning 215: expression has no effect
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13080) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13080) : error 029: invalid expression, assumed zero
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13080) : fatal error 107: too many error messages on one line
Podem ver que a Maioria dos erros й na linha 1308, que й a Linha abaixo:

pawn Код:
format(string, sizeof(string), "~g~LEVEL adquirido~n~~w~agora voce esta no level %d", nxtlevel);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        PlayerPlayMusic(playerid);
                        PlayerInfo[playerid][pLevel]++;
                        PlayerInfo[playerid][pExp] = 0;
                        PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
                        GameTextForPlayer(playerid, string, 5000, 1);
                        format(infostring, 256, "  Vocк ganhou %d pontos de atualizaзгo",PlayerInfo[playerid][gPupgrade]);
                        SendClientMessage(playerid, COLOR_GRAD2, infostring);
                        levelexp[playerid] = 4;//Linha 1308 <<<------------ Aki ^^
                        if(PlayerInfo[playerid][pLevel] >= 8) { levelexp[playerid] = 5; }
                        if(PlayerInfo[playerid][pLevel] >= 11) { levelexp[playerid] = 6; }
                        if(PlayerInfo[playerid][pLevel] >= 14) { levelexp[playerid] = 7; }
                        if(PlayerInfo[playerid][pLevel] >= 17) { levelexp[playerid] = 8; }
Reply
#4

Quote:
Originally Posted by Rakun
Arrumou algumas Warnings, mas estб agora dб os Seguintes Erros:

Код:
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13054) : error 017: undefined symbol "targetid"
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13080) : error 028: invalid subscript (not an array or too many subscripts): "levelexp"
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13080) : warning 215: expression has no effect
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13080) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13080) : error 029: invalid expression, assumed zero
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\Thug.pwn(13080) : fatal error 107: too many error messages on one line
os problemas nao й na linha 13080 mas sim na 13054

manda as linhas desde a 13000 atй 13100
Reply
#5

Topo GM:
pawn Код:
new targetid[MAX_PLAYERS];
Nгo vi direito Code,mas pelos erros deve ser isso
Reply
#6

Quote:
Originally Posted by DraKoN
Topo GM:
pawn Код:
new targetid[MAX_PLAYERS];
Nгo vi direito Code,mas pelos erros deve ser isso
pois, eu nгo sei o codigo, por isso mesmo que pedi, mas talvez seja isso
Reply
#7

Arrumei a maioria dos Erros mais mesmo assim o erro continua no "Targetid"...

pawn Код:
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\CITYOF~1.PWN(13074) : error 017: undefined symbol "targetid"
C:\DOCUME~1\SRGIO~1\MEUSDO~1\LUKAS\CITYOF~1\CITYOF~1.PWN(13075) : error 017: undefined symbol "targetid"

Como arrumo?
Reply
#8

manda desde as linhas 1300 б 1400 se nгo te importares claro
Reply
#9

Mais porque tudo isso?

Sem problemas ^^ eu mando..
Reply
#10

Se isso й para comprar nнvel porque й que tens targetid?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)