๐ฟInstallation
Discover how to install your script.
โข STEP 1: DEPENDENCIES
Make sure you have this resources installed in your server!
esx or qbcore (if you have different core name, you must change that in the config file).
If you have Starting Appartment set to 'true' in the Multicharacter and Identity config you need to have qb-spawn installed.
โข STEP 2: START ORDER
ensure zr-locations
โข STEP 3: DATABASE
This script doesn't require any database installation.
โข STEP 4: EVENT NAME
TriggerClientEvent('zr-locations:start', source)
Examples:
1. If you have qb-multicharacter you must do the following changes:
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 succesfully loaded!')
QBCore.Commands.Refresh(src)
loadHouseData(src)
--TriggerClientEvent('apartments:client:setupSpawnUI', src, cData)
TriggerClientEvent('zr-locations:start', 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)
2. If you have esx_multicharacter you must do the following changes:
RegisterNetEvent('esx_multicharacter:CharacterChosen', function(charid, isNew)
if type(charid) == 'number' and string.len(charid) <= 2 and type(isNew) == 'boolean' then
if isNew then
awaitingRegistration[source] = charid
else
TriggerEvent('esx:onPlayerJoined', source, PREFIX..charid)
ESX.Players[GetIdentifier(source)] = true
TriggerClientEvent('zr-locations:start', source)
end
end
end)
Last updated