Twilight Storage Unitspaidv1.1.0Qbox

Installation & Config

Get Twilight Storage Units running and set up your facilities.

Installation

Download the resource

Download twilight-storageunits from your CFX Portal granted assets and place it in your resources folder.

Start it after its dependencies

Add it to your server.cfg below the resources it depends on.

server.cfg
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure ox_inventory
ensure ox_target
ensure Renewed-Banking
ensure twilight-storageunits

General Settings

Server options live in config/config.lua, grouped into sections.

config/config.lua
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',
    },
}
OptionTypeDefaultDescription
General.DebugbooleanfalsePrints extra logs to the server console.
General.VersionCheckbooleantruePrints whether you are on the latest version at startup.
Admin.Groupstring'group.admin'ACE group allowed to use /storageadmin.
UI.PrimaryColorstring'#7c3aed'Accent colour of the management UI.
Units.OwnershipModestring'rent''rent' for recurring rent, 'buy' for a one-time purchase.
Units.InteractionModestring'npc''npc' to rent, buy and manage through the facility manager NPC. 'door' to do it at each unit's door instead.
Units.Pricenumber250000One-time price in buy mode.
Rent.Amountnumber5000Rent charged each interval in rent mode.
Rent.IntervalDaysnumber7Days between rent payments.
Rent.GraceDaysnumber3Days after the due date before a unit is repossessed.
Rent.CheckIntervalMsnumber900000How often the server checks for overdue units.
Rent.ReceiverLabelstring'Department of Justice'Name shown on bank transactions.
Updating from 1.0.x

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.

Blips 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.

config/facilities.lua
{
    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

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.