Locking vehicles
#1

I've had issues with locking vehicle for players except the driver.

This is my whole code
HTML Code:
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, engine, lights, alarm, 1, bonnet, boot, objective);

SetVehicleParamsForPlayer(vehicleid, playerid, 0, 0);
If the player is driver of the vehicle won't be unlocked for him but if he is a passenger it will be.
I had to use SetVehicleParamsForPlayer to lock the vehicle properly? If it's not necessary I do not want to, becouse I had to handle the locking if the vehicle streams to the player.
Is this a SA-MP but or what?
Reply
#2

You'll probably still need to handle streaming the vehicles parameters to the players with the first function anyways.

You'll have to use a timer or something to constantly set the params with a SetVehicleParamsForPlayer loop on MAX_PLAYERS
Reply
#3

Quote:
Originally Posted by Markski
View Post
You'll probably still need to handle streaming the vehicles parameters to the players with the first function anyways.

You'll have to use a timer or something to constantly set the params with a SetVehicleParamsForPlayer loop on MAX_PLAYERS
Nope.

----------------

Once the vehicle spawns, you need to set it's "Vehicle Parameters" using SetVehicleParamsEx because it is unset by default with a value of -1.

Sometimes reading the wiki properly (and debugging) helps a lot.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)