Configuration

config.lua

-- █▀▀ █▀▀ █▄░█ █▀▀ █▀█ ▄▀█ █░░
-- █▄█ ██▄ █░▀█ ██▄ █▀▄ █▀█ █▄▄

Config.Framework = "auto" -- esx, qb, auto
--it is recommended to leave it as auto if auto selection doesn't work you can manually select esx or qb!
Config.LogOut = "logout" -- false or command_name
-- Can you return to the character menu with a command while in the game on your server? If you do not want this, mark it as false, if you want to enter the command
Config.Web = "https://debux.tebex.io" 
-- Where should I be redirected when I press the website button?
Config.WaitAnim = true 
-- Do you want the hold interface to appear in menu transitions?
Config.CharacterBlur = true 
-- Should the back of the character be blurred?
Config.Slots = 6 -- (max slot = 10)
-- default slot 
Config.Spawn = true 
-- Spawn Menu on existing entries or spawn at last location? true or false
Config.SpawnUsing = "debux-spawn" 
-- debux-spawn, qb-spawn, other
Config.Inventory = "default" 
-- ox_inventory, default, qbv2, quasar, other
Config.Clothing = "illenium-appearance" 
-- "qb-clothing", "illenium-appearance", "fivem-appearance", "crm-appearance", "esx_skin"
Config.QBHouse = true 
-- Is there anything on your qb-house or server that should be triggered when you enter the game?

