Commands & Exports

This section lists all available commands, exports, and events included in the script. You’ll find client-side, server-side, and shared functions designed to help developers integrate, extend, or interact with the system easily within their own scripts or frameworks.


Commands

This section lists all available commands included in the script. Each command is designed to simplify administration, player interaction, or debugging tasks. You’ll find detailed descriptions, usage examples, and permission requirements to help you manage and customize your server efficiently.

Command
Description

/ApartmentLocation

Defines interaction points inside the van, such as stash, wardrobe, or charger.

/ApartmentDecoration

Command or configuration for customizing the van's appearance or decorations.

/Apartment

Select your first apartment.


Client Exports

This section provides all available client exports for the script. These functions allow you to interact directly with the system from the client side, enabling custom features, UI interactions, and integrations with other resources. Each export includes a short description and usage example for easy implementation.

inDecorate

The inDecorate export allows you to check if a player is currently in decoration mode. This is useful for managing or restricting specific actions while decoration mode is active.


How to Use

To check whether the player is in decoration mode, use the following code:

local inDecorate = exports['qs-housing']:inDecorate()
print("Is the player in decoration mode? " .. tostring(inDecorate))

This will return a boolean value (true or false) indicating whether the player is in decoration mode. You can then use this information to implement custom logic, such as blocking certain actions or triggering events during decoration.

inApartment

The InApartment export allows you to check if a player is currently inside an apartment. This is useful for managing or restricting specific actions while the player is inside their apartment.


How to Use

To check whether the player is inside an apartment, use the following code:

local inApartment = exports['qs-housing']:InApartment()
print("Is the player inside an apartment? " .. tostring(inApartment))

This will return a boolean value (true or false) indicating whether the player is currently inside an apartment. You can then use this information to implement custom logic, such as restricting jobs, disabling certain actions, or triggering events only when the player is in their apartment.

GetApartments

The GetApartments export allows you to retrieve the full list of configured apartments programmatically. This can be useful for displaying available apartments, handling property data, or integrating with other systems.


How to Use

To get the list of all apartments, use the following code:

local apartments = exports['qs-apartments']:GetApartments()
if apartments then
    print("Apartments retrieved successfully!")
    for name, data in pairs(apartments) do
        print("Apartment Name: " .. name)
        print("Location: " .. data.label)
        print("Price: $" .. data.price)
    end
else
    print("No apartments found.")
end

Explanation

  • exports['qs-apartments']:GetApartments() → Returns the Apartments table containing all configured apartments.

  • If apartments exist, it loops through them to print name, location, and price.

  • If no apartments are found, it returns nil.

This function is ideal for custom menus, listings, or integration with other scripts to manage housing dynamically.