[Release][UNMAINTAINED] LockSystem 3.1 (Updated the 07/16/2018) [BETA]

seem to fix both i run it at the moment on our server

How are you handling city worker vehicles. When pulling ambulance / flatbed / police vehicle from the company garage it sometimes will not let them locate keys.

Try changing this in esx_vehicleshop/server/main.lua
https://www.diffchecker.com/beGyQtFh

Add this in esx_policejob/client/main.lua
https://www.diffchecker.com/YBGqnhYn
esx_ambulancejob/client/main.lua
https://www.diffchecker.com/OJ66VqTy
esx_jobs/client/main.lua
https://www.diffchecker.com/f2qAQTzJ
esx_mecanojob/client/main.lua
https://www.diffchecker.com/5aYltxdp

3 Likes

Alright got everything updated but my vehicle shop as it appears im using an older release. Im having trouble locating where to put in the edit on this on. I have attached a pastebin if you could help. esx_vehicleshop

It’s best if you update esx_vehicleshop to latest version, because my updated version (4.3) is made to work with the latest updated esx_vehicleshop, also you have sent the

esx_vehicleshop/client/main.lua

while my changes were added into

esx_vehicleshop/server/main.lua

Awesome I will do just that…and just seen my mistake on the client/server file my apologies .

1 Like

Also, you might need to update any garage scripts if your esx_vehicleshop is older than two weeks :slight_smile:

i am using the new lock system with the old vehshop and old owned vehicles ,the only thing i am getting is an error on each player login that says it can’t find plate in the table.otherwise the lock is working as intended.The question is if i remove the plate check on server login,will it break the script?

Solution is to update vehicle shop and migrate the database (and update garage scripts)

Hello is there any way to lock ALL the vehicles. I mean not only the npc cars on the road. I’ve found that some cars on the parkings are opened and some of them are closed. Is there any way to make it 100% locked?

Sorry for bad English and thank you for answer.

if i update my vehicle shop with a clean owned vehicles database with the new structure(also for vehicles db) ,i don’t need the migrate script right?or i still have to use it anyway ,with 0 owned vehicles from players

How do you change the key??

Hello guys, I am using eden_garage but every time I take out a car and try to start it, it is as if it were not mine, how could I configure it for its correct operation? already make the changes in esx_vehicleshop (updated to the latest version). thanks!

NOTE: https://github.com/HumanTree92/esx_eden_garage i use this version.

I still can not find the solution, try above something related to the functions that are assigned to ambulances and vehicleshop, but I do not work with the vehicles purchased or with the work / factions, someone made me a hand?

just add

  1. function AddVehicleKeys(vehicle)
  2.  local localVehPlateTest = GetVehicleNumberPlateText(vehicle)
    
  3.  if localVehPlateTest ~= nil then
    
  4.    local localVehPlate = string.lower(localVehPlateTest)
    
  5.    TriggerEvent('ls:newVehicle', localVehPlate, nil, nil)
    
  6.  end
    
  7. end

inside your client files of your garage

and add

AddVehicleKeys(vehicle)

when you pop out the vehicle

function SpawnVehicle(vehicle, plate)

	ESX.Game.SpawnVehicle(vehicle.model,{
		x=this_Garage.SpawnPoint.Pos.x ,
		y=this_Garage.SpawnPoint.Pos.y,
		z=this_Garage.SpawnPoint.Pos.z + 1											
		},this_Garage.SpawnPoint.Heading, function(callback_vehicle)
		ESX.Game.SetVehicleProperties(callback_vehicle, vehicle)
		SetVehRadioStation(callback_vehicle, "OFF")
		TaskWarpPedIntoVehicle(GetPlayerPed(-1), callback_vehicle, -1)
		end)
		
	TriggerServerEvent('eden_garage:modifystate', plate, false)
	AddVehicleKeys(vehicle)
	

end

--End vehicle spawn
--Spawn impounded vehicle

