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

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

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