Configuration

Don't touch this line

Config, Keys, Noti = {}, {}, {}

CONFIGURATION FILE

Config, Keys, Noti = {}, {}, {}

-- $$$$$$\   $$$$$$\  $$\   $$\ $$$$$$$$\ $$$$$$\  $$$$$$\  $$\   $$\ $$$$$$$\   $$$$$$\ $$$$$$$$\ $$$$$$\  $$$$$$\  $$\   $$\ 
--$$  __$$\ $$  __$$\ $$$\  $$ |$$  _____|\_$$  _|$$  __$$\ $$ |  $$ |$$  __$$\ $$  __$$\\__$$  __|\_$$  _|$$  __$$\ $$$\  $$ |
--$$ /  \__|$$ /  $$ |$$$$\ $$ |$$ |        $$ |  $$ /  \__|$$ |  $$ |$$ |  $$ |$$ /  $$ |  $$ |     $$ |  $$ /  $$ |$$$$\ $$ |
--$$ |      $$ |  $$ |$$ $$\$$ |$$$$$\      $$ |  $$ |$$$$\ $$ |  $$ |$$$$$$$  |$$$$$$$$ |  $$ |     $$ |  $$ |  $$ |$$ $$\$$ |
--$$ |      $$ |  $$ |$$ \$$$$ |$$  __|     $$ |  $$ |\_$$ |$$ |  $$ |$$  __$$< $$  __$$ |  $$ |     $$ |  $$ |  $$ |$$ \$$$$ |
--$$ |  $$\ $$ |  $$ |$$ |\$$$ |$$ |        $$ |  $$ |  $$ |$$ |  $$ |$$ |  $$ |$$ |  $$ |  $$ |     $$ |  $$ |  $$ |$$ |\$$$ |
--\$$$$$$  | $$$$$$  |$$ | \$$ |$$ |      $$$$$$\ \$$$$$$  |\$$$$$$  |$$ |  $$ |$$ |  $$ |  $$ |   $$$$$$\  $$$$$$  |$$ | \$$ |
 --\______/  \______/ \__|  \__|\__|      \______| \______/  \______/ \__|  \__|\__|  \__|  \__|   \______| \______/ \__|  \__|

--Use "esx" or "qb"
Config.Framework = "esx"
--Default ESX: "esx:getSharedObject" | Default QB: "qb-core"
Config.Core = "esx:getSharedObject"
-- 10 seconds. Increase if necessary for resource-poor servers
Config.refreshtime = 10000 
--If you want the script to take a few seconds to start (so as not to show the hud on the loading screen)
Config.scriptTimeout = 5000 
-- 2 seconds. Increase if necessary for resource-poor servers
Config.refreshstreets = 2000  
-- 0.5 seconds. Increase if necessary for resource-poor servers
Config.refreshhud = 400  
--If you want to enable/disable car hud 
Config.carhudactive = true 
--if you want to see the stats (life, armor, hunger...) as a square or a round one
Config.statsrounded = true 
--Name to be displayed at the top of the HUD
Config.servername = "SERVERNAME" 
--Logo of your server
Config.logo = "./img/logo.png"
-- Seat belt key. Default: G // Change to the one assigned on your server
Config.BeltKey = 183 
-- Motor on/off key. Default: L // Change to the one assigned on your server
Config.EngineKey = 182 
--if you set it to false it will be displayed in MPH
Config.KMH = true 
--if you want to enable/disable the time to be displayed
Config.showtime = true 
--if you want to enable/disable the display of addresses
Config.showstreets = true
--show life, armor, thirst and hunger. 
Config.showStatus = true 
--Activate only to view errors
Config.devMode = false

