Apartment Towers
sd-housing-towers puts walk-in interiors inside four of the game's towers. Each tower has a lobby with a front desk, lifts, apartment floors and a P1 garage. Every flat is a property of its own in sd-housing.
The Towers
| Tower | Id | Where | Apartment floors | Flats |
|---|---|---|---|---|
| Dream Tower | dreamtower | Little Seoul | 13 (floors 2 to 14) | 130 |
| Eclipse Towers | eclipse | Rockford Hills | 24 (floors 5 to 28) | 192 |
| Tinsel Towers | tinsel | Rockford Hills | 12 (floors 3 to 14) | 96 |
| Del Perro Heights | delperro | Del Perro | 7 (floors 3 to 9) | 84 |
| Total | 502 |
sd-housing-towers requires ox_lib and ox_target.
How a Flat Is Entered
A flat is inside its tower. Players walk into the lobby, take a lift to their floor and open the flat's own door, which locks and unlocks like any house door. The lifts stop at P1 (the garage), the lobby and every apartment floor. In Eclipse Towers, Tinsel Towers and Del Perro Heights a lift is a menu at the lift door and a screen fade to the same lift at the other stop.
Inside, a flat works like a walk-in house: a home panel by the door, keys and decorating.
How Flats Are Created
The flats need no import. sd-housing reads each tower's list of flats from sd-housing-towers (Apartments.Files) and creates a property for every flat the first time the server starts with both resources running. At every later start it brings entrances and doors up to date. Owners, keys, looks and panels are never touched.
A flat is not on the realtor's market. There are three ways to get one:
- The front desk in the tower's lobby sells them.
- A new character can be given one for free.
- An admin hands them out with
/apartment.
Unsold flats stay locked (LockVacant). There is no open house in a tower.
The Front Desk
A receptionist stands at the desk in each lobby. Her menu has three options:
- Where is my apartment: your door is marked and the lift shows your floor for
Reception.MarkSecondsseconds. - Get an apartment: pick a floor, pick a flat, confirm.
- Move out: the flat goes back to the desk for
SellBackof what it was bought for. A flat that was given for free gives nothing back. Its decor is removed as in a sale.
With OnePerCharacter = true a character has one flat at a time and must move out before taking another.
Prices
A flat costs Price, plus PerFloor for every floor above the first, rounded to RoundTo. A tower listed under Towers has its own Price and PerFloor, and PerSqm for every square metre of the flat.
| Tower | Price | PerFloor | PerSqm |
|---|---|---|---|
| Default (Dream Tower) | 60000 | 2500 | none |
eclipse | 90000 | 3000 | 700 |
tinsel | 85000 | 3000 | 700 |
delperro | 70000 | 3000 | 600 |
Starter Flats
With Starter.Enabled = true a new character is given a free flat and wakes up in it. The flat is a vacant one picked at random from the towers in Starter.Towers.
On Qbox this answers qbx_core's starting-apartment step in place of qbx_properties. sd-housing sets the replicated convar sd-housing:apartments, which tells qbx_properties to step aside. The character's flat is also listed among the spawns of qbx_spawn.
| Option | Default | Description |
|---|---|---|
Starter.Enabled | true | Give new characters a free flat. |
Starter.OnLogin | false | Also give one to a character who logs in without one. |
Starter.Welcome | true | A note on their panel: their number, and how the door, the panel and the lift work. |
Starter.Towers | { 'dreamtower' } | The towers a starter flat is picked from. false is any tower. |
The Peephole
Players look out through the front door's peephole from inside the flat: aim at the door, or use the Peephole line on the panel's Home view. The view is a wide lens that can be turned Peephole.Look degrees each way.
The Home Panel in a Flat
A flat's panel offers the views in PanelViews: home, doors, keys, activity and house by default. A keyholder gets the same views without activity and house. On the House view, selling reads as moving out.
Decorating a Flat
A flat is decorated like a walk-in house, but decor is held to the flat's own walls (Decor.BoxMargin), and only the decor of flats near you on your floor is drawn (Decor.StreamDistance).
Ownership Rules
- A flat counts toward
Properties.MaxOwnedonly whenCountsTowardMax = true. By default a character can have a flat and up toMaxOwnedhouses. - A flat can only be given to someone who does not have one.
The /apartment Command
For Admin.Group (group.admin by default):
| Command | Does |
|---|---|
/apartment | Opens the admin menu: every tower, its lobby, its floors and every flat. |
/apartment give <player> [flat] | Gives a player (server id or citizenid) that flat, or a vacant one. |
/apartment take <flat or player> | Moves the occupant out. |
/apartment info <flat or player> | Shows who lives where. |
/apartment tp <tower> | Goes to that tower's lobby. |
/apartment tp <tower> <flat> | Goes to that flat's door. |
/apartment tp <flat> | Goes to the door of the first tower with that flat number. |
give, take and info also work from the server console.
Configuration
configs/shared/apartments.lua:
| Option | Default | Description |
|---|---|---|
Enabled | true | Turns apartments on. |
Resource | 'sd-housing-towers' | The towers resource. |
Files | four files | Each tower's list of flats in that resource. A file that is not there is skipped. |
Price, PerFloor, RoundTo | 60000, 2500, 500 | Default flat pricing. |
Towers | see above | A tower's own prices, by its id. |
OnePerCharacter | true | One flat per character at a time. |
CountsTowardMax | false | A flat counts toward Properties.MaxOwned. |
SellBack | 0.5 | Share paid back on moving out. |
Reception.Enabled | true | The receptionist at the front desk. |
Reception.Model | 'a_f_y_business_02' | Her ped model. |
Reception.Scenario | false | A scenario she plays while waiting. |
Reception.Distance | 2.6 | Metres from her the option shows. |
Reception.Blip | { Sprite = 475, Color = 3, Scale = 0.8 } | The tower on the map. false is no blip. |
Reception.MarkSeconds | 180 | How long your door is marked. |
AsBuilt | Dream Tower textures | What a flat's surfaces show until the owner gives them a finish. |
LockVacant | true | Unsold flats stay locked. |
Peephole.Enabled, Fov, Look, Fisheye | true, 95.0, 25.0, true | The peephole view. |
PanelViews | { 'home', 'doors', 'keys', 'activity', 'house' } | What the home panel offers in a flat. |
Decor.BoxMargin | 0.1 | Metres decor may reach past a flat's walls. |
Decor.StreamDistance | 14.0 | Metres from a flat its furniture is drawn. |
Admin.Command, Admin.Group | 'apartment', 'group.admin' | The admin command and who may use it. |
See the full file. The exports for other resources are on the developer page.
