How to use Starter Apartments
1. Prepare the Property
Enter the server, go to the /housing admin menu and create a Building. Then:
Save the property
Go to your database and find the
idof the new property in thehousestableCopy that ID and paste it into the
Objectfield in the config below
2. Configure Starter Apartments
Go to the config.lua file and find this code:
Config.StarterApartments = {
Object = 114, -- You need to have a property building created and here is to find the id of this building from the database.
Name = 'Starting Apartment #%s', -- Name of the starter apartment, which will be displayed in the menu.
Type = 'shell', -- 'shell' / 'ipl'
Shell = 'standardmotel_shell',
Ipl = 'apa_v_mp_h_01_a',
DefaultPurchasePrice = 0, -- Default purchase price of the starter apartment. (By setting 0, the player will not be able to sell the property to make money)
DefaultRentPrice = 0, -- Default rent price of the starter apartment.
AllowFurnitureInside = true, -- true : Allow furniture inside the starter apartment
AllowChangeTheme = true, -- true : Allow changing the theme of the starter apartment IPL
DefaultThemeIpl = 'modern',
Delivery = {
Enabled = true,
Coords = vector4(2.4304, -2.1917, 498.4416, 79.99999237060547), -- Coords of the storage in the starter apartment
},
Storage = {
Enabled = true,
Coords = vector3(1.5388, -3.0803, 499.7162), -- Coords of the storage in the starter apartment
Slots = 20, -- Slots of the storage in the starter apartment
Weight = 25000, -- Weight of the storage in the starter apartment
},
Wardrobe = {
Enabled = true,
Coords = vector3(1.3227, 2.8945, 500.0726), -- Coords of the wardrobe in the starter apartment
},
}3. Assign Apartment Automatically
From your multicharacter, identity, or framework, call this server-side export when a player registers for the first time:
Go to your
es_extended/server/main.luaFind your function
loadESXPlayerGo to the end of the function and add the highlighted code in the appropriate place:
Go to your
qb-multicharacter/server/main.luaFind your function
GiveStarterItemsAdd the highlighted code in the appropriate place:
4. Additional Notes
Set
DefaultPurchasePriceandDefaultRentPriceto0to prevent players from selling the apartment.This system is perfect for giving new players a default place to live without extra steps.
You can fully customize the locations for delivery, wardrobe, and storage.
Once configured, your players will receive a starter apartment automatically when joining the server or creating their character.
5. Teleport player to Starter Apartment
Go to your
esx_multicharacter/client/modules/multicharacter.luaFind your function
Multicharacter:LoadSkinCreatorReplace function:
Go to your
esx_multicharacter/client/modules/multicharacter.luaFind your event
Multicharacter:LoadSkinCreatorReplace function:
Last updated
Was this helpful?