[Help] SetVehicleNumberPlate -
RoamPT - 04.12.2010
Okay, i created a command which saves your vehicle number plate on the database, the thing is that i don't know how to load that numberplate when the player enters the server, yes the vehicle plate is saved on the player account, same as his vehicle. The variable i use is this one: pCarPlate, how can i load it when the vehicle saved to that player account spawns?
Re: [Help] SetVehicleNumberPlate -
leong124 - 04.12.2010
If you are using dini or some other ini system, try to find the function that loads that variable.
You'll need to add the scripts in OnPlayerStateChange.
When the player changes his state as driver,
check his vehicle's model whether it has a numberplate or not,
and save its position, components,zangle,etc..
Then change its numberplate and respawn it,
and finally restore the position,components,etc.,
and put the driver as passengers back to the vehicle.
Re: [Help] SetVehicleNumberPlate -
RoamPT - 04.12.2010
Quote:
Originally Posted by leong124
If you are using dini or some other ini system, try to find the function that loads that variable.
You'll need to add the scripts in OnPlayerStateChange.
When the player changes his state as driver,
check his vehicle's model whether it has a numberplate or not,
and save its position, components,zangle,etc..
Then change its numberplate and respawn it,
and finally restore the position,components,etc.,
and put the driver as passengers back to the vehicle.
|
I use MySQL, that would work, but it must have another way, because always you enter a vehicle and respawn it could be really annoying.
Re: [Help] SetVehicleNumberPlate -
leong124 - 04.12.2010
There's no other way, I think.
Changing numberplate requires the vehicle to respawn to take effect.
Re: [Help] SetVehicleNumberPlate -
Kalcor - 04.12.2010
It doesn't really require a respawn. It requires the vehicle to restream (if someone already sees it). In other words, setting the numberplate after CreateVehicle() is fine.
Re: [Help] SetVehicleNumberPlate -
Simon - 04.12.2010
Is toggling virtual worlds or interiors considered as a re-stream to the server?
Re: [Help] SetVehicleNumberPlate -
Kalcor - 04.12.2010
Quote:
Originally Posted by Simon
Is toggling virtual worlds or interiors considered as a re-stream to the server?
|
Yes. Virtual worlds are actually just different streaming channels on the server. Interiors are different streaming channels on the client - in the actual game engine itself.
Re: [Help] SetVehicleNumberPlate -
RoamPT - 04.12.2010
Quote:
Originally Posted by Kalcor
It doesn't really require a respawn. It requires the vehicle to restream (if someone already sees it). In other words, setting the numberplate after CreateVehicle() is fine.
|
Thanks for the reply, I'll try that, dumb me.
Re: [Help] SetVehicleNumberPlate -
niCe - 04.12.2010
Quote:
Originally Posted by Simon
Is toggling virtual worlds or interiors considered as a re-stream to the server?
|
However, you need to set different virtual world to the vehicle for more than 1000ms (default stream_rate) so it has any effect for players
Re: [Help] SetVehicleNumberPlate -
DVDK - 04.12.2010
https://sampforum.blast.hk/showthread.php?tid=194734
Quote:
Originally Posted by Kalcor
It doesn't really require a respawn. It requires the vehicle to restream (if someone already sees it). In other words, setting the numberplate after CreateVehicle() is fine.
|
Then, will this work?
Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
SetVehicleNumberPlate(vehicleid, "SAMPFTW");
return 1;
}