Skip to main content

QB Multicharacter

If you want to use the starter apartment you can follow this insctruction

  • remove resource qb-apartments
  • delete '@qb-apartments/config.lua' in qb-multicharacter/fxmanifest.lua

Replace these event​

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
local randbucket = (GetPlayerPed(src) .. math.random(1,999))
SetPlayerRoutingBucket(src, randbucket)
print('^2[qb-core]^7 '..GetPlayerName(src)..' has successfully loaded!')
QBCore.Commands.Refresh(src)
loadHouseData(src)
TriggerClientEvent("qb-multicharacter:client:closeNUI", src)
TriggerClientEvent('apartments:client:setupSpawnUI', src, newData)
GiveStarterItems(src)
else
print('^2[qb-core]^7 '..GetPlayerName(src)..' has successfully loaded!')
QBCore.Commands.Refresh(src)
loadHouseData(src)
local player = QBCore.Functions.GetPlayer(src)
newData.citizenid = player.PlayerData.citizenid
Wait(100)
TriggerClientEvent('Housing:client:SetupSpawnUI', src, newData)
TriggerClientEvent("qb-multicharacter:client:closeNUI", src)
GiveStarterItems(src)
end
end
end)

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
if GetResourceState('qb-apartments') == 'started' then
TriggerClientEvent('apartments:client:setupSpawnUI', src, cData)
else
TriggerClientEvent('Housing:client:SetupSpawnUI', src, cData)
end
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)

Use this as starter apartment all of this same like qb-apartment locations​

Fantastic Plaza

INSERT INTO `house` (`identifier`, `name`, `price`, `type`, `payment`, `furniture`, `data`, `locked`, `mortgage`, `complex`, `area`, `configuration`, `permission`, `doors`, `entry`, `storages`, `wardrobes`, `cctv`, `realestate`, `created_at`) VALUES ('82734', 'Fantastic Plaza', 1000, 'shell', 'Sale', NULL, '{"placement":{"x":291.35,"y":-1078.63,"z":9.39999999999999,"w":-5.0},"downpayment":0,"starter":true,"garage":[],"interior":"modernhotel_shell"}', 0, '[]', 'Apartment', '[]', '{"storage":4,"keys":5,"rename":false,"wardrobes":3,"rentable":false,"cctv":false,"garage":false,"disableBuy":false,"area":false}', '{"doorlock":false,"sell":true,"transfer":true,"moveGarage":true}', NULL, '{"x":291.35,"y":-1078.63,"z":29.4,"w":86.28}', '[]', NULL, NULL, NULL, '2024-06-30 12:24:18');

Integrity Way

INSERT INTO `house` (`identifier`, `name`, `price`, `type`, `payment`, `furniture`, `data`, `locked`, `mortgage`, `complex`, `area`, `configuration`, `permission`, `doors`, `entry`, `storages`, `wardrobes`, `cctv`, `realestate`, `created_at`) VALUES ('31364', 'Integrity Way', 1000, 'shell', 'Sale', NULL, '{"placement":{"x":269.69,"y":-640.8,"z":24.02,"w":0.0},"downpayment":0,"starter":true,"garage":[],"interior":"modernhotel_shell"}', 0, '[]', 'Apartment', '[]', '{"storage":4,"keys":5,"rename":false,"wardrobes":3,"rentable":false,"cctv":false,"garage":false,"disableBuy":false,"area":false}', '{"doorlock":false,"sell":true,"transfer":true,"moveGarage":true}', NULL, '{"x":269.69,"y":-640.8,"z":42.02,"w":247.84}', '[]', NULL, NULL, NULL, '2024-06-30 12:22:46');

Morningwood Blvd

INSERT INTO `house` (`identifier`, `name`, `price`, `type`, `payment`, `furniture`, `data`, `locked`, `mortgage`, `complex`, `area`, `configuration`, `permission`, `doors`, `entry`, `storages`, `wardrobes`, `cctv`, `realestate`, `created_at`) VALUES ('50374', 'Morningwood Blvd', 1000, 'shell', 'Sale', NULL, '{"placement":{"x":-1288.52,"y":-430.45,"z":15.14999999999999,"w":-5.0},"downpayment":0,"starter":true,"garage":[],"interior":"modernhotel_shell"}', 0, '[]', 'Apartment', '[]', '{"storage":4,"keys":5,"rename":false,"wardrobes":3,"rentable":false,"cctv":false,"garage":false,"disableBuy":false,"area":false}', '{"doorlock":false,"sell":true,"transfer":true,"moveGarage":true}', NULL, '{"x":-1288.52,"y":-430.45,"z":35.15,"w":122.83}', '[]', NULL, NULL, NULL, '2024-06-30 12:21:41');

South Rockford Drive

INSERT INTO `house` (`identifier`, `name`, `price`, `type`, `payment`, `furniture`, `data`, `locked`, `mortgage`, `complex`, `area`, `configuration`, `permission`, `doors`, `entry`, `storages`, `wardrobes`, `cctv`, `realestate`, `created_at`) VALUES ('39729', 'South Rockford Drive', 1000, 'shell', 'Sale', NULL, '{"placement":{"x":-667.03,"y":-1105.28,"z":-5.36999999999999,"w":-5.0},"downpayment":0,"starter":true,"garage":[],"interior":"modernhotel_shell"}', 0, '[]', 'Apartment', '[]', '{"keys":5,"cctv":false,"disableBuy":false,"garage":false,"rentable":false,"storage":4,"wardrobes":3,"area":false,"rename":false}', '{"doorlock":false,"transfer":true,"moveGarage":true,"sell":true}', NULL, '{"x":-667.03,"w":239.55,"z":14.63,"y":-1105.28}', '[]', NULL, NULL, NULL, '2024-06-30 12:19:48');

Tinsel Towers

INSERT INTO `house` (`identifier`, `name`, `price`, `type`, `payment`, `furniture`, `data`, `locked`, `mortgage`, `complex`, `area`, `configuration`, `permission`, `doors`, `entry`, `storages`, `wardrobes`, `cctv`, `realestate`, `created_at`) VALUES ('19585', 'Tinsel Towers', 1000, 'shell', 'Sale', NULL, '{"placement":{"x":-619.22,"y":37.85,"z":23.6,"w":-5.0},"downpayment":0,"starter":true,"garage":[],"interior":"modernhotel_shell"}', 1, '[]', 'Apartment', '[]', '{"wardrobes":3,"garage":false,"storage":0,"rentable":false,"rename":false,"cctv":false,"keys":5,"area":false,"disableBuy":false}', '{"doorlock":false,"sell":true,"transfer":true,"moveGarage":true}', NULL, '{"x":-619.22,"y":37.85,"z":43.6,"w":6.26}', '[]', NULL, NULL, NULL, '2024-06-30 12:23:37');