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. Object 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'
    },
    
    TextUI = {
        position = 'right-center' -- 'right-center' or 'left-center' or 'top-center' or 'bottom-center'
    },

    Logs = {
        enabled = true,
        webhook = 'https://discord.com/api/webhooks/1241796943378911393/7ARn2slhT1tnEFQB_TY4WLUHmV7srOvWTpcL--sfn4ztNIv8BzpewV-_6aE_F6hxZr-c',
        servername = 'Uniq Scripts',
        color = 6579450,
        icon_url = 'https://dunb17ur4ymx4.cloudfront.net/webstore/logos/046c8efd198a2806b6ae46490f6aa780a225125e.png'
    },

    Commands = {
        adminmenu = {
            name = 'objectcreator',         -- command for accessing admin panel
            restricted = 'group.admin',     -- group that will have access to the command 
        }
    },

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

    targetType = 'ox', -- ox/qb - if on ESX use "ox"

    spawnObjectDistance = 100, -- the distance at which objects spawn for players

    collectibleSettings = { -- settings for collectible objects
        distance = 5, -- the distance from which it is possible to collect the object
        key = 38, -- key to collect the object - [default: E]
        keyLabel = 'E',
        targetIcon = 'fas fa-hand-holding',
        animation = {
            dict = 'anim@amb@business@coc@coc_unpack_cut@',
            clip = 'fullcut_cycle_v1_cokecutter'
        },
    },
}
function sendNotify(title, description, type)
    lib.notify({
        title = title,
        description = description,
        duration = Shared.Notify.duration,
        type = type,
        position = Shared.Notify.position
    })
end

RegisterNetEvent('objectcreator:notify', sendNotify)

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

function hideTextUI()
    lib.hideTextUI()
end

-- Progress Bar
function progressBar(duration, label, dict, clip)
    lib.progressBar({
        duration = duration,
        label = label,
        useWhileDead = false,
        canCancel = false,
        disable = {
            car = true,
        },
        anim = {
            dict = dict,
            clip = clip
        }
    })
end

-- 3D Text
function DrawText3D(x, y, z, text)
    local onScreen, _x, _y = World3dToScreen2d(x, y, z)
    local px, py, pz = table.unpack(GetGameplayCamCoords())
    
    SetTextScale(0.5, 0.5)
    SetTextFont(4)
    SetTextProportional(1)
    SetTextColour(255, 255, 255, 215)
    SetTextEntry("STRING")
    SetTextCentre(1)
    AddTextComponentString(text)
    DrawText(_x, _y)
end

-- Draw Marker
function DrawMarkerAtCoords(x, y, z, scale)
    DrawMarker(1, x, y, z, 0, 0, 0, 0, 0, 0, scale.x, scale.y, scale.z, 255, 255, 255, 255, false, true, 2, nil, nil, false)
end
-- "object table":
-- object: string
-- isDoor: boolean
-- restrictedJobs: table
-- collision: boolean
-- interaction: false or table (target/text_ui/text_3d/marker)
-- frozen: boolean
-- collectible: boolean
-- temporary: boolean
-- coords: table (x, y, z)
-- heading: number

-- "point table":
-- coords: table(x, y, z)
-- heading: number
-- distance: number
-- data: table (object table data)
-- tableid: string (object unique id)

... extra lua code after objects are created (automatically generated)
-- 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

-- Collectible Function
function collectibleReward()
    -- code for sending reward after collecting object
end
PreviousDependenciesNextCocaine Labs

Last updated 12 months ago