OrigenNetwork
Docs

Custom · origen_titlemenu

The custom/ folder handles framework integration, skin application, spawn logic and logs without touching the core. All files are escrow_ignore — they survive updates.

text
custom/
├── client/
│   └── client.lua          — notifications, skin application, character creation, post-spawn hook
└── server/
    ├── function.lua        — last position query, ESX character creation query
    ├── server.lua          — starter items, slot commands, phone number helpers
    └── logs.lua            — Discord webhook logging

custom/client/client.lua

ShowNotification(msg)

Show a notification to the local player. Dispatches to Config.Framework.

lua
function ShowNotification(msg)
    -- 'qbcore' → TriggerEvent('QBCore:Notify', msg)
    -- 'esx'    → ESX.ShowNotification(msg)
end

CreatePlayer()

Called when a new character needs to open the appearance creator. Dispatches to Config.Framework:

  • qbcore → opens qb-clothing
  • esx → opens esx_skin:openSaveableMenu

Swap this function to use a different clothing system.


SetSkin(ped, skin)

Apply a skin/appearance to a ped. Dispatches to Config.ClothSystem:

ValueApplies via
qb-clothingqb-clothing:client:loadPlayerClothing
fivem-appearanceexports['fivem-appearance']:setPedAppearance
illenium-appearanceexports['illenium-appearance']:setPedAppearance
codem-appearanceqb-clothing:client:loadPlayerClothing
skinchangerApplySkinSkinChanger(ped, skin) — full GTA native face/body blending
rcore_clothingexports.rcore_clothing:setPedSkin (ESX)

ShutDownLoadingScreenCustom()

Called when the loading screen should be dismissed. Override to add custom transition logic.

lua
function ShutDownLoadingScreenCustom()
    ShutdownLoadingScreen()
    ShutdownLoadingScreenNui()
end

PostSpawnPlayer()

Fired after the player has fully spawned into the world. Add any post-spawn logic here (e.g. trigger events for other resources).

lua
function PostSpawnPlayer()
    -- TriggerEvent('myresource:onPlayerSpawned')
end

custom/server/function.lua

Custom.GetLastPosition(cid)table | nil

Queries the framework's player table to get the last saved position for a character. Returns a decoded position table or nil.

lua
-- qbcore → SELECT position FROM players WHERE citizenid = ?
-- esx    → SELECT position FROM users WHERE identifier = ?

Custom.QueryCreatePlayer(src, data, id)

Insert a new ESX character into the users table. Only runs on Config.Framework == 'esx'. Handles firstname, lastname, birthdate, sex, nationality, skin, and starting accounts.


custom/server/server.lua

GiveStarterItems(source)

Give the items from Config.StarterItems to a player on first character creation (ESX only). Auto-fills metadata for id_card and driver_license.

GetCharInfoPhone(id)string | nil

Fetch a player's phone number from the users table. Handles both qs-smartphone charinfo format and a direct phone_number column.


custom/server/logs.lua

SendDiscordLog(webhook, message)

Send a Discord embed log to the given webhook. Called automatically for /logout and /giveslot commands when enabled in Logs.Enabled.

lua
function SendDiscordLog(webhook, message)
    PerformHttpRequest(webhook, ..., json.encode({
        username = "Title Menu Logs",
        embeds   = {{ title = "origen_titlemenu", description = message, ... }}
    }), { ['Content-Type'] = 'application/json' })
end