SA-MP Forums Archive
[Ajuda] retirar informaзхes do GetVehiclePlate - 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] retirar informaзхes do GetVehiclePlate (/showthread.php?tid=659039)



retirar informaзхes do GetVehiclePlate - _MtM_ - 20.09.2018

Falae negada, seguinte, consegui usar o GetVehiclePlate, mas nгo entendi muito como retirar informaзхes dele, exemplo esse cуdigo
PHP код:
CMD:verplaca(playerid) {
    new 
string[100];
    new 
vehicle GetPlayerVehicleID(playerid);
    
printf("%s",string);
    
format(stringsizeof(string), "A placa do veiculo й %s",GetVehiclePlate(vehicle));
    
SendClientMessage(playerid,COLOR_GREY,string);
    return 
true;

Funcionou muito bem, porйm eu preciso pegar a placa do veнculo pra salvar
PHP код:
VehicleInfo[vic][vPlates] = GetVehiclePlate(vic); 
estava a tentar dessa maneira, mas nгo funciona, tentei de todas as maneiras e nгo funcionou. se alguйm souber como pego essa informaзгo do GetVehiclePlate pra eu poder salvar, ajuda ae


Re: retirar informaзхes do GetVehiclePlate - LeViNS - 20.09.2018

PHP код:
// na enum vehicleinfo
vPlates[128],
format(VehicleInfo[vic][vPlates], 128GetVehiclePlate(vic)); 



Re: retirar informaзхes do GetVehiclePlate - _MtM_ - 20.09.2018

Nгo funcionou :/ Dessa vez nгo deu erro ao compilar, mas tambйm nгo funcionou


Re: retirar informaзхes do GetVehiclePlate - FerrariL - 21.09.2018

PHP код:
VehicleInfo[vic][vPlates], 
Como vocк declarou estб variбvel ?

O modo que vocк estб atribuindo o valor da funзгo ao vetor, estб totalmente errado. Vocк tem 2 opзхes ou usa format ou strcat, strcat й mais rбpido.


Re: retirar informaзхes do GetVehiclePlate - ipsLuan - 21.09.2018

Altere conforme a necessidade:
PHP код:
CMD:salvarplaca(playerid) {
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1"Vocк nгo estб em um veнculo.");
    new 
placa[7], veiculostring[70];
    
veiculo GetPlayerVehicleID(playerid);
    
format(stringsizeof(string), "A placa do veiculo %d[%s] foi salva."veiculoGetVehiclePlate(veiculo));
    
SendClientMessage(playerid, -1string);
    
format(VehicleInfo[vic][vPlates], 128GetVehiclePlate(veiculo));
    
printf("%s"string);
    return 
1;




Re: retirar informaзхes do GetVehiclePlate - [BOPE]Seu._.Madruga - 21.09.2018

Este vнdeo talvez possa te ajudar remova os espaзos que contem no link.

https://www . yout ube . com/watch?v=HUa40kvGgZ0

Ficando desta forma abaixo:



Re: retirar informaзхes do GetVehiclePlate - FerrariL - 21.09.2018

O problema estava no sistema de salvamento dele.


Re: retirar informaзхes do GetVehiclePlate - _MtM_ - 22.09.2018

Problema resolvido, eu simplesmente estava colocando o cуdigo no lugar errado. Percebi que ele estava salvando e depois pegava a placa, entгo simplesmente coloquei pra salvar a placa toda vez que o player desconectasse, ou seja, ele seta a placa e jб salva. Tб funcionando 100%