Customize Configuration File
This file contains the necessary configurations for the character creation and management system. Below is an explanation of what each parameter does.
UIColor
Defines the interface colors. (Hex color codes such as #FF4F79 or #FBCA79 can be used)
UIColor = '#FBCA79', -- Interface color
UIDisplay
Determines which elements will be displayed in the interface.
UIDisplay = {
BuySlot = true, -- Displays the character slot purchase button
DeleteCharacter = true, -- Displays the character deletion button
},
MaxCharacterSlot
Determines the total number of character slots a player can have.
MaxCharacterSlot = 6, -- Maximum number of character slots
DefaultCharSlot
Determines how many character slots a player will have initially.
DefaultCharSlot = 3, -- Default number of character slots
CustomUIFunction
Defines custom interface logic. For example, a special interface can be displayed when the camera is active.
CustomUIFunction = function(get) -- (get: true / false) true: camera active
-- Custom ui logic goes here
-- For example, an export can be used for hud display
end,
SkipSelection
Allows the player to skip the spawn selection and respawn at the last location.
SkipSelection = false, -- Skip spawn selection and respawn at the last location
SpawnFunction
Defines custom spawn logic. This function only runs on the client side.
SpawnFunction = function(data) -- (client-side only)
-- Custom spawn logic goes here
TriggerEvent('qb-spawn:client:setupSpawns', data.citizenid)
TriggerEvent('qb-spawn:client:openUI', true)
end,
DefaultSpawn
Sets the default spawn location in vec4
format (x, y, z, heading).
DefaultSpawn = vec4(-540.58, -212.02, 37.65, 208.88), -- Default spawn location
SetSkin
Sets the character’s skin. This function only runs on the client side.
SetSkin = function(skin, ped) -- (client-side only)
UZCustomize.Apparance.SetSkin(skin, ped) -- Skin setup logic
end,
SkinSql
Retrieves the character’s skin from the database. This function only runs on the server side.
SkinSql = function(data) -- (server-side only)
return MySQL.single.await('SELECT * FROM playerskins WHERE citizenid = ? AND active = 1', {data.citizenid})
end,
FirstCharacterSkinMenu
Opens the skin menu when creating the first character. This function only runs on the client side.
FirstCharacterSkinMenu = function(skin, ped) -- (client-side only)
TriggerEvent((UZCustomize.Framework == "ESX") and 'esx_skin:openSaveableMenu' or 'qb-clothes:client:CreateFirstCharacter')
end,
SetHousingSpawnUI
SetHousingSpawnUI = function(data) -- (client side only)
UZFramework.Apartment.setupSpawnUI(data) -- TriggerEvent('apartments:client:setupSpawnUI', data)
end,
StarterItems
Defines the starter items given when a new character is created.
StarterItems = { -- Character starter items
{ name = 'phone', amount = 1 }, -- Phone
{ name = 'id_card', amount = 1}, -- ID card
{ name = 'driver_license', amount = 1}, -- Driver's license
},
Command
Defines custom commands, such as admin commands
Command = {
['logout'] = {
Permission = 'admin', -- Required permission
Command = 'logout', -- Command
Text = 'Logout (Admin Only)', -- Command text
Description = {} -- Description
},
['setchar'] = {
Permission = 'admin', -- Required permission
Command = 'setchar', -- Command
Text = 'Set Character Slots', -- Command text
Description = {
{name='Owner', help='CitizenID or License'}, -- Description
{name='Slot', help='New Max Slot'} -- Description
}
}
},
CharacterOffsets
Determines how characters will be positioned on the screen. Different offsets can be defined for each character slot.
CharacterOffsets = {
[1] = { -- Offsets for 1 character slot
{x = 0.11, y = -0.6, z = -1.4, h = 170.0}
},
[2] = { -- Offsets for 2 character slots
{x = -0.21, y = -0.5, z = -1.5, h = 190.15}, -- Left
{x = 0.59, y = -0.5, z = -1.5, h = 140.15} -- Right
},
-- Other character slot offsets...
},
GiveStarterItems
Grants starter items when a new character is created.
function GiveStarterItems(source)
local src = source
for _, v in pairs(Customize.StarterItems) do
local info = {}
if GetResourceState('qbx_core'):find('start') then
if v.name == "id_card" then
info = exports.qbx_idcard:GetMetaLicense(src, {'id_card'})
elseif v.name == "driver_license" then
info = exports.qbx_idcard:GetMetaLicense(src, {'driver_license'})
end
elseif GetResourceState('qb-core'):find('start') then
local Player = Framework.Functions.GetPlayer(src)
if v.name == "id_card" then
info = {
citizenid = Player.PlayerData.citizenid,
firstname = Player.PlayerData.charinfo.firstname,
lastname = Player.PlayerData.charinfo.lastname,
birthdate = Player.PlayerData.charinfo.birthdate,
gender = Player.PlayerData.charinfo.gender,
nationality = Player.PlayerData.charinfo.nationality
}
elseif v.name == "driver_license" then
info = {
firstname = Player.PlayerData.charinfo.firstname,
lastname = Player.PlayerData.charinfo.lastname,
birthdate = Player.PlayerData.charinfo.birthdate,
type = "Class C Driver License"
}
end
end
UZFramework.AddItem(Player or nil, v.name, v.amount, info, src) -- add item
end
end
QBXConfig
Loads the configuration file for QBCore or similar framework.
QBXConfig = function(appaYeet)
local configData = LoadResourceFile('qbx_core', 'config/client.lua')
local configFunc = load(configData)
return configFunc()
end
Visually Unique & Functional FiveM Scripts
Experience the perfect blend of premium quality, innovation, and excellence with our FiveM scripts. Designed to elevate your gameplay, we bring you a truly unique experience that stands out. At UZ Scripts, we’re not just about looking good – we’re about making your server function seamlessly and run at its best. Dive into the future of FiveM with us!