> qb-interior/client/optional.lua
exports('CreateHousing', function(spawn)
local objects = {}
local POIOffsets = {}
POIOffsets.exit = json.decode('{ x = -0.290773, y = -0.424591, z = 1.050034, h = 9.268223}')
DoScreenFadeOut(500)
while not IsScreenFadedOut() do Wait(10) end
RequestModel(`ate_housing_1`)
while not HasModelLoaded(`ate_housing_1`) do Wait(1000) end
local house = CreateObject(`ate_housing_1`, spawn.x, spawn.y, spawn.z, false, false, false)
FreezeEntityPosition(house, true)
objects[#objects + 1] = house
TeleportToInterior(spawn.x + POIOffsets.exit.x, spawn.y + POIOffsets.exit.y, spawn.z + POIOffsets.exit.z, POIOffsets.exit.h)
return { objects, POIOffsets }
end)