--$$\   $$\ $$$$$$$$\ $$\     $$\  $$$$$$\  
--$$ | $$  |$$  _____|\$$\   $$  |$$  __$$\ 
--$$ |$$  / $$ |       \$$\ $$  / $$ /  \__|
--$$$$$  /  $$$$$\      \$$$$  /  \$$$$$$\  
--$$  $$<   $$  __|      \$$  /    \____$$\ 
--$$ |\$$\  $$ |          $$ |    $$\   $$ |
--$$ | \$$\ $$$$$$$$\     $$ |    \$$$$$$  |
--\__|  \__|\________|    \__|     \______/

Keys.active = false --show keybinds side panel
Keys.key1 = "M"
Keys.key1desc = "Mobile"
Keys.key2 = "X"
Keys.key2desc = "Hands Up"
Keys.key3 = "F2"
Keys.key3desc = "Inventory"
Keys.key4 = "L"
Keys.key4desc = "Lock Car"
Keys.key5 = "G"
Keys.key5desc = "Seat Belt"

--$$\   $$\  $$$$$$\ $$$$$$$$\ $$$$$$\ $$$$$$$$\ $$$$$$\  $$$$$$\   $$$$$$\ $$$$$$$$\ $$$$$$\  $$$$$$\  $$\   $$\ 
--$$$\  $$ |$$  __$$\\__$$  __|\_$$  _|$$  _____|\_$$  _|$$  __$$\ $$  __$$\\__$$  __|\_$$  _|$$  __$$\ $$$\  $$ |
--$$$$\ $$ |$$ /  $$ |  $$ |     $$ |  $$ |        $$ |  $$ /  \__|$$ /  $$ |  $$ |     $$ |  $$ /  $$ |$$$$\ $$ |
--$$ $$\$$ |$$ |  $$ |  $$ |     $$ |  $$$$$\      $$ |  $$ |      $$$$$$$$ |  $$ |     $$ |  $$ |  $$ |$$ $$\$$ |
--$$ \$$$$ |$$ |  $$ |  $$ |     $$ |  $$  __|     $$ |  $$ |      $$  __$$ |  $$ |     $$ |  $$ |  $$ |$$ \$$$$ |
--$$ |\$$$ |$$ |  $$ |  $$ |     $$ |  $$ |        $$ |  $$ |  $$\ $$ |  $$ |  $$ |     $$ |  $$ |  $$ |$$ |\$$$ |
--$$ | \$$ | $$$$$$  |  $$ |   $$$$$$\ $$ |      $$$$$$\ \$$$$$$  |$$ |  $$ |  $$ |   $$$$$$\  $$$$$$  |$$ | \$$ |
--\__|  \__| \______/   \__|   \______|\__|      \______| \______/ \__|  \__|  \__|   \______| \______/ \__|  \__|

Noti.time = 5000 -- 5 seconds // how long the notification will be displayed
--[[
    NOTIFICATION INFO:
    -Notifications can be used through the following trigger:

    TriggerEvent('bit-hud:noti', PlayerID, "Title", "Message", "info")

    NOTE: The title of the message cannot exceed 18 characters and the message cannot exceed 152 characters.
    Type of alerts available: info, warning, success, error
]]

-- $$$$$$\   $$$$$$\  $$$$$$$$\ $$$$$$$$\       $$$$$$$$\  $$$$$$\  $$\   $$\ $$$$$$$$\  $$$$$$\  
--$$  __$$\ $$  __$$\ $$  _____|$$  _____|      \____$$  |$$  __$$\ $$$\  $$ |$$  _____|$$  __$$\ 
--$$ /  \__|$$ /  $$ |$$ |      $$ |                $$  / $$ /  $$ |$$$$\ $$ |$$ |      $$ /  \__|
--\$$$$$$\  $$$$$$$$ |$$$$$\    $$$$$\             $$  /  $$ |  $$ |$$ $$\$$ |$$$$$\    \$$$$$$\  
 --\____$$\ $$  __$$ |$$  __|   $$  __|           $$  /   $$ |  $$ |$$ \$$$$ |$$  __|    \____$$\ 
