diff --git a/client/main.lua b/client/main.lua index 7a5c2e6..291c539 100644 --- a/client/main.lua +++ b/client/main.lua @@ -191,7 +191,7 @@ RegisterNetEvent('qb-garages:client:takeOutGarage', function(data) return end - local netId = lib.callback.await('qb-garage:server:spawnvehicle', false, vehicle, type == 'house' and garage.coords or garage.spawn, config.warpInVehicle) + local netId = lib.callback.await('qb-garage:server:spawnvehicle', false, vehicle, type == 'house' and garage.coords or garage.spawn, sharedConfig.takeOut.warpInVehicle) local timeout = 100 while not NetworkDoesEntityExistWithNetworkId(netId) and timeout > 0 do Wait(10) @@ -206,6 +206,7 @@ RegisterNetEvent('qb-garages:client:takeOutGarage', function(data) doCarDamage(veh, vehicle) TriggerServerEvent('qb-garage:server:updateVehicleState', 0, vehicle.plate, index) TriggerEvent('vehiclekeys:client:SetOwner', vehicle.plate) + if not sharedConfig.takeOut.engineOff then SetVehicleEngineOn(veh, true, true, false) end Wait(500) end) diff --git a/config/client.lua b/config/client.lua index a2eb1ec..ee2f770 100644 --- a/config/client.lua +++ b/config/client.lua @@ -1,6 +1,5 @@ return { useTarget = false, debugPoly = false, - warpInVehicle = false, -- If true, player will warp into vehicle upon taking the vehicle out. visuallyDamageCars = true, -- True == Visually damage cars that go out of the garage depending of body damage, false == Do not visually damage cars (damage is still applied to car values) } \ No newline at end of file diff --git a/config/shared.lua b/config/shared.lua index 95d6c4d..f40cd81 100644 --- a/config/shared.lua +++ b/config/shared.lua @@ -1,4 +1,10 @@ return { + takeOut = { + warpInVehicle = false, -- If false, player will no longer warp into vehicle upon taking the vehicle out. + doorsLocked = true, -- If true, the doors will be locked upon taking the vehicle out. + engineOff = true, -- If true, the engine will be off upon taking the vehicle out. + }, + houseGarages = {}, -- Dont touch garages = { @@ -13,7 +19,7 @@ return { ---@field blipColor number? -- Color for the blip ---@field type public | job | gang | depot -- Type of garage ---@field vehicle car | air | sea | all -- Vehicle type - ---@field job string? -- Job / Gang name + ---@field job string? -- Job / Gang name ---@type table diff --git a/server/main.lua b/server/main.lua index f71b8d3..a534f60 100644 --- a/server/main.lua +++ b/server/main.lua @@ -78,7 +78,7 @@ lib.callback.register('qb-garage:server:spawnvehicle', function (source, vehInfo local netId = SpawnVehicle(source, vehInfo.vehicle, coords, warp, vehProps) local veh = NetworkGetEntityFromNetworkId(netId) SetVehicleNumberPlateText(veh, plate) - SetVehicleDoorsLocked(veh, 2) + if sharedConfig.takeOut.doorsLocked then SetVehicleDoorsLocked(veh, 2) end outsideVehicles[plate] = {netID = netId, entity = veh} return netId end)