Page cover

βš™οΈConfiguration

This is the configuration that you can give to this script to modify it to your liking

Config File

Config = {}

Config.Debug = false
Config.DrawDistance = 5.0
Config.MarkerColor = {r = 255, g = 100, b = 0, a = 255}

Config.Songs = {
    CloseDoor = {
        Enabled = true,
        Volume = 0.3,
        Song = 'closeliftdoor' -- (the names without .ogg ) You can change this song in thee resource interact-sound/client/html/sounds
    },
    AlertSong = {
        Enabled = true,
        Volume = 0.3,
        Song = 'liftalarm' -- (the names without .ogg ) You can change this song in thee resource interact-sound/client/html/sounds
    }
}

Config.Lifts = {
    ['Security-1'] = {
        [1] = {
            FloorName = 'Ground Floor',
            Floor = vector4(-589.3970, -708.0062, 36.2794, 358.5822),
            RequireJob = { 'police', 'ambulance' } -- You can set this format to run multiple jobs or just one job. for example: {'police'} or {'police', 'ambulance'} 
        },
        [2] = {
            FloorName = 'Office',
            Floor = vector4(-574.5282, -715.7551, 113.0053, 89.9830),
            RequireJob = nil --- If you leave this value at nil, it will not have that lift whitelist.
        }
    }
}

Config.Translation = {
    ['you_current_floor'] = 'You are already on the %s floor',
    ['press_e'] = 'Press ~g~[E] ~w~to interact',
    ['you_dont_have_permissions'] = 'You are not an employee of this place'
}

Client Side Editable

/shared/cl_editable.lua

local ESX, QBCore

if GetResourceState('es_extended') == 'started' then
    ESX = exports['es_extended']:getSharedObject()
end
if GetResourceState('qb-core') == 'started' then
    QBCore = exports['qb-core']:GetCoreObject()
end

Notify = function(txt, style)
    if ESX ~= nil then
        TriggerEvent('esx:showNotification', txt)
    elseif QBCore ~= nil then
        TriggerEvent('QBCore:Notify', txt, style)
    end
end

GetRequiredJob = function(floorData)
    if floorData.RequireJob == nil or #floorData.RequireJob == 0 then
        return true 
    else
        if requiredJobs == nil then
            return true
        else
            if ESX ~= nil then
                local player = ESX.GetPlayerData()
                if player ~= nil and player.job ~= nil then
                    for _, requiredJob in ipairs(requiredJobs) do
                        if player.job.name == requiredJob then
                            return requiredJob
                        end
                    end
                end
            elseif QBCore ~= nil then
                local player = QBCore.Functions.GetPlayerData()
                if player ~= nil and player.job ~= nil then
                    for _, requiredJob in ipairs(requiredJobs) do
                        if player.job.name == requiredJob then
                            return requiredJob
                        end
                    end
                end
            end
        end
        
    end
    return false 
end

Last updated