[Release][ESX] onyxLocksystem | Keys, Hotwiring

Look at X-Hotwire script or an other lockpick script how they coded that. I merged X-Hotwire and another mugging script so I can aim at people and they will get out and give you keys etc.

ok i will come back if i have a problem thnks for reply

GOLDEN! :rofl:

Excellent :slightly_smiling_face:

Usually when your wife leave, that mean you got an error in the console… check with F8, she must be bugged

I added the script, i get the popup come up saying to hotwire or search, but neither of them actually work. i press the button and nothing happens

Been some good improvements added in, will commit changes to GitHub in the next few days. A lot of bug fixes to make it more compatible with other scripts and new features.

3 Likes

is this only for npc cars or for player cars aswell?

Would this work with spawning a car from vMenu? or would someone have to incorporate it into the source of vMenu?

update i get the keys but i also get an error

Can’t wait for the commits! XD it’s the only script thats missing from my server, and i can launch!

Hello i would like to give the keys automatically when you buy a car (esx_vehicleshop) and when you get out a car from the garage (esx_jb_eden_garage2) Anyone knows how to make it possible? Please

Hey there!
Have this script on my dev server and have it working pretty much to my liking atm. The only thing I am stuck on is a /givekey command that gives keys to passengers in the vehicle.
Currently, I have this, but don’t know where to go from here.

RegisterNetEvent('givekeys')
AddEventHandler('givekeys', function(source)
    local player = GetPlayerPed(-1)
    local curVeh = GetVehiclePedIsIn(player, false)
    local passenger = GetPedInVehicleSeat(curVeh, 0)
    local driver = GetPedInVehicleSeat(curVeh, -1)
    local plate = GetVehicleNumberPlateText(curVeh)

    if player == driver and hasKeys(plate) then
       
    else 
       exports['mythic_notify']:DoHudText('inform', "You can't do that.")
    end
end)

Any help would be appreciated!
Also if anyone needs help adding in car jacking, or the locking of local vehicles I can try to be of assistance cause I have it working on my dev server.

Hi sorry about the delay have been busy, updating the script as soon as I can.

I think what you’re looking for is this native

That’s what I would personally use for a givekeys command. But if you want it to give it to the passenger you will need to trigger a server event to pass the keys to the passengers id.

1 Like

Hi. We use esx_realparking, but i can’t fix the keys for it. Do you know were i add

local plate = GetVehicleNumberPlateText(veh)
exports["onyxLocksystem"]:givePlayerKeys(plate)

in esx_realparking?

i don’t think you need to put it in the real parking cause it makes the cars invulnerable, think you need to put it in the permissions for the cars themselves or reference the cars to this mod, don’t ask me how im not a coder, i do everything else but coding xD

1 Like

Firstly, Howdy a very kind of you to upload your script to the community.
I would like to ask you for the use on the vehicle shop as well as for the advanced garage

 local player, distance = ESX.Game.GetClosestPlayer()
RegisterCommand("givekey", function(source, args, rawCommand)
    -- Wait for next frame just to be safe
    Citizen.Wait(0)
    local player = GetPlayerPed(-1)
    local curVeh = GetVehiclePedIsIn(player, false)
    local plate = GetVehicleNumberPlateText(curVeh)
    local player, distance = ESX.Game.GetClosestPlayer()
  
    if distance ~= -1 and distance <= 3.0 then
      exports["onyxLocksystem_lock"]:givePlayerKeys(plate)GetPlayerServerId(PlayerId())GetPlayerServerId(player)
    else
      ESX.ShowNotification('No players nearby')
    end
  end, false)

I crushed my brain for this

1 Like

When is the update coming?

What do you mean with this?

I thought realparking acts the same as esx_garages, but than visually storing cars only