function SpawnPoundedVehicle(vehicle, plate)

	ESX.Game.SpawnVehicle(vehicle.model, {
		x = this_Garage.SpawnMunicipalPoundPoint.Pos.x ,
		y = this_Garage.SpawnMunicipalPoundPoint.Pos.y,
		z = this_Garage.SpawnMunicipalPoundPoint.Pos.z + 1											
		},this_Garage.SpawnMunicipalPoundPoint.Heading, function(callback_vehicle)
		ESX.Game.SetVehicleProperties(callback_vehicle, vehicle)
		SetVehRadioStation(callback_vehicle, "OFF")
		TaskWarpPedIntoVehicle(GetPlayerPed(-1), callback_vehicle, -1)
		end)
		
	TriggerServerEvent('eden_garage:modifystate', plate, true)
	AddVehicleKeys(vehicle)

	ESX.SetTimeout(10000, function()
		TriggerServerEvent('eden_garage:modifystate', plate, false)
	end)

end

--End spawn impounded vehicle

--FUNCION DE AÑADIR LLAVES
function AddVehicleKeys(vehicle)
    local localVehPlateTest = GetVehicleNumberPlateText(vehicle)
        if localVehPlateTest ~= nil then
        local localVehPlate = string.lower(localVehPlateTest)
        TriggerEvent('ls:newVehicle', localVehPlate, nil, nil)
        end
end

Its not work, its say “The keys aren’t inside” :frowning:

Try to put the function before you do something with it lol ?

Try both ways, but it does not work either, I do not understand: /

try this, you need to call it on callback_vehicle here and not vehicle i believe, but i DID NOT TEST THIS :slight_smile:

function SpawnVehicle(vehicle, plate)

	ESX.Game.SpawnVehicle(vehicle.model,{
		x=this_Garage.SpawnPoint.Pos.x ,
		y=this_Garage.SpawnPoint.Pos.y,
		z=this_Garage.SpawnPoint.Pos.z + 1											
		},this_Garage.SpawnPoint.Heading, function(callback_vehicle)
		ESX.Game.SetVehicleProperties(callback_vehicle, vehicle)
		SetVehRadioStation(callback_vehicle, "OFF")
		TaskWarpPedIntoVehicle(GetPlayerPed(-1), callback_vehicle, -1)
		AddVehicleKeys(callback_vehicle)
		end)
		
	TriggerServerEvent('eden_garage:modifystate', plate, false)
	

end

--End vehicle spawn
--Spawn impounded vehicle

function SpawnPoundedVehicle(vehicle, plate)

	ESX.Game.SpawnVehicle(vehicle.model, {
		x = this_Garage.SpawnMunicipalPoundPoint.Pos.x ,
		y = this_Garage.SpawnMunicipalPoundPoint.Pos.y,
		z = this_Garage.SpawnMunicipalPoundPoint.Pos.z + 1											
		},this_Garage.SpawnMunicipalPoundPoint.Heading, function(callback_vehicle)
		ESX.Game.SetVehicleProperties(callback_vehicle, vehicle)
		SetVehRadioStation(callback_vehicle, "OFF")
		TaskWarpPedIntoVehicle(GetPlayerPed(-1), callback_vehicle, -1)
		AddVehicleKeys(callback_vehicle)
		end)
		
	TriggerServerEvent('eden_garage:modifystate', plate, true)
	

	ESX.SetTimeout(10000, function()
		TriggerServerEvent('eden_garage:modifystate', plate, false)
	end)

end

--End spawn impounded vehicle

--FUNCION DE AÑADIR LLAVES
function AddVehicleKeys(vehicle)
    local localVehPlateTest = GetVehicleNumberPlateText(vehicle)
    if localVehPlateTest ~= nil then
        local localVehPlate = string.lower(localVehPlateTest)
        TriggerEvent('ls:newVehicle', localVehPlate, nil, nil)
    end
end