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

system
unlock
vehicles
lock
roleplay

#307

I try It too haha, nothing :tired_face: not work I dont know …
So thanks for ur answers!


#308

i tried to make it work too but couldnt find how to make vehicleshop and garage work but everything else was working so i ended up doing 100% chance key then disable npc and modified a version of esx_repairkit and used code from policejob for the lockpick so now i have a esx_lockpick so now they can lockpick. It’s not the best solution but its better than nothing.


#309

If it is another option, but I do not want the users to take the NPC cars, if not any new player could have an easy car …


#310

if you do not want user to use npc car then use that setting in the config. Disable npc then no one can use npc car. All npc car will be locked


#311

If you can steal you can even close and open the car at will, just hit the right car for the npc to get off and try enter easy hehe its a unroleplay mode, but people use…


#312

How do i lock and unlock the car?


#313

Press u to find the keys. once you have the keys then you can press u to lock/unlock the car.


#314
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, 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, 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

AddVehicleKeys(callback_vehicle, vehicle) add vehicle on final sintax and its work perfect lol


#315

Still not working with the newest eden_garage.


#316

Where u download it? i put the link more up!


#317

Hello i try to give key when player take car from garage

        ESX.Game.SpawnVehicle(owned.model, spawnCoords, 20, function(vehicle)
            TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
            ESX.Game.SetVehicleProperties(vehicle, owned)
            ESX.TriggerServerCallback('netr_garages:getCarHealth', function(data)
                if data == nil then
                        TriggerServerEvent("garage:takeCar", owned.plate)
                    return
                end
                Citizen.Wait(100) --wait for update
                SetVehicleBodyHealth(vehicle, data.body)
                SetVehicleEngineHealth(vehicle, data.engine)
                SetVehicleDamage(vehicle, 0.0, 1.0, 0.1, math.floor(1000 - data.body) + 0.0, 1850.0, true) --800
                SetVehicleDamage(vehicle, -0.2, 1.0, 0.5, math.floor(1000 - data.body) + 0.0, 650.0, true) -- 50
                SetVehicleDamage(vehicle, -0.7, -0.2, 0.3, math.floor(1000 - data.body) + 0.0, 500.0, true) --00 50
                TriggerServerEvent("garage:takeCar", owned.plate)
                AddVehicleKeys(vehicle)
            end, owned.plate)
        end)

function AddVehicleKeys(vehicle)
    local localVehPlateTest = GetVehicleNumberPlateText(vehicle)
    if localVehPlateTest ~= nil then
        local localVehPlate = string.lower(localVehPlateTest)
        TriggerEvent('ls:newVehicle', nil, localVehPlate, nil)
    end
end

But when i print in newVehicle event i got 3x nils
how i can fix it? i won’t give 100% for found key :confused:


#318
AddVehicleKeys(vehicle, owned.plate)

Try with that.


#319

For some reason, as the server admin, I seem to be the only one who can use the script. Players who join it doesn’t work. No errors show in console. Any ideas?


#320

Explain a little how you do it, and as your players do, maybe we can help you more


#321

Do you know maybe why spawned vehicles remain locked? any solution for that?


#322

U can see more back a tutorial for any resource edén_garage ir others.


#323

solved it in another way, thanks although.


#324

Well, I changed my keybind to the N key. I also changed it so keys can be found 100% of the time as I am just using the script for the locking part of it. So when i push the N key, it says keys found and then push it again and it will lock my doors and then again to unlock my doors.

Now when others players try it, they don’t get anything. Not even a keys found notification. Nothing happens.


#325


#326

Is there a way to disable the “Up d-pad” binding? I’ve looked and can’t seem to find where I can remove that.