HEX
HexscriptsClassicWhitelist

Configurations

Here you will get all configurations & open source files that are included within this script.

Config Files

Config = {}

Config.Debug = false -- Set to true to enable debug messages in the console
Config.Locale = 'automatic' -- automatic, en, de, es, fr, it, nl, pl, pt, tr, ar
Config.Framework = 'esx' -- automatic, esx

Config.TeleportOutside = vector4(-1043.1368, -2747.0354, 20.3595, 330.2002) -- Coordinates where non-whitelisted players get teleported to after approval.
Config.WalkToOutside = vector4(-1034.9967, -2732.5415, 20.1693, 331.3467) -- Coordinates where non-whitelisted players walk to after getting teleported. (Or false to disable walking)

Config.Area = { -- Area which gets used for the Whitelist Process.
    coords = vector3(-1090.0878, -2827.7122, 28.6854),
    entrys = { -- Points where the player spawns after Char Creator / Cut Scene.
        vector4(-1149.8241, -2804.1147, 26.4038, 236.3665),
        vector4(-1140.6368, -2788.5100, 26.4038, 240.7676),
        vector4(-1036.5070, -2848.7693, 26.4038, 56.6689),
        vector4(-1045.4875, -2864.4185, 26.4038, 60.5567)
    },
    bells = {
        vector3(-1088.4247, -2823.5964, 26.1757),
    },
    radius = 125.0,
    debug = false -- Set to true to enable debug circle for the area
}

Config.BellMarker = {
    type = 1, -- Marker Type (https://wiki.rage.mp/index.php?title=Markers)
    color = { r = 255, g = 0, b = 0, a = 100 }, -- Marker Colors (RGBA)
    scale = vector3(2.5, 2.5, 0.25),
    upAndDown = false, -- If the Marker should move up and down
    faceCamera = false, -- If the Marker should face the Camera
    rotate = false, -- If the Marker should rotate
    glowUp = true -- If the marker should glow up when the Player is near
}

Config.DefaultGroup = 'user' -- Default group for players when they join the server.

Config.NameTags = {
    enable = true, -- If the Name Tags should be enabled
    adminStar = true
}

Config.AntiTeleport = true -- Simple Anti Leave Area System.
Config.PlaneAnimation = true -- Credits to Doublox

Config.HelpText = {
    enabled = true,
    text = 'Go to the ~y~Terminal~s~ and talk with the ~b~Airport Staff~s~ to get whitelisted!',
    xPos = 0.5,
    yPos = 0.95,

    scale = 0.5
}

Config.IntroBanner = {
    enabled = true,
    title = 'HEX RP',
    subtitle = 'WELCOME!',
    longtitle = 'Have fun on our Server!\nRemember to follow the Rules!',

    moneyText = {
        { name = 'Starting Cash', value = '~s~1.000~g~$' },
        { name = 'Bank Balance', value = '~s~10.000~g~$' }
    },

    totalMoney = 11000
}

Open Source Files

if Config.Framework == 'automatic' then
    if GetResourceState('es_extended') == 'started' then
        Config.Framework = 'esx'
    elseif GetResourceState('qb-core') == 'started' then
        Config.Framework = 'qbcore'
    else
        Config.Framework = 'standalone'
    end
end

local function removeColorString(str)
    return str:gsub("~.-~", ""):gsub("[%[%]]", "")
end

function DrawHelpNotify(message)
   local cleanMessage = removeColorString(message)

    if GetResourceState('hex_final_hud') == 'started' then
        exports['hex_final_hud']:HelpNotify(cleanMessage)
    elseif GetResourceState('hex_2_hud') == 'started' then
        exports['hex_2_hud']:HelpNotify(cleanMessage)
    elseif GetResourceState('hex_future_hud') == 'started' then
        exports['hex_future_hud']:HelpNotify(cleanMessage)
    elseif GetResourceState('hex_1_hud') == 'started' then
        exports['hex_1_hud']:HelpNotify(cleanMessage)
    elseif GetResourceState('hex_hud_prem') == 'started' then
        exports['hex_hud_prem']:HelpNotify(cleanMessage)
    elseif GetResourceState('hex_4_hud') == 'started' then
        exports['hex_4_hud']:HelpNotify(cleanMessage)
    else
        SetTextComponentFormat('STRING')
        AddTextComponentString(message)
        DisplayHelpTextFromStringLabel(0, 0, 1, -1)
    end
end

function Notify(title, message, notifyType, timeout)
    if timeout == nil then timeout = 5000 end
    if notifyType == nil then notifyType = 'info' end

    if GetResourceState('hex_final_hud') == 'started' then
        exports['hex_final_hud']:Notify(title, message, notifyType, timeout)
    elseif GetResourceState('hex_2_hud') == 'started' then
        exports['hex_2_hud']:Notify(title, message, notifyType, timeout)
    elseif GetResourceState('hex_future_hud') == 'started' then
        exports['hex_future_hud']:Notify(title, message, notifyType, timeout)
    elseif GetResourceState('hex_1_hud') == 'started' then
        exports['hex_1_hud']:Notify(title, message, notifyType, timeout)
    elseif GetResourceState('hex_hud_prem') == 'started' then
        exports['hex_hud_prem']:Notify(title, message, notifyType, timeout)
    elseif GetResourceState('hex_hud') == 'started' then
        exports['hex_hud']:Notify(title, message, notifyType, timeout)
    elseif GetResourceState('hex_4_hud') == 'started' then
        exports['hex_4_hud']:Notify(title, message, notifyType, timeout)
    else
        print(('Notify: %s, %s, %s, %s'):format(title, message, notifyType, timeout))
    end
end

function HideHud()
    if GetResourceState('hex_final_hud') == 'started' then
        exports['hex_final_hud']:HideHud(true)
    elseif GetResourceState('hex_2_hud') == 'started' then
        exports['hex_2_hud']:HideHud(true)
    elseif GetResourceState('hex_future_hud') == 'started' then
        exports['hex_future_hud']:HideHud(true)
    elseif GetResourceState('hex_hud_prem') == 'started' then
        exports['hex_hud_prem']:HideHud(true)
    elseif GetResourceState('hex_hud') == 'started' then
        exports['hex_hud']:HideHud(true)
    elseif GetResourceState('hex_4_hud') == 'started' then
        exports['hex_4_hud']:HideHud(true)
    else
        -- own implementation
    end
end

function ShowHud()
    if GetResourceState('hex_final_hud') == 'started' then
        exports['hex_final_hud']:HideHud(false)
    elseif GetResourceState('hex_2_hud') == 'started' then
        exports['hex_2_hud']:HideHud(false)
    elseif GetResourceState('hex_future_hud') == 'started' then
        exports['hex_future_hud']:HideHud(false)
    elseif GetResourceState('hex_hud_prem') == 'started' then
        exports['hex_hud_prem']:HideHud(false)
    elseif GetResourceState('hex_hud') == 'started' then
        exports['hex_hud']:HideHud(false)
    elseif GetResourceState('hex_4_hud') == 'started' then
        exports['hex_4_hud']:HideHud(false)
    else
        -- own implementation
    end
end

charCreatorActive = true
AddEventHandler('charcreator:setState', function(state) -- Put this in your Scripts/other Resources for Intigration (TriggerEvent('charcreator:setState', true) to enable and TriggerEvent('charcreator:setState', false) to disable)
    charCreatorActive = state
end)

function isInCharCreator()
    if GetResourceState('hex_3_charcreator') == 'started' then
        return exports['hex_3_charcreator']:IsCharCreatorOpen()
    end

    return false
end