Documentation
  • Discord Server
  • About Us
  • Free Resources
    • Death Screen
      • PS-Dispatch Integration
    • Battlepass
      • Guides
      • Commands
        • Player Commands
        • Admin Commands
      • API
        • Server
    • Garages
      • Guides
        • Creating Interior
        • Creating Garage
        • How to find entity sets (customizations) for interior
  • Paid Resources
    • Elevator Creator V2
      • Installation
      • Accessible code
    • Radar System V2
      • Installation
      • Accessible code
    • Hotels Creator
      • Accessible code
    • Vehicle Shop Creator
      • Accessible code
    • Stocks Market
      • Accessible code
      • [DEV] - Usable Functions
    • Discord Voice Attendance
      • Installation
    • Deathmatch System
      • Installation
        • esx_ambulancejob
        • qb-ambulancejob
        • wasabi_ambulance
        • qbx_medical
        • codem-inventory
        • core_inventory
      • Accessible code
    • Object Creator
      • Dependencies
      • Accessible code
    • Cocaine Labs
      • Dependencies
      • Accessible code
    • Ownable Crafting Tables
      • Dependencies
      • Accessible code
      • Common Problems
    • Evidence System
      • Dependencies
      • Accessible code
      • Installation
      • API
    • Marketplace V2
      • Accessible code
      • Installation
      • Migration from V1
    • EMS Dispatch
      • Sending Dispatch
      • Accessing the Menu
      • Config File
    • Weed Planting
      • Accessible code
      • How to add new strain?
      • How to install
    • Advanced DarkNet System
      • Config
    • Advanced Taxi Job
      • Accessible code
      • Changelog
    • Advanced Gang Creator
      • Accessible code
      • Installation
        • QB Core
        • QBOX Core
      • API
      • FAQ
    • Advanced Private Cameras
      • ESX
        • Items
      • QBCore
        • Items
      • Accessible code
    • Advanced Elevator Creator
      • Accessible code
    • Advanced Ownable Rent Creator
      • SQL
      • ESX
      • QBCore
      • Config File
    • Advanced Job Creator
      • Installation
        • QB CORE
      • Accessible code
    • Advanced Ownable Shops
      • Installation
      • Accessible code
      • SQL
    • Advanced Ped Creator
      • SQL
      • Config File
    • Advanced Promocode Creator
      • Accessible code
      • SQL File
      • Common problems
    • Advanced Safe Zone Creator
      • Config File
    • Turf Wars
      • Ox Inventory
      • Accessible code
      • API
    • Advanced Gas Station Creator
      • Accessible code
    • Advanced Advertisements System
      • SQL File
      • Accessible code
    • Player Manager
      • Installation
      • Accessible code
    • Mechanic Job
      • Installation
      • Accessible code
      • SQL
    • Advanced Radar System
      • Accessible code
      • SQL
    • Crypto Mining
      • Installation
      • Accessible code
      • Items
      • SQL
    • Racing System
      • Accessible code
    • Car Theft
      • Accessible code
    • Advanced Solar Panels
      • Accessible Code
      • SQL
      • ESX
        • Items
      • QBCore
        • Items
    • Pilot Job
      • Accessible Code
      • ESX
        • SQL
      • QBCore
        • Metadata
        • qb-smallresources
      • QBOX
        • Metadata
    • Advanced Ownable Banks
      • Accessible Code
    • Post Office
      • Accessible Code
      • ESX
        • SQL
      • QBCore
        • SQL
      • Exports
    • Weather Sync
      • API
    • Billing System
      • Accessible code
      • SQL
      • Common problems
Powered by GitBook
On this page
  1. Paid Resources
  2. Advanced Elevator Creator

Accessible code

Shared = {
    Locale = 'en',

    Notify = {
        duration = 5000, -- miliseconds
        position = 'top-right' -- 'top' or 'top-right' or 'top-left' or 'bottom' or 'bottom-right' or 'bottom-left' or 'center-right' or 'center-left'
    },
    
    Logs = {
        enabled = true,
        webhook = '',
        servername = 'Uniq Scripts',
        color = 6579450,
        icon_url = 'https://dunb17ur4ymx4.cloudfront.net/webstore/logos/248d77847b320034db12949cf577772b654daadd.png'
    },

    Commands = {
        elevator = {
            name = 'elevator',              -- command for accessing elevator menu: create elevator, delete elevator, elevators list
            restricted = 'group.admin',     -- group that will have acces to command 
        }
    },

    Keys = { -- https://docs.fivem.net/docs/game-references/controls/
        finish = 191,
        cancel = 194,
        delete = 256,
        accessElevator = 38,
    },

    TextUI = true, -- enable/disable text ui
    TextUI_Position = 'top-center', -- 'right-center' or 'left-center' or 'top-center'

    MinFloors = 2, -- minimum amount of floors admin must create (2 recommended)
    MaxFloors = 10, -- maximum amount of floors admin can create

    ClosestRadius = 10, -- radius in which the script will search for the nearest elevator that needs to be deleted when the "closest" option is selected

    UseMarker = true, -- whether to use marker or not (textUI will still be shown)

    Distance = {
        marker = 10, -- distance from which the elevator marker will be seen
        textui = 2 -- distance from which the textui will be seen
    },
    
    Target = "qb-target", -- Set to "ox_target", "qb-target" or "" (empty string) to disable target system
}
function sendNotify(title, description, type)
    lib.notify({
        title = title,
        description = description,
        duration = Shared.Notify.duration,
        type = type,
        position = Shared.Notify.position
    })
end

RegisterNetEvent('elevator:notify', sendNotify)

-- Text UI
function textUI(description, icon)
    if Shared.TextUI then
        lib.showTextUI(description, {
            position = Shared.TextUI_Position,
            icon = icon
        })
    end
end

function hideTextUI()
    if Shared.TextUI then
        lib.hideTextUI()
    end
end

-- Marker
function Marker(x, y, z)
    DrawMarker(2, x, y, z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.2, 0.15, 255, 255, 255, 255, false, false, false, true, false, false, false)
end
-- Discord Logs
local webhook = Shared.Logs.webhook

function logger(message)
    if Shared.Logs.enabled then
        if webhook ~= '' then
            PerformHttpRequest(webhook, function(status) end, 'POST', json.encode({
                username = cache.resource,
                embeds = {{
                    color = Shared.Logs.color,
                    title = Shared.Logs.servername,
                    description = message,
                    footer = {
                        text = os.date(),
                        icon_url = Shared.Logs.icon_url
                    }
                }}
            }), { ['Content-Type'] = 'application/json' })
        end
    end
end

-- Elevator command
lib.addCommand(Shared.Commands.elevator.name, {
    help = L('command.elevator.description'),
    restricted = Shared.Commands.elevator.restricted
}, function(source)
    fetchElevators()
    TriggerClientEvent("elevator:adminMenu", source)
end)
PreviousAdvanced Elevator CreatorNextAdvanced Ownable Rent Creator

Last updated 7 months ago