SA-MP Forums Archive
numberplate not changing - 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: numberplate not changing (/showthread.php?tid=569989)



numberplate not changing - xXShadowXx - 04.04.2015

i got a command to set the numberplate of a vehicle, but it wont change.

command =
PHP код:
CMD:plateex(playerid,params[])
{
    
printf("Changing %d's plate to %s",GetPlayerVehicleID(playerid),params);
    
SetVehicleNumberPlate(GetPlayerVehicleID(playerid),params);
    
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
    return 
1;

log =
Код:
[04 Apr 15:34:25] [debug] OnPlayerCommandReceived(0, /plate test)
[04 Apr 15:34:25] [server] [cmd] xXShadowXx (ID 0): /plate test
[04 Apr 15:34:25] Changing 275's plate to test
[04 Apr 15:34:25] [debug] OnVehicleSpawn(275)
plate is always XYZSR998


AW: numberplate not changing - Mencent - 04.04.2015

Are you really in the vehicle id 275?
Check this with /dl

Mencent


Re: AW: numberplate not changing - xXShadowXx - 04.04.2015

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Are you really in the vehicle id 275?
Check this with /dl

Mencent
Yep, checked that before posting.


Re: numberplate not changing - RoboN1X - 04.04.2015

Quote:
Originally Posted by xXShadowXx
Посмотреть сообщение
Код:
CMD:plateex(playerid,params[])
{
	printf("Changing %d's plate to %s",GetPlayerVehicleID(playerid),params);
	SetVehicleNumberPlate(GetPlayerVehicleID(playerid),params);
	SetVehicleToRespawn(GetPlayerVehicleID(playerid));
	return 1;
}
Код:
[04 Apr 15:34:25] [debug] OnPlayerCommandReceived(0, /plate test)
[04 Apr 15:34:25] [server] [cmd] xXShadowXx (ID 0): /plate test
[04 Apr 15:34:25] Changing 275's plate to test
[04 Apr 15:34:25] [debug] OnVehicleSpawn(275)


Can you tell the vehicle model, is there any mod applied on that model? what version are you using?


Re: numberplate not changing - xXShadowXx - 04.04.2015

Quote:
Originally Posted by RoboN1X
Посмотреть сообщение


Can you tell the vehicle model, is there any mod applied on that model? what version are you using?
I tried it on multiple models, all mod free.


Re: numberplate not changing - RoboN1X - 04.04.2015

Quote:
Originally Posted by xXShadowXx
Посмотреть сообщение
I tried it on multiple models, all mod free.
Well i forgot to mention this (see previous post),
is your CMD:plate returning to CMD:plateex?


Or maybe, there is some other script that revert vehicle plate number.


Re: numberplate not changing - xXShadowXx - 04.04.2015

Quote:
Originally Posted by RoboN1X
Посмотреть сообщение
Well i forgot to mention this (see previous post),
is your CMDlate returning to CMDlateex?


Or maybe, there is some other script that revert vehicle plate number.
/plate sets a pre-defined Plate. /plateex sets the plate to the parameter. Both did not work.

I added these commands after noticing numberplates in the database wasn't being set.


Re: numberplate not changing - shadowdog - 04.04.2015

Number plates do not sync on vehicles, you will need to destroy the old one and create a new one with the new number plate text for it to update.


Re: numberplate not changing - xXShadowXx - 04.04.2015

Quote:
Originally Posted by shadowdog
Посмотреть сообщение
Number plates do not sync on vehicles, you will need to destroy the old one and create a new one with the new number plate text for it to update.
The vehicle only needs to be re-spawned after the numberplate has been updated, which I have done so.

The vehicle must be re-spawned or re-streamed for the changes to take effect.


Re: numberplate not changing - Ritzy2K - 04.04.2015

in that command itself, after updating the vehicle plate...respawn the vehicle at the same spot...and it ll b changed..
id write the whole command but im from phone and lil sleepy -

new v = GetPlayerVehicleID(playerid);

later after setting the vehicles plate
SetVehicleToRespawn(v);

u can save the vehicles coord and spawn it right there... also later maybe
PutPlayerInVehicle(playerid, v);

good luck and good night.