numberplate not changing
#1

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
Reply
#2

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

Mencent
Reply
#3

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

Mencent
Yep, checked that before posting.
Reply
#4

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?
Reply
#5

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.
Reply
#6

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.
Reply
#7

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.
Reply
#8

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.
Reply
#9

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.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)