Apartments

Configure starting apartment selection for new characters.

๐Ÿ  Overview

When Config.ApartmentStart = true, new characters will see an apartment selection screen before spawning. This integrates with apartment/housing systems.


โš™๏ธ Enable Apartments

In config/config.lua:

Config.ApartmentStart = true  -- Enable apartment selection for new characters

๐Ÿ“ Configuration File

Apartments are configured in:

config/apartments.lua

๐Ÿ—๏ธ Apartment Structure

local Apartments = {}

Apartments.List = {
    ['qb-core'] = {
        {
            id = 'apartment_1',
            label = 'South Rockford Drive',
            img = 'integrity-way',
            icon = 'fa-solid fa-building',
            coords = vec4(-667.02, -1105.01, 14.63, 242.32),
        },
        -- More apartments...
    },
    ['es_extended'] = {
        -- ESX apartments...
    },
    ['qbx_core'] = {
        -- QBox apartments...
    },
}

-- Function called when player selects an apartment
Apartments.SpawnCreateCharacter = function(apartmentType)
    -- Integration with your apartment/housing script
end

return Apartments

โš™๏ธ Apartment Properties

Property
Type
Description

id

string

Unique identifier for the apartment

label

string

Display name

img

string

Image filename (in web/build/imgs/)

icon

string

FontAwesome icon class

coords

vec4

Spawn coordinates (x, y, z, heading)


๐ŸŽฎ Framework-Specific Configuration

QBCore

ESX


๐Ÿ”ง Spawn Function

The SpawnCreateCharacter function is called when a player selects their apartment:


๐Ÿ–ผ๏ธ Adding Apartment Images

  1. Take a screenshot of the apartment exterior

  2. Save as PNG in web/build/imgs/

  3. Reference the filename (without extension) in config


๐Ÿ“‹ Complete Example


โ“ Troubleshooting

Apartment Selection Not Showing

  1. Ensure Config.ApartmentStart = true

  2. Check that apartments are configured for your framework

Apartment Not Assigned

  1. Check integration with your housing script

  2. Verify SpawnCreateCharacter function

  3. Check server console for errors

Last updated