-----------------For support, scripts, and more---------------- --------------- https://discord.gg/wasabiscripts ------------- --------------------------------------------------------------- local REQUIRED_MODULES = { 'bridge', 'config' } Modules.waitFor(REQUIRED_MODULES) local config = Modules.require('config') local bridge = Modules.require('bridge') local housing = {} function housing.getApartmentSpawns() if not bridge.apartments or not bridge.apartments.Locations then return nil end -- If no apartments for qb-apartments, return nil local spawns = {} for _, apt in pairs(bridge.apartments.Locations) do local enter = apt.coords.enter local cam = apt.coords.cam local streetHash = GetStreetNameAtCoord(enter.x, enter.y, enter.z) local streetName = GetStreetNameFromHashKey(streetHash) if not streetName or streetName == '' then streetName = 'Los Santos' end spawns[#spawns + 1] = { id = apt.name, title = apt.label, description = locale('apartment_description', apt.label, streetName), coords = enter, cameraCoords = cam, } end return #spawns > 0 and spawns or nil end function housing.createApartment(type, label) TriggerServerEvent('apartments:server:CreateApartment', type, label, true) end function housing.getPlayerHouses() return lib.callback.await('wasabi_spawn:getPlayerHouses', false) end Modules.register('housing', housing, {dependencies = {'bridge', 'config'}})