[AJUDA] /pintar -
Oakley_TwOPaCk - 14.02.2012
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
Re: [AJUDA] /pintar -
[NC]BlackSky - 14.02.2012
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;
}
}
Re: [AJUDA] /pintar -
Hard` - 14.02.2012
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;
}
Re: [AJUDA] /pintar -
Oakley_TwOPaCk - 14.02.2012
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
Re: [AJUDA] /pintar -
[NC]BlackSky - 14.02.2012
vc botou o meu cmd ou a stock do Hard?
Re: [AJUDA] /pintar -
Hard` - 14.02.2012
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;
}
Re: [AJUDA] /pintar -
Oakley_TwOPaCk - 14.02.2012
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.
Re: [AJUDA] /pintar -
[NC]BlackSky - 14.02.2012
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];
Re: [AJUDA] /pintar -
Oakley_TwOPaCk - 14.02.2012
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.
Re: [AJUDA] /pintar -
[NC]BlackSky - 14.02.2012
Embaixo desta callback:
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
Vc coloca isto: