[Ajuda] Erro /Pintar - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Erro /Pintar (
/showthread.php?tid=524450)
Erro /Pintar -
Ts3 - 06.07.2014
Tou com um problema no comando /pintar ao compilar.
pawn Код:
new.pwn(1061) : error 001: expected token: ";", but found "-identifier-"
new.pwn(1061) : error 017: undefined symbol "s"
new.pwn(1061) : warning 215: expression has no effect
new.pwn(1061) : error 001: expected token: ";", but found "]"
new.pwn(1061) : fatal error 107: too many error messages on one line
command(pintar,playerid, params[])
{
new
cor1,
cor2,
idcarro
linha ---1061 s[256];
;
idcarro = GetPlayerVehicleID(playerid);
tmp = strtok(cmd,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFFFFAA, "* Uso: /pintar [cor1] [cor2]");
return 1;
}
cor1 = strval(tmp);
tmp = strtok(cmd,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFFFFAA, "* Uso: /pintar [cor1] [cor2]");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
cor2 = strval(tmp);
ChangeVehicleColor(idcarro, cor1, cor2);
format(s, sizeof(s), "* Cores alteradas cor1: %d e cor2: %d.", cor1, cor2);
SendClientMessage(playerid, 0xFFFFFFAA, s);
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "* Vocк nгo estб em um veнculo !");
}
return 1;
}
Re: Erro /Pintar -
SkullFire - 06.07.2014
pawn Код:
command(pintar,playerid, params[])
{
new cor1,cor2,idcarro,s[256];
idcarro = GetPlayerVehicleID(playerid);
tmp = strtok(cmd,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFFFFAA, "* Uso: /pintar [cor1] [cor2]");
return 1;
}
cor1 = strval(tmp);
tmp = strtok(cmd,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFFFFAA, "* Uso: /pintar [cor1] [cor2]");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
cor2 = strval(tmp);
ChangeVehicleColor(idcarro, cor1, cor2);
format(s, sizeof(s), "* Cores alteradas cor1: %d e cor2: %d.", cor1, cor2);
SendClientMessage(playerid, 0xFFFFFFAA, s);
}
else
{
SendClientMessage(playerid, 0xFFFFFFAA, "* Vocк nгo estб em um veнculo !");
}
return 1;
}
Tente..
@Multikill nem prestei atencao no code rs, de toda forma, acertei aqui e.e
Re: Erro /Pintar -
Ts3 - 06.07.2014
Resolvido xD
Re: Erro /Pintar -
MultiKill - 06.07.2014
Vocк colocou dois pontos virgulas, e esqueceu de colocar uma virgula.
Mude:
pawn Код:
new
cor1,
cor2,
idcarro
linha ---1061 s[256];
;
Para:
pawn Код:
new
cor1,
cor2,
idcarro,
s[256];
Re: Erro /Pintar -
DiiMeNoR - 06.07.2014
Cara usa sscanf.
Re: Erro /Pintar -
Ts3 - 06.07.2014
Jб foi resolvido, olhei um tutorial de como usar zcmd e sscanf junto, comando jб estб pronto e funcionando. Obrigado a quem ajudou. xD