SA-MP Forums Archive
[Ajuda] Bug no carro - 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] Bug no carro (/showthread.php?tid=372285)



Bug no carro - ShutDown_ - 26.08.2012

Essa semana fiquei intrigado com um bug ele esta acontecendo no comando /carro [id] que deveria dar informcaзхes sobre o carro sу que ele nгo estava funcionando fiquei 2 dias tentando resolver e nada dai entгo vim aqui saber se alguem pode me ajudar erro e no seguinte codigo:

pawn Code:
if (strcmp(cmd, "/carro", true) == 0)
{
new preco;
new tmp[256];
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "/carro [ID do Carro]");
return 1;
}
preco = strval(tmp);
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "/Carros/carro%d.ini", preco);
if (dini_Exists(string))
{
new Float: X,
Float: Y,
Float: Z;
GetPlayerPos(playerid, X, Y, Z);
format(STRX, sizeof(STRX), "Id[%d] Dono[%s] Preзo[R$%d] Modelo[%s]", preco, dini_Get(string, "Dono"), dini_Int(string, "Preco"), PlayerVehicle[(GetVehicleModel(dini_Int(string, "Int"))) - 400]);
SendClientMessage(playerid, Amarelo, STRX);
}
return 1;
}
Este codigo da o seguinte erro

( 5808 ) : error 017: undefined symbol "pname"
( 5808 ) : error 017: undefined symbol "pname"
( 5808 ) : error 029: invalid expression, assumed zero
( 5808 ) : fatal error 107: too many error messages on one line

Linha 5808
pawn Code:
GetPlayerName(playerid, pname, sizeof(pname));
O mais obvio que eu pensei foi fazer
pawn Code:
new pname;
Fiz tambem
pawn Code:
new pname = dini_Get(string, "Dono");
tambem deu erro.


Re: Bug no carro - FeelLikeASir_ - 26.08.2012

new pname[25];


Re: Bug no carro - ShutDown_ - 26.08.2012

Retiro oque disse.


Nгo funfo