-- If you mark Clothing, Inventory, SpawnUsing as other, you can enter trigger or export in the functions section.
-- █▀ █▀█ █░░   █▀ █▀▀ ▀█▀ ▀█▀ █ █▄░█ █▀▀
-- ▄█ ▀▀█ █▄▄   ▄█ ██▄ ░█░ ░█░ █ █░▀█ █▄█
Config.Prefix = "char" -- only esx
-- This is a setting for ESX users only, you can choose what the identifier prefix will be, it is not recommended to change it
Config.Identifier = "license" -- steam or license (replacement is not recommended.)
-- It is not recommended to change this in the same way, the safest license is license, you can make choices such as license discord steam, and it will choose the identifier value accordingly.
Config.SkinSql = "skin" -- In which sql is skin data stored? playerskins or skin
-- You can choose where the skin table is located
-- █▀ ▀█▀ ▄▀█ █▀█ ▀█▀ █▀▀ █▀█
-- ▄█ ░█░ █▀█ █▀▄ ░█░ ██▄ █▀▄
Config.DefaultSpawn = vector4(-268.96, -956.02, 30.22, 201.13) 
-- when you create a new character, where does the character spawn?
Config.StarterItemUse = true
-- Should starter items be given to players when they register on the server?
Config.StarterItems = {
    {name = 'phone', count = 1},
    {name = 'bread', count = 3},
    {name = 'water', count = 3},
}
Config.StarterMoneyUse = true
-- Should players be given startup money when registering on the server?
Config.StarterMoney = {
    {account = 'cash', amount = 1000},
    {account = 'bank', amount = 5000},
}
-- █▀▀ ▄▀█ █▀▄▀█ █▀   ▄▀█ █▄░█ █▀▄   █▀█ █░░ ▄▀█ █▄█ █▀▀ █▀█
-- █▄▄ █▀█ █░▀░█ ▄█   █▀█ █░▀█ █▄▀   █▀▀ █▄▄ █▀█ ░█░ ██▄ █▀▄
Config.CoordList = {
    {
        Player = vector4(287.68, -1591.38, 30.53, 7.7),
        -- Where will the player in Multicharacter spawn
        Camera = vector4(287.2, -1590.55, 30.93, 191.4),
        -- From which angle the camera will look at the player
    },
    -- etc.
}
Config.Coord = {
    RandomCoord = false, 
    -- Send players to random coordinates to open the menu?
    SingleCoord = Config.CoordList[1], 
    -- If RandomCoord is false, the menu opens in the selected SingleCoord section
}
-- █▀ █▀▀ █▀▀ █▄░█ ▄▀█ █▀█ █ █▀█     ▄▀█ █▄░█ █ █▀▄▀█
-- ▄█ █▄▄ ██▄ █░▀█ █▀█ █▀▄ █ █▄█     █▀█ █░▀█ █ █░▀░█
Config.ScenarioList = {
    "WORLD_HUMAN_DRUG_DEALER",
    "WORLD_HUMAN_AA_COFFEE",
    "WORLD_HUMAN_GUARD_STAND",
    "WORLD_HUMAN_MUSCLE_FLEX",
    "WORLD_HUMAN_PARTYING",
    "WORLD_HUMAN_TENNIS_PLAYER",
}
-- Animation is triggered when players are in the character menu, resulting in a more elegant look 
-- animations to be listed, more different animations can be added here. (https://github.com/DioneB/gtav-scenarios)
Config.Scenario = {
    ScenarioUse = true, 
    -- character scripts (animations) should be active ? true or false
    RandomScenario = true, 
    -- should character scenarios be randomly selected from ScenarioList?
    SingleScenario = Config.ScenarioList[6]
    -- If random Scenario is false, which scenario should be used?
}
-- █▀▀ █▀▀ █▀▀ █▀▀ █▀▀ ▀█▀ █▀
-- ██▄ █▀░ █▀░ ██▄ █▄▄ ░█░ ▄█
Config.EffectsList = {
    {name = 'proj_indep_firework_v2', child = 'scr_firework_indep_repeat_burst_rwb'},
    {name = 'scr_powerplay', child = 'scr_powerplay_beast_vanish'},
    {name = 'core', child = 'ent_dst_gen_gobstop'},
    {name = 'scr_xs_celebration', child = 'scr_xs_confetti_burst'},
    {name = 'scr_rcbarry2', child = 'scr_clown_bul'},
}
-- Through the effects there is an effect on character transitions and a beautiful image is obtained
-- Effects for character transitions are listed here (https://gist.github.com/alexguirre/af70f0122957f005a5c12bef2618a786)
Config.Effect = {
    EffectUse = true, 
    -- effects appear on character change ? true or false
    RandomEffect = true, 
    -- Do all effects in the EffectsList appear randomly?
    SingleEffect = Config.EffectsList[4] 
    -- If RandomEffect is false, SingleEffect will be used.
}
-- █▀█ █░█ █▀█ ▀█▀ █▀█   █▀▄▀█ █▀█ █▀▄ █▀▀
-- █▀▀ █▀█ █▄█ ░█░ █▄█   █░▀░█ █▄█ █▄▀ ██▄
Config.PhotoModeList = {
    {
        name = "Vagos",
        label = "Vagos",
    },
    {
        name = "SALTONSEA",
        label = "Saltonsea",
    },
 -- etc.
}

--The modes that will be listed in the PhotoMode menu are listed here (https://wiki.rage.mp/index.php?title=Timecycle_Modifiers

server_config.lua

CustomSlot.Identifier = { 
-- In config.lua, you have selected the identifier type in the SQL section, the default is “license”, if you are using “license”, enter the player's license here and determine the total amount of slots he can use.
    {identifier = "license:9fdce43ef48520f5f709dd6fcf6123ecc6310034", slots = 7},
}

CustomSlot.DiscordRoleSlot = {
    DiscordRoleStatus = false, 
    -- If you want to give slots to the player with Discord Perm, make it true!
    roles = { 
    -- roleid and the amount of slots available to players with this role.
        {roleid = "1020804168090390594", slots = 10},
    }
}
CustomSlot.DiscordDetail = { 
-- If DiscordRoleStatus is true, please fill in here!
    bot_token = "",
    guild_id = "",
}

--This is where you can give special slots to designated players, for example, you can provide 7 slots to a designated player when the default number of slots is 3.
--If you wish, you can do this with a role you will give to the player via discord or you can do this with the identifier of the player.

Log.LogDetail = {
    LogStatus = true, -- Do you want to use the logs?
    Webhook = "", -- Enter you webhook adress
}

-- Log system to keep track of players' characters and activities

Functions

shared_functions.lua

getFramework = function()
    if Config.Framework == "esx" then
        return exports['es_extended']:getSharedObject(), "esx"
    elseif Config.Framework == "qb" then
        return exports["qb-core"]:GetCoreObject(), "qb"
    elseif Config.Framework == "auto" then
        if GetResourceState('qb-core') == 'started' then
            return exports["qb-core"]:GetCoreObject(), "qb"
        elseif GetResourceState('es_extended') == 'started' then
            return exports['es_extended']:getSharedObject(), "esx"
        end
    end
end

-- Here you can enter your freamwork if you are using a custom freamwork!

server_functions.lua


OpenSpawn = function(src, cData)
    local src = src
    local cData = cData
    if Config.SpawnUsing == "debux-spawn" then 
        TriggerClientEvent("debux-spawn:OpenSpawn", src)
    elseif Config.SpawnUsing == "qb-spawn" then 
        TriggerClientEvent('qb-spawn:client:setupSpawns', src, cData, false, nil)
        TriggerClientEvent('qb-spawn:client:openUI', src, true)
    else
        -- enter other spawn
    end
end
-- If you are using a custom spawn system, you can add your spawn system here

getSkin = function (identifier, gender)
    local identifier = identifier
    local gender = gender
    local result = nil
    if getFremeworkName().name == "esx" then 
        if Config.SkinSql == "playerskins" then 
            result = MySQL.query.await('SELECT * FROM playerskins WHERE identifier = ?', {identifier})
        else 
            result = MySQL.query.await('SELECT * FROM users WHERE identifier = ?', {identifier})
        end
        local model = nil
        if gender == 0 then 
            model = "mp_m_freemode_01"
        else 
            model = "mp_f_freemode_01"
        end
        if result ~= nil then
            SkinTable = {
                model = model, 
                skin = result[1].skin
            }
            return SkinTable
        end
    else
        if Config.SkinSql == "playerskins" then 
            result = MySQL.query.await('SELECT * FROM playerskins WHERE citizenid = ? AND active = ?', {identifier, 1})
        else 
            result = MySQL.query.await('SELECT * FROM players WHERE citizenid = ? AND active = ?', {identifier, 1})
        end
        if result ~= nil then
            SkinTable = {
                model = result[1].model, 
                skin = result[1].skin
            }
            return SkinTable
        end
    end
end
-- SQL checks of the skin system are done through here

loadHouseData = function(src)
    data = etc.
    TriggerClientEvent("qb-garages:client:houseGarageConfig", src)
    TriggerClientEvent("qb-houses:client:setHouseConfig", src)
end
-- QB House asks for data to be uploaded on login to the server, this place provides it, if you are using qb-house this should work fine!

giveItem = function(src, n, c)
    local src = src
    if Config.Inventory == "default" then
        local xPlayer = getPlayer(src)
        if getFremeworkName().name == "esx" then 
            xPlayer.addInventoryItem(n, c)
        else 
            xPlayer.Functions.AddItem(n,c)
        end
    elseif Config.Inventory == "ox_inventory" then 
        exports.ox_inventory:AddItem(src, n, c)
    elseif Config.Inventory == "quasar" then 
        exports['qs-inventory']:AddItem(src,n,c)
    elseif Config.Inventory == "qbv2" then 
        exports['qb-inventory']:AddItem(src, n, c)
    else    
        -- Other Export
    end
end
-- If you are using a custom inventory, you can easily add it here

client_functions.lua

OpenCharMenu = function()
    if Config.Clothing == "qb-clothing" then 
        TriggerEvent('qb-clothes:client:CreateFirstCharacter')
    elseif Config.Clothing == "crm-appearance" then 
        TriggerEvent("crm-appearance:show-creator-menu")
    elseif Config.Clothing == "esx_skin" then 
        -- TriggerEvent("esx_skin:playerRegistered")
        TriggerEvent('esx_skin:openSaveableMenu')

    elseif Config.Clothing == "illenium-appearance" or Config.Clothing == "fivem-appearance" then 
        if getFremeworkName().name == "esx" then 
            -- TriggerEvent("esx_skin:playerRegistered")
            TriggerEvent('esx_skin:openSaveableMenu')
        else 
            TriggerEvent('qb-clothes:client:CreateFirstCharacter')
        end
    else
        -- other export enter
    end
end
-- After the character is registered, you can customize it with this function which allows you to open the outfit menu

ChangePedSkin = function(cacheped,skinData) 
    if Config.Clothing == 'qb-clothing' then
        TriggerEvent('qb-clothing:client:loadPlayerClothing', skinData, cacheped)
    elseif Config.Clothing == 'illenium-appearance' then
        exports['illenium-appearance']:setPedAppearance(cacheped,skinData)
    elseif Config.Clothing == 'fivem-appearance' then
        exports['fivem-appearance']:setPedAppearance(cacheped, skinData)
    elseif Config.Clothing == 'skinchanger' then
        TriggerEvent('skinchanger:loadSkin', skinData)
    elseif Config.Clothing == "crm-appearance" then 
        exports['crm-appearance']:crm_set_ped_appearance(cacheped, skinData)
    else
        -- other export enter
    end
end
-- You can customize changes to the player's pad here, and if you are using a custom outfit system, you can enter trigger or export here.

SpawnLoad = function(isNew)
    TriggerServerEvent('QBCore:Server:OnPlayerLoaded')
    TriggerEvent('QBCore:Client:OnPlayerLoaded')
    TriggerServerEvent('qb-houses:server:SetInsideMeta', 0, false)
    TriggerServerEvent('qb-apartments:server:SetInsideMeta', 0, 0, false)
    TriggerServerEvent('esx:onPlayerSpawn')
	TriggerEvent('esx:onPlayerSpawn')
	TriggerEvent('playerSpawned')
	if not isNew then
		TriggerEvent('esx:restoreLoadout')
	end
    Wait(500)
end
-- If you want something to happen after the player's character is loaded, you can enter it here.

Last updated