[Release][ESX] onyxLocksystem | Keys, Hotwiring

any way to add a command to give keys to closest player ?

How to make esx:onplayerloaded ? Console all the plates we had when we first entered, I tried to make an error, the console said the value of the concate plate, even though it has made the function, and has made the triggerservercallback

Does anyone have the code block for how to get this to work with ESX_VehicleShop?

Hi, could someone show me an example or explain how I do the export for when I buy a vehicle in esx_vehicleshop I generate the vehicle keys? Thank you

this script didn’t work for me, I had to download another one and modify the server.lua and it worked fine

ok guys, i worked out how to keep the engine off when you first start hot wiring it.

Remove line 252 and 253

Save a backup first :slight_smile:

ok , cancel that , although it does work , if you find the keys in the search , then it breaks :frowning:

Yes please, we need that!

Not working anymore :frowning:

Hey @HighHowdy is this script abandoned?
Are you working on a new one? :slight_smile:

Hi everybody!
I don’t use esx_vehicleshop, but if you guys want to use it do the following to get it working:
In esx_vehicleshop\client\main.lua function:

ESX.TriggerServerCallback('esx_vehicleshop:buyVehicle', function(success)
						if success then
							IsInShopMenu = false
							menu2.close()
							menu.close()
							DeleteDisplayVehicleInsideShop()

							ESX.Game.SpawnVehicle(vehicleData.model, Config.Zones.ShopOutside.Pos, Config.Zones.ShopOutside.Heading, function(vehicle)
								TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
								SetVehicleNumberPlateText(vehicle, generatedPlate)
								FreezeEntityPosition(playerPed, false)
								SetEntityVisible(playerPed, true)								
							end)
						else
							ESX.ShowNotification(_U('not_enough_money'))
						end
					end, vehicleData.model, generatedPlate)

replaced by:

ESX.TriggerServerCallback('esx_vehicleshop:buyVehicle', function(success)
						if success then
							IsInShopMenu = false
							menu2.close()
							menu.close()
							DeleteDisplayVehicleInsideShop()

							ESX.Game.SpawnVehicle(vehicleData.model, Config.Zones.ShopOutside.Pos, Config.Zones.ShopOutside.Heading, function(vehicle)
								TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
								SetVehicleNumberPlateText(vehicle, generatedPlate)
								-------------------------
								local plate = GetVehicleNumberPlateText(vehicle)
								exports["onyxLocksystem"]:givePlayerKeys(plate)
								--------------------------
								FreezeEntityPosition(playerPed, false)
								SetEntityVisible(playerPed, true)								
							end)
						else
							ESX.ShowNotification(_U('not_enough_money'))
						end
					end, vehicleData.model, generatedPlate)

This is test video:

1 Like

How to add chance of Hotwiring success?

luck = math.random(0,100)
	if luck > 50 then
		--True
	else
		--False
	end

Has anyone found a way for the vehicle purchase to provide keys ? I’ve attempted all of the possible solutions listed on this but none seem to be working.

Hey. This is a lovely script, and so far works the best from other free scripts I’ve seen and tried out. I was wondering, whether you could update the script to do two things additional:

  1. Check if the vehicle the player is in, whether it is owned by the player, and it would then automatically give the keys to the player’s own vehicle.

  2. Making that specific jobs will always get the keys to specific list of vehicles (say, add the specific jobs and the specific list of vehicles into the config.lua for easy access), for example, if player’s job is ‘Police’, then they would automatically receive keys when entering specific cars, such as ‘police1’, ‘police2’, ‘polmav’, ‘pbike’ etc. etc.

Hope ya got the point on what I meant. Otherwise, great job mate, keep up

Remove FLAG_LAW_ENFORCEMENT from the vehicles.meta for all vehicles you cant lock from the outside

Does anyone know how I make it so I wont have to hotwire cars that are pulled out of a garage and police garage? I use esx_advancedgarage

Got it working with police garage and public garages still no luck with impounds though

is dose it work for esx 1.final

Hotwire dont work on ESX 1.1

discontinued ?