SetVehicleParamsForPlayer (door locks)
#1

Hey, I'm having a problem with SetVehicleParamsForPlayer.

Can I use this to disallow players from entering a vehicle even if it's doors are opened? I tried using this function to lock a vehicle if a player tries to enter it as driver, but to unlock it if he enters as passenger, but if he leaves the door opened, he can then enter as a driver.
Reply
#2

In all honesty, I would say this is a bad idea. Reason is I'm pretty sure vehicle doors are not synched. As a result, a vehicle door might be open for one person, but not for another. To have the door so that it is locked for everyone, regardless of doors being opened/closed on different player's screens, see the below:

https://sampwiki.blast.hk/wiki/SetVehicleParamsEx

If you need further help with the function, just hit another reply and I'll give you a hand
Reply
#3

The result is the same. I don't think you understood me.

I want a player to be able to enter a vehicle as passenger, but to lock it if he tries to enter as a driver, but if he enters as passenger and cancels the action, the door is left open and he can use it to enter the drivers seat even if the system sets the vehicle doors to be locked.

I could eject the player or force him to exit the vehicle or cancel the action OnPlayerEnterVehicle, but if SetVehicleParamsEx worked, it would look much better and realistic.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)