Skip to main content

🏨 Replacing apartments

danger

Please remove or stop qb apartments completely

Step 1​

Set ReplaceApartment = true on your jl-motel/shared/config.lua

Step 2​

Go to qb-multicharacter and find this

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 Apartments.Starting then
local randbucket = (GetPlayerPed(src) .. math.random(1,999))
SetPlayerRoutingBucket(src, randbucket)
print('^2[qb-core]^7 '..GetPlayerName(src)..' has succesfully 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 succesfully loaded!')
QBCore.Commands.Refresh(src)
loadHouseData(src)
TriggerClientEvent("qb-multicharacter:client:closeNUIdefault", src)
GiveStarterItems(src)
end
end
end)

Replace it with

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]
local randbucket = (GetPlayerPed(src) .. math.random(1, 999))
SetPlayerRoutingBucket(src, randbucket)
print('^2[qb-core]^7 ' .. GetPlayerName(src) .. ' has succesfully loaded!')
QBCore.Commands.Refresh(src)
loadHouseData(src)
TriggerClientEvent("qb-multicharacter:client:closeNUI", src)
TriggerClientEvent('apartments:client:setupSpawnUI', src, newData, true)
GiveStarterItems(src)
end
end)

Step 3​

Don't forget to remove '@qb-apartments/config.lua' from qb-multicharacter/fxmanifest.lua

Step 4​

Go to qb-spawn/client.lua and Search

TriggerServerEvent("apartments:server:CreateApartment", appaYeet, Apartments.Locations[appaYeet].label)

And Replace with

TriggerEvent('jl-motel:client:startMotel', appaYeet)