--$$\   $$ |$$ |  $$ |$$ |      $$ |             $$  /    $$ |  $$ |$$ |\$$$ |$$ |      $$\   $$ |
--\$$$$$$  |$$ |  $$ |$$ |      $$$$$$$$\       $$$$$$$$\  $$$$$$  |$$ | \$$ |$$$$$$$$\ \$$$$$$  |
-- \______/ \__|  \__|\__|      \________|      \________| \______/ \__|  \__|\________| \______/

--if you do not want to use safe zones delete all the following coordinates
--You can add as many as you wish
safezones = {
	{x = -251.21, y = -980.46, z = 31.22}, -- Employment office
	{x = 223.55, y = -1394.69, z = 31.22}, -- Driving school
	{x = -35.47, y = -1100.37, z = 26.46}, -- Car dealership
	{x = 299.04, y = -583.9, z = 43.26}, -- Central Hospital
	{x = 1814.53, y = 3678.62, z = 34.28}, -- Sandy Hospital 
    }
distance = 60.0

--$$$$$$$$\ $$\   $$\ $$\   $$\  $$$$$$\ $$$$$$$$\ $$$$$$\  $$$$$$\  $$\   $$\  $$$$$$\  
--$$  _____|$$ |  $$ |$$$\  $$ |$$  __$$\\__$$  __|\_$$  _|$$  __$$\ $$$\  $$ |$$  __$$\ 
--$$ |      $$ |  $$ |$$$$\ $$ |$$ /  \__|  $$ |     $$ |  $$ /  $$ |$$$$\ $$ |$$ /  \__|
--$$$$$\    $$ |  $$ |$$ $$\$$ |$$ |        $$ |     $$ |  $$ |  $$ |$$ $$\$$ |\$$$$$$\  
--$$  __|   $$ |  $$ |$$ \$$$$ |$$ |        $$ |     $$ |  $$ |  $$ |$$ \$$$$ | \____$$\ 
--$$ |      $$ |  $$ |$$ |\$$$ |$$ |  $$\   $$ |     $$ |  $$ |  $$ |$$ |\$$$ |$$\   $$ |
--$$ |      \$$$$$$  |$$ | \$$ |\$$$$$$  |  $$ |   $$$$$$\  $$$$$$  |$$ | \$$ |\$$$$$$  |
--\__|       \______/ \__|  \__| \______/   \__|   \______| \______/ \__|  \__| \______/

--Online users
function getOnlineUsers()
    if Config.Framework == "esx" then
        local users = ESX.Game.GetPlayers()
        usersamount = 0
        for _, playerId in ipairs(users) do
            users = usersamount + 1
        end
        return users
    elseif Config.Framework == "qb" then
        local users = QBCore.Functions.GetPlayers()
        usersamount = 0
        for _, playerId in ipairs(users) do
            users = usersamount + 1
        end
        return users
    end
end

--Player money
function getPlayerMoney()
    if Config.Framework == "esx" then
        money = ESX.GetPlayerData().money
        return money
    elseif Config.Framework == "qb" then
        money = QBCore.Functions.GetPlayerData().money["cash"]
        return money
    end
end

--Player health
function getPlayerHealth(ped)
    health = GetEntityHealth(ped) - 100
    return health
end

--Player armour
function getPlayerArmour(ped)
    armour = GetPedArmour(ped)
    return armour
end

--Hunger and Thirst
function GetStatus(cb)
    if Config.Framework == "esx" then
        TriggerEvent("esx_status:getStatus", "hunger", function(h)
            TriggerEvent("esx_status:getStatus", "thirst", function(t)
                local hunger = h.getPercent()
                local thirst = t.getPercent()
                local stress = 0
                cb({hunger, thirst, stress})
            end)
        end)
    elseif Config.Framework == "qb" then
        local hunger = QBCore.Functions.GetPlayerData().metadata["hunger"]
        local thirst = QBCore.Functions.GetPlayerData().metadata['thirst']
        local stress = QBCore.Functions.GetPlayerData().metadata['stress']
        cb({hunger, thirst, stress})
    end
end

Last updated