Setup
How to install and configure um-spawn
Framework
Make sure your qbx_core or qb-core version are not old
Installation
Delete other spawn scripts
Delete qb-spawn or qbx_spawn or other-spawn
QBox only
open > qbx_core > config > client.luastartingApartment = trueset false
Multicharacter
Auto Load
This auto loads the event, you don't need to do anything else
qb-multicharacter > server > main.lua
RegisterNetEvent('qb-multicharacter:server:loadUserData', function(cData)
local src = source
if QBCore.Player.Login(src, cData.citizenid) then
repeat
Wait(10)
until hasDonePreloading[src]
print('^2[qb-core]^7 '..GetPlayerName(src)..' (Citizen ID: '..cData.citizenid..') has successfully loaded!')
QBCore.Commands.Refresh(src)
loadHouseData(src) -- if you are using ps-housing: delete this func loadHouseData(src)
TriggerClientEvent('um-spawn:client:startSpawnUI', src)
TriggerEvent("qb-log:server:CreateLog", "joinleave", "Loaded", "green", "**".. GetPlayerName(src) .. "** (<@"..(QBCore.Functions.GetIdentifier(src, 'discord'):gsub("discord:", "") or "unknown").."> | ||" ..(QBCore.Functions.GetIdentifier(src, 'ip') or 'undefined') .. "|| | " ..(QBCore.Functions.GetIdentifier(src, 'license') or 'undefined') .." | " ..cData.citizenid.." | "..src..") loaded..")
end
end)qb-multicharacter > server > main.lua
RegisterNetEvent('qb-multicharacter:server:createCharacter', function(data)
local src = source
local newData = {}
newData.cid = data.cid
newData.charinfo = data
if QBCore.Player.Login(src, false, newData) then
repeat
Wait(10)
until hasDonePreloading[src]
if GetResourceState('qb-apartments') == 'started' and Apartments.Starting then
print('^2[qb-core]^7 '..GetPlayerName(src)..' has successfully loaded!')
QBCore.Commands.Refresh(src)
loadHouseData(src) -- if you are using ps-housing: delete this func loadHouseData(src)
TriggerClientEvent("qb-multicharacter:client:closeNUI", src)
TriggerClientEvent('um-spawn:client:startSpawnUI', src)
GiveStarterItems(src)
else
print('^2[qb-core]^7 '..GetPlayerName(src)..' has successfully loaded!')
QBCore.Commands.Refresh(src)
loadHouseData(src) -- if you are using ps-housing: delete this func loadHouseData(src)
TriggerClientEvent("qb-multicharacter:client:closeNUIdefault", src)
GiveStarterItems(src)
end
end
end)Event name: TriggerEvent('um-spawn:client:startSpawnUI')
Convar (Starter Apartment)
Apartment Start
If you want apartment inside start for new users, make these "true"
Add this to your server.cfg:
# um config
setr um:NewPlayerApartmentInsideStart "true"Any apartment script
The apartment names and types of your apartment script must match the apartments in um-spawn.
If it is not default, edit and match apartments:
um-spawn > bridge > apartments > list > .lua
Server.cfg
Load Order
um-spawn should always ensure after things like apartments and houses scripts.
# um config
setr um:NewPlayerApartmentInsideStart "true"
---------------
ensure oxmysql
ensure ox_lib
--------------
ensure qb-core
ensure [qb]
ensure [standalone]
--------------
ensure um-spawnYou have completed the installation
Framework
Make sure your es_extended version are not old
Installation
Firstly
Import spawnbookmarks.sql
Multicharacter
This auto loads the event, you don't need to do anything else
esx-multicharacter > client > main.lua > esx:playerLoaded
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(playerData, isNew, skin)
local spawn = playerData.coords or Config.Spawn
if isNew or not skin or #skin == 1 then
local finished = false
skin = Config.Default[playerData.sex]
skin.sex = playerData.sex == "m" and 0 or 1
local model = skin.sex == 0 and mp_m_freemode_01 or mp_f_freemode_01
RequestModel(model)
while not HasModelLoaded(model) do
RequestModel(model)
Wait(0)
end
SetPlayerModel(PlayerId(), model)
SetModelAsNoLongerNeeded(model)
TriggerEvent('skinchanger:loadSkin', skin, function()
local playerPed = PlayerPedId()
SetPedAoBlobRendering(playerPed, true)
ResetEntityAlpha(playerPed)
TriggerEvent('esx_skin:openSaveableMenu', function()
finished = true
end, function()
finished = true
end)
end)
repeat Wait(200) until finished
end
DoScreenFadeOut(750)
Wait(750)
SetCamActive(cam, false)
RenderScriptCams(false, false, 0, true, true)
cam = nil
local playerPed = PlayerPedId()
FreezeEntityPosition(playerPed, true)
if not isNew then TriggerEvent('skinchanger:loadSkin', skin or Characters[spawned].skin) end
exports['um-spawn']:UMSpawnStart(spawn)
repeat Wait(200) until not IsScreenFadedOut()
TriggerServerEvent('esx:onPlayerSpawn')
TriggerEvent('esx:onPlayerSpawn')
TriggerEvent('playerSpawned')
TriggerEvent('esx:restoreLoadout')
Characters, hidePlayers = {}, false
end)Export: exports['um-spawn']:UMSpawnStart(lastcoords)
Config (Important ones)
Adjust it according to your own preferences:
um = {}
um.debug = false
um.lang = 'en' -- tr,en,es,zh,fr,hi [or add locales > .lua]
um.main = {
camera = {
radius = 2.0, -- Camera distance from the character
angle = 50, -- Camera angle
point = 0.1, -- Camera point
turning = true, -- If you want to turn the camera, set it to true.
},
ped = {
status = true, -- If you want to show the character in the spawn menu, set it to true.
opacity = false, -- Todo: next update
},
property = {
houseStatus = false, -- If you want to show the house system, set it to true.
},
bookmark = {
status = true, -- If you want to show the bookmark system, set it to true.
money = {
free = false, -- If you want to bookmark the free money, set it to true.
amount = math.random(1000, 10000) or 500
}
},
map = true, -- If you want to show other locations [paleto etc], set it to true.
}
um.weather = {
sync = true, -- If you want to custom weather, set it to false.
sc = 'cd', -- cd , vSync
type = 'XMAS', -- https://docs.fivem.net/docs/game-references/weather-types/
time = 23, -- 0 - 23
}You have completed the installation
Export
Access or open the spawn menu:
exports['um-spawn']:UMSpawnStart(coords)Server.cfg
ensure oxmysql
ensure ox_lib
--------------
ensure es_extended
ensure [core]
ensure [standalone]
--------------
ensure um-spawn