Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Config = {}
- Config.Framework = 'ESX'
- -- 'ESX' | 'QBCore' | undefined
- -- Translation
- Config.Translation = {
- ['enter_garage'] = 'Press %s to enter the garage', -- %s is the button
- ['open_parking'] = 'Press %s to open the parking lot',
- ['open_impound'] = 'Press %s to open the impound',
- ['store_vehicle'] = 'Press %s to store the vehicle',
- ['not_owner'] = 'You are not the owner of the vehicle',
- ['not_afford'] = 'You do not have enough money.',
- -- UI
- ['garage_title'] = '%s Garage', -- %s is the title of the garage
- ['parkinglot_title'] = '%s Parking Lot', -- %s is the title of the parking lot
- ['refresh'] = 'Refresh',
- ['change_view'] = 'Change view',
- ['light_mode'] = 'Light mode',
- ['dark_mode'] = 'Dark mode',
- ['close'] = 'Close',
- ['drive_out'] = 'Drive out',
- ['impound_free'] = 'Spawn vehicle',
- ['impound_buy'] = 'Pay %s$ and spawn vehicle',
- }
- -- Vehicle Details
- Config.VehicleDetails = {
- {
- label = 'Plate',
- type = 'text',
- prop = 'plate'
- },
- {
- label = 'Engine health',
- type = 'percentage',
- max = 1000,
- prop = 'engineHealth'
- },
- {
- label = 'Body health',
- type = 'percentage',
- max = 1000,
- prop = 'bodyHealth'
- },
- {
- label = 'Fuel level',
- type = 'percentage',
- max = 100,
- prop = 'fuelLevel'
- },
- }
- -- Enter options
- -- This is used when you enter the garage and open the impound.
- Config.EnterKey = {
- index = 38,
- name = 'INPUT_CONTEXT'
- }
- Config.EnterAnim = {
- dict = 'anim@apt_trans@garage',
- anim = 'gar_open_1_right',
- startTime = 0.24
- }
- Config.EnterDistance = {
- on_foot = 2.0,
- in_vehicle = 5.0
- }
- -- Interiors
- -- This is the background while you are inside a garage.
- Config.DefaultInterior = 'low';
- Config.Interiors = {
- ['low'] = {
- coords = vector3(177.61, -1007.26, -98.9),
- rotation = vector3(0, 0, 45)
- },
- ['mid'] = {
- coords = vector3(191.78, -1001.44, -99.0),
- rotation = vector3(0, 0, -90)
- },
- ['mid2'] = {
- coords = vector3(192.0, -1020.26, -98.9),
- rotation = vector3(0, 0, -90)
- },
- ['high'] = {
- coords = vector3(228.3, -1003.1, -98.9),
- rotation = vector3(0, 0, 0)
- },
- ['tuner'] = {
- coords = vector3(996.6, -2994.4, -38.0),
- rotation = vector3(0, 0, 120)
- },
- ['parking_garage'] = {
- coords = vector3(1306.8, 260.4, -48.0),
- rotation = vector3(0, 0, 140)
- }
- }
- -- Images
- -- These images are for the vehicles.
- -- This is just an example. I can not assure you that the API will work forever, but it worked when I did this.
- -- This example does not work for all vehicles. If you have a better API you can easily replace it.
- -- Do not touch this if you do not know how it works.
- Config.ImageAPI = {
- url = function(modelHash, modelName, modelLabel)
- return ('https://gta.now.sh/api/vehicles/%s'):format(modelLabel:lower())
- end,
- callback = function(result)
- return result.images and result.images['frontQuarter'] or false
- end
- }
- Config.Images = { -- Here you can add your images for models.
- -- Example
- -- ['rmodsupra'] = 'https://libertycity.net/uploads/download/gta5_toyota/fulls/f0b94mbi94gqu2848t03eqaas4/1498320350941_14902102306952_1.jpg'
- ['baller2'] = 'https://i.imgur.com/twz773F.png',
- ['dubsta3'] = 'https://i.imgur.com/gRJeu00.png',
- ['elegy2'] = 'https://i.imgur.com/tXAFkee.png'
- }
- -- Vehicle Labels
- -- Some of your addons vehicles may not have a label, here you can add your labels. These will also override the default labels.
- Config.VehicleLabels = {
- -- Example
- -- ['rmodsupra'] = 'Toyota Supra'
- }
- -- Hide HUD
- -- You can add your exports and events here. The boolean will be true when you enter the garage and false when you leave it.
- Config.HideHUD = function(boolean)
- DisplayRadar(not boolean);
- if Config.Framework == 'ESX' then
- elseif Config.Framework == 'QBCore' then
- end
- TriggerEvent('esx_status:setDisplay', boolean and 0.0 or 0.5)
- end
- -- Check if owner of vehicle
- -- You can add other criteria, for example that you need a key for the vehicle instead of being owner.
- -- ! This only works for ESX and QBCore !
- Config.DisableVehicleCheck = true -- If false it will check if you are the owner
- Config.VehicleCheck = function(plate, owner, identifier, vehicle, player)
- return owner == identifier
- end
- -- Check if player has the job
- Config.JobCheck = function(job)
- if Config.Framework == 'ESX' then
- return ESX.PlayerData.job.name == job
- elseif Config.Framework == 'QBCore' then
- return QBCore.playerJob.name == job
- else
- -- standalone
- return true
- end
- end
- Config.ShowBlipForEveryone = false -- If true the blips with required jobs will not be shown for people without the job
- -- Notification
- Config.Notification = function(source, text)
- if Config.Framework == 'ESX' then
- TriggerClientEvent('esx:showNotification', source, text)
- elseif Config.Framework == 'QBCore' then
- TriggerClientEvent('QBCore:Notify', source, text)
- end
- end
- -- Vehicle Props
- -- This is only extra props if you are using ESX or QBCore.
- -- These props can also be used in Config.VehicleDetails. If you want a specific detail about a vehicle you can save the prop here.
- Config.GetVehicleProps = function(props, vehicle)
- props.wheelHealth = {}
- props.tireBurst = {}
- props.tireCompletelyBurst = {}
- props.smashedWindows = {}
- props.brokenDoors = {}
- props.engineHealth = GetVehicleEngineHealth(vehicle)
- props.bodyHealth = GetVehicleBodyHealth(vehicle)
- props.fuelLevel = GetVehicleFuelLevel(vehicle)
- for i = 0, 3 do
- props.wheelHealth[i] = GetVehicleWheelHealth(vehicle, i)
- end
- for i = 0, 5 do
- props.tireBurst[i] = IsVehicleTyreBurst(vehicle, i, false)
- end
- for i = 0, 5 do
- props.tireCompletelyBurst[i] = IsVehicleTyreBurst(vehicle, i, true)
- end
- for i = 0, 7 do
- props.smashedWindows[i] = IsVehicleWindowIntact(vehicle, i) ~= 1
- end
- for i = 0, 5 do
- props.brokenDoors[i] = IsVehicleDoorDamaged(vehicle, i) == 1
- end
- end
- Config.SetVehicleProps = function(props, vehicle)
- if Config.Framework == 'QBCore' then
- TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(vehicle))
- end
- SetVehicleEngineHealth(vehicle, props.engineHealth and props.engineHealth + 0.0 or 1000.0)
- SetVehicleBodyHealth(vehicle, props.bodyHealth and props.bodyHealth + 0.0 or 1000.0)
- SetVehicleFuelLevel(vehicle, props.fuelLevel and props.fuelLevel + 0.0 or 100.0)
- if props.wheelHealth then
- for wheelIndex, health in pairs(props.wheelHealth) do
- SetVehicleWheelHealth(vehicle, tonumber(wheelIndex), health)
- end
- end
- if props.tireBurst then
- for wheelIndex, burstState in pairs(props.tireBurst) do
- if burstState then
- SetVehicleTyreBurst(vehicle, tonumber(wheelIndex), false, 1000.0)
- end
- end
- end
- if props.tireCompletelyBurst then
- for wheelIndex, burstState in pairs(props.tireCompletelyBurst) do
- if burstState then
- SetVehicleTyreBurst(vehicle, tonumber(wheelIndex), true, 1000.0)
- end
- end
- end
- if props.smashedWindows then
- for windowIndex, smashWindow in pairs(props.smashedWindows) do
- if smashWindow then
- SmashVehicleWindow(vehicle, tonumber(windowIndex))
- end
- end
- end
- if props.brokenDoors then
- for doorIndex, breakDoor in pairs(props.brokenDoors) do
- if breakDoor and GetIsDoorValid(vehicle, tonumber(doorIndex)) then
- SetVehicleDoorBroken(vehicle, tonumber(doorIndex), true)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement