[AJUDA] /pintar
#1

um problema '-' com meu cmd /pintar

pawn Код:
if(strcmp(cmd, "/pintar", true) == 0)
{
new tmp[256];
new cor1, cor2;
new veiculo;
tmp = strtok(cmdtext, idx);

if(!strlen(tmp))
{
SendClientMessage(playerid, COR_TAXI,"|| •INFO•: USE: /pintar [cor 1] [cor 2]");
return 1;
}
cor1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COR_TAXI,"|| •INFO•: USE: /pintar [cor 1] [cor 2]");
return 1;
}
cor2 = strval(tmp);
veiculo = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid,veiculo))
{
ChangeVehicleColor(veiculo,cor1,cor2);
SendClientMessage(playerid, COR_TAXI, "|| •INFO•: Veiculo pintador por $100!");
} else {
SendClientMessage(playerid, COR_TAXI, "|| •INFO•: Vocк nao esta em um veiculo!");
}
return 1;
}
Erros :

pawn Код:
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1507) : error 017: undefined symbol "cmd"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1512) : error 017: undefined symbol "strtok"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1512) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1520) : error 017: undefined symbol "strtok"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1520) : error 033: array must be indexed (variable "tmp")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
ajudae favor =D
Reply
#2

pawn Код:
if(strcmp(cmd, "/pintar", true) == 0)
{
        new cor1,cor2;
        new veiculo;
        new tmp[128];
        tmp = strtok(cmdtext,idx);
        cor1 = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "/pintar [cor1] [cor2]");
            return 1;
        }
        cor2 = strval(tmp);
        veiculo = GetPlayerVehicleID(playerid);
        if(IsPlayerInVehicle(playerid,veiculo))
        {
            ChangeVehicleColor(veiculo,cor1,cor2);
            format(string, sizeof(string), "|| •INFO•: Veiculo pintador por $100!");
            SendClientMessage(playerid, COR_TAXI, string);
            return 1;
        }
    }
Reply
#3

Tenta isso

pawn Код:
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;
}
Reply
#4

pawn Код:
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1507) : error 017: undefined symbol "cmd"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1511) : error 017: undefined symbol "tmp"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1511) : error 017: undefined symbol "strtok"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1512) : error 017: undefined symbol "tmp"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1513) : error 017: undefined symbol "tmp"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1513) : error 017: undefined symbol "strtok"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1514) : error 017: undefined symbol "tmp"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1519) : error 017: undefined symbol "tmp"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1524) : error 017: undefined symbol "string"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1524) : error 017: undefined symbol "string"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1524) : error 029: invalid expression, assumed zero
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1524) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


12 Errors.
Deu esses erros ai
Reply
#5

vc botou o meu cmd ou a stock do Hard?
Reply
#6

Tente no fim 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;
}
Reply
#7

Seu cmd deu os erros, e a stock no fim do gm nгo mudou nada fico com os mesmo erros '-'

com o dele deu esses erros :

pawn Код:
:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1507) : error 017: undefined symbol "cmd"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1511) : error 017: undefined symbol "tmp"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1511) : error 017: undefined symbol "idx"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1512) : error 017: undefined symbol "tmp"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1513) : error 017: undefined symbol "tmp"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1513) : error 017: undefined symbol "idx"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1514) : error 017: undefined symbol "tmp"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1519) : error 017: undefined symbol "tmp"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1524) : error 017: undefined symbol "string"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1524) : error 017: undefined symbol "string"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1524) : error 029: invalid expression, assumed zero
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1524) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


12 Errors.
Reply
#8

tenta ai retirei do meu gm '-'
pawn Код:
if(strcmp(cmd, "/pintar", true) == 0)
{
        new tmp[256];
        new cor1,cor2;
        new veiculo;
        tmp = strtok(cmdtext,idx);
        cor1 = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "/pintar [cor1] [cor2]");
            return 1;
        }
        cor2 = strval(tmp);
        veiculo = GetPlayerVehicleID(playerid);
        if(IsPlayerInVehicle(playerid,veiculo))
        {
            ChangeVehicleColor(veiculo,cor1,cor2);
            format(string, sizeof(string), "(x) vocк pintou seu carro de %d e %d.", playerid, cor1, cor2);
            SendClientMessage(playerid, -1, string);
            return 1;
    }
}
Se nao der
tira
new tmp[256];
Reply
#9

deu os seguintes erros dinovo :

pawn Код:
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1512) : error 017: undefined symbol "idx"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1514) : error 017: undefined symbol "idx"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1525) : error 017: undefined symbol "string"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1525) : error 017: undefined symbol "string"
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1525) : error 029: invalid expression, assumed zero
C:\Documents and Settings\FAMILIA_\Desktop\DPSOriginal1\gamemodes\testing.pwn(1525) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
Reply
#10

Embaixo desta callback:
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
Vc coloca isto:
pawn Код:
new idx;
new string[128];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)