Installation & Config
Get Twilight Storage Units running and set up your facilities.
Installation
Download twilight-storageunits from your CFX Portal granted assets and place it in your resources folder.
Add it to your server.cfg below the resources it depends on.
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure ox_inventory
ensure ox_target
ensure Renewed-Banking
ensure twilight-storageunitsGeneral Settings
Server options live in config/config.lua, grouped into sections.
ServerConfig = {
General = {
Debug = false,
VersionCheck = true,
},
Admin = {
Group = 'group.admin',
},
UI = {
PrimaryColor = '#7c3aed',
},
Units = {
OwnershipMode = 'rent',
InteractionMode = 'npc',
Price = 250000,
},
Rent = {
Amount = 5000,
IntervalDays = 7,
GraceDays = 3,
CheckIntervalMs = 15 * 60 * 1000,
ReceiverLabel = 'Department of Justice',
},
}| Option | Type | Default | Description |
|---|---|---|---|
| General.Debug | boolean | false | Prints extra logs to the server console. |
| General.VersionCheck | boolean | true | Prints whether you are on the latest version at startup. |
| Admin.Group | string | 'group.admin' | ACE group allowed to use /storageadmin. |
| UI.PrimaryColor | string | '#7c3aed' | Accent colour of the management UI. |
| Units.OwnershipMode | string | 'rent' | 'rent' for recurring rent, 'buy' for a one-time purchase. |
| Units.InteractionMode | string | 'npc' | 'npc' to rent, buy and manage through the facility manager NPC. 'door' to do it at each unit's door instead. |
| Units.Price | number | 250000 | One-time price in buy mode. |
| Rent.Amount | number | 5000 | Rent charged each interval in rent mode. |
| Rent.IntervalDays | number | 7 | Days between rent payments. |
| Rent.GraceDays | number | 3 | Days after the due date before a unit is repossessed. |
| Rent.CheckIntervalMs | number | 900000 | How often the server checks for overdue units. |
| Rent.ReceiverLabel | string | 'Department of Justice' | Name shown on bank transactions. |
The config layout changed in 1.1.0. Copy the new config/config.lua and re-enter your values instead of keeping your old file.
NPC or Door Mode
Units.InteractionMode sets where players rent, buy and manage their units.
'npc': players talk to the facility's manager NPC to browse every unit, rent or buy one, pay rent and manage access. Doors only show Open Stash.'door': no NPC is spawned. A vacant unit's door shows Rent Unit or Buy Unit. Doors of units you can access show Open Stash and Manage Unit, where you can also pay rent.
Every action is checked on the server against the mode you choose, so players can only rent, buy or manage from the NPC in 'npc' mode or from the unit's door in 'door' mode.
The facility blip is still placed at the npc.location coordinates, so keep that set even in door mode.
Adding a Facility
Facilities are set in config/facilities.lua. Each one has a manager NPC, an optional blip and a list of units.
{
id = 'lsia',
label = 'LSIA Storage Units',
npc = {
location = vec4(-734.77, -2467.87, 12.95, 57.89),
model = 'a_m_m_business_01',
},
blip = { enabled = true, sprite = 478, scale = 0.7, colour = 83, shortRange = true, label = 'LSIA Storage' },
units = {
{ id = 1, doorCoords = vec3(-727.05, -2474.51, 14.22), doorHeading = 180.0, stashLabel = 'LSIA Unit 1', stashSlots = 100, stashWeight = 2000000 },
},
},Unit ids must be unique across every facility. They are the key saved in the database, so do not change the id of a unit that players already own.
Text
Player-facing messages can be edited in locale/en.lua.