[Ajuda] erro "undefined symbol" no comando
#1

Ta dando os seguintes erros abaixo do codigo

Код:
if(strcmp(cmd, "/invisivel", true) == 0)
{
new PlayerB, string[256];
tmp = strtok(cmdtext, idx);
PlayerB = strval (tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, VERMELHO, "{FFFFFF}Uso correto: {FF0000} /goto [id]"); // se ele nao digitar o ID
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, VERMELHO, "Este jogador nгo estб online."); //se o id tiver offline
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO, "Voce nao й administrador.");// se quem digita nao for admin.
ShowPlayerMarkers(0); // nao mostra icone no mapa
ShowNameTags(0); // nao mostra o nick
format(string, sizeof(string), "Voce tornou %s invisivel.", Nome(PlayerB)); // mensagem retornando o resultado pra quem digita
SendClientMessage(playerid, AMARELO, string);
format(string, sizeof(string), "O jogador %s te tornou invisivel.", Nome(playerid)); // mensagem pra quem voce tornou invisivel
SendClientMessage(PlayerB, AMARELO, string);
return 1;
}
esses erros:
C:\Users\Andrielbad\Desktop\server samp\gamemodes\bare.pwn(1346) : error 017: undefined symbol "tmp"
C:\Users\Andrielbad\Desktop\server samp\gamemodes\bare.pwn(1346) : error 017: undefined symbol "strtork"
C:\Users\Andrielbad\Desktop\server samp\gamemodes\bare.pwn(1347) : error 017: undefined symbol "tmp"
C:\Users\Andrielbad\Desktop\server samp\gamemodes\bare.pwn(134 : error 017: undefined symbol "tmp"
C:\Users\Andrielbad\Desktop\server samp\gamemodes\bare.pwn(1353) : error 017: undefined symbol "Nome"
C:\Users\Andrielbad\Desktop\server samp\gamemodes\bare.pwn(1355) : error 017: undefined symbol "Nome"
Reply
#2

nao precisa criar topico pra tudo cara, isso ainda tava no contexto dakele topico

no comeзo de OnPlayerCommandText
pawn Код:
new tmp[128];
cmd = strtok(cmdtext,idx);
no fim do gm
pawn Код:
stock Nome(playerid)
{
   new pNome[MAX_PLAYER_NAME];
   GetPlayerName(playerid, pNome, MAX_PLAYER_NAME);
   return pNome;
}
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;
}
acho q isso deve resolver
Reply
#3

OLHA DIMINIUI O PROBLEMA AGORA TEM ESSES ERROS:
Код:
C:\Users\Andrielbad\Desktop\server samp\gamemodes\bare.pwn(36) : error 017: undefined symbol "cmd"
C:\Users\Andrielbad\Desktop\server samp\gamemodes\bare.pwn(36) : error 017: undefined symbol "idx"
C:\Users\Andrielbad\Desktop\server samp\gamemodes\bare.pwn(40) : error 017: undefined symbol "idx"
Reply
#4

new cmd[128], idx;
Reply
#5

pawn Код:
new
    cmd[128],
    idx;
Reply
#6

RICOPP O MELHOR
Reply
#7

RESOLVIDO!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)