[Release][ESX] carlock

NOT Working, it made all trunk accessible even though its locked.

2 Likes

Go to line 106 and replace

else

by

elseif locked == 2 then

Also switch back

if locked == 1 or locked == 2 or class == 15 or class == 16 or class == 14 then

to

if locked == 1 or class == 15 or class == 16 or class == 14 then

at line 101

So like this ?

if ESX.UI.Menu.IsOpen(“default”, GetCurrentResourceName(), “inventory”) then
SetVehicleDoorShut(vehFront, 5, false)
elseif locked == 2 then
if locked == 1 or class == 15 or class == 16 or class == 14 then
SetVehicleDoorOpen(vehFront, 5, false, false)
ESX.UI.Menu.CloseAll()

Still working.

The White car is the other player locked vehicle and on the right is mine which is unlocked

Unfortunately I can’t provide full compatibility for every esx vehicle script. I use this native

SetVehicleDoorsLocked(vehicle, LockStatus)

with LockStatus = 2 to lock a vehicle. I’m sorry but you’ll have to search a bit in your trunk script.

Thanks, nice simple script and works perfectly.

BROTHER CAN YOU SHARE INVENTORY AND TRUNK SCRIPT PLEASE ?! I dont have trunk sctipt for store anythink on car !

How can I make all vehicles can be locked and attached to take the car keys?

Hello guys, looks like there is currently a problem and I don’t know from where it could come. Normally when you have multiple vehicles out it will lock/unlock the closest. However for some mysterious reasons, every vehicle will be locked/unlocked. Have you got this problem too ?

So the exploit also work on you?

This isn’t related to the “exploit”

I’m kinda running into a dead end here, is there someway to make it so your not able to get out of cars when the vehicle is locked?

  • Probably right in front of me, just stared my self blind on it .-.-
SET_VEHICLE_DOORS_LOCKED
SetVehicleDoorsLocked(
	vehicle --[[ Vehicle ]], 
	doorLockStatus --[[ integer ]]
)
1   
2 - CARLOCK_LOCKED (locked)  
3   
4 - CARLOCK_LOCKED_PLAYER_INSIDE (can get in, can't leave)  
(maybe, these are leftovers from GTA:VC)  
5   
6   
7   
(source: GTA VC miss2 leak, matching constants for 0/2/4, testing)  
They use 10 in am_mp_property_int, don't know what it does atm. 

Hi, can somene help me i want to lock my esx_mechanic vehicles but i dont know how to do that can someone help me?

Anyway to make it so if I have a mechanic buy the car, he can transfer ownership of car with /givekeys

How did you do that?

resource_manifest_version ‘05cfa83c-a124-4cfa-a768-c24a5811d8f9’

client_scripts {
@es_extended/locale.lua”,
“clienten.lua”

}

server_scripts {
“server.lua”,
@es_extended/locale.lua’,
@mysql-async/lib/MySQL.lua’

}

with this you take away the problem

How i can lock rented or work cars? ;o

You have always your car lock for fivem ?
You can lock job car ?

whenever i try and unlock the car it says no vehicles nearby, im assuming it its because i use an older ver. of vehicleshop where the plate is not pk. can some one help me make this work for my version please, using vehshop 1.0