onex-creation can run in standalone mode without QBCore or ESX, using its own database system for appearance storage.
Standalone mode:
server.cfgensure ox_lib ensure onex-base ensure onex-interaction ensure onex-creation
In standalone mode, players are identified by their license:
Standalone Mode-- Get player identifier local function GetPlayerIdentifier(source) for _, id in ipairs(GetPlayerIdentifiers(source)) do if string.match(id, 'license:') then return id end end return nil end
Without a framework's character system, trigger creation manually:
Your Script - ServerAddEventHandler('playerConnecting', function(name, setKickReason, deferrals) local source = source local identifier = GetPlayerIdentifier(source, 0) -- Check if player has appearance local result = MySQL.query.await('SELECT appearance FROM onex_player_appearance WHERE identifier = ?', {identifier}) if not result or #result == 0 then -- Flag as new player TriggerClientEvent('onex:newPlayer', source) end end)
Your Script - ClientRegisterNetEvent('onex:newPlayer') AddEventHandler('onex:newPlayer', function() -- Open character creation exports['onex-creation']:openCreationMenu('newchar', function(appearance) print('Character created!') end) end)
Your Script - Client-- Load appearance on spawn AddEventHandler('playerSpawned', function() -- Fetch and apply saved appearance local appearance = exports['onex-creation']:FetchCurretPlayerClothesFromDB() if appearance then exports['onex-creation']:LoadPedSkin(appearance) end end)
Enable utility commands for standalone:
config/main.luaConfig.UitilityCommands = { admin_creation = { active = true, command = 'acreation' }, Refreshskin = { active = true, command = 'refreshskin' } }
For admin commands without ACE permissions:
Your Script - ServerRegisterCommand('acreation', function(source, args, rawCommand) local identifier = GetPlayerIdentifier(source, 0) -- Your admin check if IsPlayerAdmin(identifier) then TriggerClientEvent('onex-creation:client:openCreationMenu', source, 'admin') end end, false)
Without a framework job system, implement your own:
config/shop.luaShop.JobOutfits = { ["police"] = { label = "Police", outfits = { { label = "Patrol Uniform", minGrade = 0, outfit = { ... } } } } }
integrations/custom_framework/server.lua-- Implement job check CustomFx.Server.GetJob = function(source) local identifier = GetPlayerIdentifier(source, 0) -- Your job lookup logic local result = MySQL.query.await('SELECT job, grade FROM player_jobs WHERE identifier = ?', {identifier}) if result and result[1] then return { name = result[1].job, grade = result[1].grade } end return { name = 'unemployed', grade = 0 } end
Configure standalone notifications:
modules/framework/shared/framework.luaFramework.Notify = { name = 'onex-interaction' -- Uses onex-interaction }
Or use ox_lib notifications:
Your Scriptlib.notify({ title = 'Clothing', description = 'Outfit saved!', type = 'success' })
Complete standalone integration:
Your Standalone Script-- server.lua local function GetIdentifier(source) for _, id in ipairs(GetPlayerIdentifiers(source)) do if string.match(id, 'license:') then return id end end end RegisterNetEvent('standalone:playerLoaded') AddEventHandler('standalone:playerLoaded', function() local source = source local identifier = GetIdentifier(source) -- Load appearance local result = MySQL.query.await( 'SELECT appearance FROM onex_player_appearance WHERE identifier = ?', {identifier} ) if result and result[1] then TriggerClientEvent('onex-creation:client:loadPedSkin', source, json.decode(result[1].appearance)) else -- New player - create character TriggerClientEvent('onex-creation:client:CreateNewChar', source) end end)
client.lua-- Trigger on spawn CreateThread(function() while true do Wait(0) if NetworkIsPlayerActive(PlayerId()) then TriggerServerEvent('standalone:playerLoaded') break end end end)
everythingFree = true in pricing configLast updated 27 days ago