SA-MP Forums Archive
[AJUDA] /PINTAR - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [AJUDA] /PINTAR (/showthread.php?tid=365018)



[AJUDA] /PINTAR - Jodson - 01.08.2012

Pessoal to com siguinte erro ! estou tentando colocar o [COD] De pintar carros e ja tentei varios e da este erro


C:\Documents and Settings\AOC\Desktop\*\BLACKSHOT 3\REALLY LINE\gamemodes\GM.pwn(314) : error 017: undefined symbol "cmd"
C:\Documents and Settings\AOC\Desktop\*\BLACKSHOT 3\REALLY LINE\gamemodes\GM.pwn(319) : error 017: undefined symbol "strtok"
C:\Documents and Settings\AOC\Desktop\*\BLACKSHOT 3\REALLY LINE\gamemodes\GM.pwn(319) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\AOC\Desktop\*\BLACKSHOT 3\REALLY LINE\gamemodes\GM.pwn(321) : error 017: undefined symbol "strtok"
C:\Documents and Settings\AOC\Desktop\*\BLACKSHOT 3\REALLY LINE\gamemodes\GM.pwn(321) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\AOC\Desktop\*\BLACKSHOT 3\REALLY LINE\gamemodes\GM.pwn(324) : error 017: undefined symbol "Vermelho"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.




COD DO /pintar e este :


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;
}
}


Re: [AJUDA] /PINTAR - farCry.xD - 01.08.2012

Just replace cmd with cmdtext
And with strtok , put on the front of your script :
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;
}
And at the error with Vermelho , you need to define it.. I don't speak spanish to know what this means..

Ps : Next time in english
Tell me if this work's