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
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
Take a screenshot of the apartment exterior
Save as PNG in
web/build/imgs/Reference the filename (without extension) in config
๐ Complete Example
โ Troubleshooting
Apartment Selection Not Showing
Ensure
Config.ApartmentStart = trueCheck that apartments are configured for your framework
Apartment Not Assigned
Check integration with your housing script
Verify
SpawnCreateCharacterfunctionCheck server console for errors
Last updated