[Ajuda]Comando /cnn
#1

Bom, Sou novo aqui no forum sa-mp mais por favor me ajudem: estou com esses erros:
Quote:

error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

a linha й essa:

Quote:

while ((idx < length) && (cmdtext[idx] <= ' '))

Para verificarem se e algum erro no sistema vou deixar o codigo dele:

Quote:

CMD:cnn(playerid, params[])
if(strcmp(cmd, "/cnn", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][Level] >= 1)
{
new cmdtext[20];
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[100];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /cnn [cnn formato ~n~=NovaLinha ~r~=Vermelho ~g~=Verde ~b~=Azul ~w~=Branco ~y~=Amarelo ~l~=Preto]");
return true;
}
format(string, sizeof(string), "~b~Capetinha: ~w~%s",result);
}
else
{
format(string, sizeof(string), "~b~%s: ~w~%s",sendername,result);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GameTextForPlayer(i, string, 5000, 3);
}
}
return true;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб autorizado a usar este comando!");
return true;
}
}
return true;
}

Reply
#2

strcmp dentro de ZCMD, so isso
Reply
#3

Pode me mandar a linha corrigindo? Por favor!
Reply
#4

so tirar CMD:cnn(playerid, params[]) '-'
Reply
#5

Diogo n precisa tirar CMD:cnn(playerid, params[]) nгo, eu ja usei em varios sistemas e nгo deu esse erro.
Reply
#6

Cara vc ta usando zcmd + strcmp isso e impossнvel ...

se seu gm e em zcmd mantйm essa linha

CMD:cnn(playerid, params[])

e apaga essa '-'
if(strcmp(cmd, "/cnn", true) == 0)
Reply
#7

Coloquei ela em OnPlayerCommandText(ponho todos os comandos strcmp la)

#Edit

Mas, Voltando ao assunto ainda continuam os erros

Quote:

error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Na mesma linha:

Quote:

while ((idx < length) && (cmdtext[idx] <= ' '))

Reply
#8

@edit

pawn Код:
if (strcmp(cmd, "/cnn", true) == 0)
    {
        if (IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][Level] >= 1)
            {
                new cmdtext[20];
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[100];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                if (!strlen(result))
                {
                    SendClientMessage(playerid, -1, "USE: /cnn [cnn formato ~n~=NovaLinha ~r~=Vermelho ~g~=Verde ~b~=Azul ~w~=Branco ~y~=Amarelo ~l~=Preto]");
                    return true;
                }
                format(string, sizeof(string), "~b~Capetinha: ~w~%s", result);
            }
            else
            {
                format(string, sizeof(string), "~b~%s: ~w~%s", sendername, result);
            }
            for (new i = 0; i < MAX_PLAYERS; i++)
            {
                if (IsPlayerConnected(i))
                {
                    GameTextForPlayer(i, string, 5000, 3);
                }
            }
            return true;
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб autorizado a usar este comando!");
            return true;
        }
    }
    return true;
    }

aqui n deu erro nenhum '-'
Reply
#9

Na linha eu coloquei igual os outros comandos strcmp entao coloquei:

Quote:

if (strcmp("/cnn",cmdtext, true) == 0)

#Edit

Ainda Nгo Resolvi O Erro!
Reply
#10

pawn Код:
if (strcmp(cmd, "/cnn", true) == 0)
    {
        if (IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][Level] >= 1)
            {
                new cmdtext[20];
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[100];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                if (!strlen(result))
                {
                    SendClientMessage(playerid, -1, "USE: /cnn [cnn formato ~n~=NovaLinha ~r~=Vermelho ~g~=Verde ~b~=Azul ~w~=Branco ~y~=Amarelo ~l~=Preto]");
                    return true;
                }
                format(string, sizeof(string), "~b~Capetinha: ~w~%s", result);
            }
            else
            {
                format(string, sizeof(string), "~b~%s: ~w~%s", sendername, result);
            }
            for (new i = 0; i < MAX_PLAYERS; i++)
            {
                if (IsPlayerConnected(i))
                {
                    GameTextForPlayer(i, string, 5000, 3);
                }
            }
            return true;
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб autorizado a usar este comando!");
            return true;
        }
    }
    return true;
    }


cara n deu erro nenhum aqui '-'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)