Lock someones car doors

hello guys I made a script that stores a vehicle as a variable and I am trying to lock that vehicles doors.

I use this

AddEventHandler('es_rp:block', function()
	SetVehicleDoorsLocked(baitcar, 4)

which it works for me, but doesn’t work for whos in the car.

so if I get in the car it locks but if it’s someone else it doesn’t.

Try replacing SetVehicleDoorsLocked with SetVehicleDoorsLockedForAllPlayers

This works but doesn’t lock how I want them to I want it to lock them inside the car and only command I see that is possible is SetVehicleDoorsLocked using the number 4