For the complete documentation index, see llms.txt. This page is also available as Markdown.

Housing

ak47_multicharacter supports qb-houses, qb-apartments, ak47_housing, and snipe-motel natively. If you are using a completely custom housing or motel script, you can easily integrate it by editing the custom/client.lua and custom/server.lua files.

Client-Side Overrides (custom/client.lua)

Modify these functions to trigger your custom housing events.

1. Initial Spawn (Apartments/Motels)

Handles spawning a player inside their starting apartment upon creating a new character or logging in.

function Custom_SpawnInsideApartment()
    -- Example for custom motel:
    -- exports["my_custom_motel"]:SpawnInsideApartment()
end

2. Creating an Apartment

Triggered when a player finishes character creation and chooses an apartment.

function Custom_CreateApartment(appType, label)
    -- Example:
    -- TriggerServerEvent("my_apartments:server:CreateApartment", appType, label)
end

3. Last Location Spawning

If a player logged out inside a property, these functions ensure they spawn back inside.

4. Entering Owned Houses (Spawn Menu)

Triggered when a player selects one of their properties from the "My Houses" tab in the UI.

Server-Side Overrides (custom/server.lua)

1. Loading House Configurations

This function should fetch all available house coordinates and send them to the client to populate the map/UI.

2. Fetching Owned Houses for the UI

This function queries the database to populate the "My Houses" tab in the spawn selector. It must return a table containing the house ID and the display label.

Last updated