TriggerClientEvent("debux-spawn:OpenSpawn", source)
TriggerEvent("debux-spawn:OpenSpawn")
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 Config.SkipSelection then
local coords = json.decode(cData.position)
TriggerClientEvent('qb-multicharacter:client:spawnLastLocation', src, coords, cData)
else
TriggerClientEvent("debux-spawn:OpenSpawn", src)
end
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)
TriggerServerEvent('esx:onPlayerSpawn')
TriggerEvent('esx:onPlayerSpawn')
TriggerEvent('playerSpawned')
TriggerEvent('esx:restoreLoadout')
TriggerEvent("xox-spawn:OpenSpawn")
Characters, hidePlayers = {}, false