Skip to content

Spawning & Creation

Spawning & Creation

Spawn modes

How an existing character enters the world after being selected is controlled by spawn.mode in settings/options.lua:

settings/options.lua
spawn = {
    -- 'builtin'      = this resource's own designed spawn UI
    -- 'external'     = hand off to a detected spawn resource (qbx_spawn / qb-spawn)
    -- 'lastlocation' = no menu, spawn at last location
    mode = 'builtin',
    locations = {
        { label = 'Apartment', icon = 'home', coords = vec4(-1035.0, -1022.0, 2.0, 130.0) },
        { label = 'Hospital',  icon = 'plus', coords = vec4(298.6, -584.4, 43.3, 74.0) },
        { label = 'Garage',    icon = 'car',  coords = vec4(215.0, -810.0, 30.7, 340.0) },
    },
},
Mode Behaviour
builtin Shows the resource's own SpawnModal with your configured locations. Last Location is auto-prepended by the server. Icons: home, plus, car, pin.
external Hands off to a detected spawn resource — qbx_spawn or qb-spawn — automatically.
lastlocation No menu; the player spawns straight at their last saved position, restoring their house/apartment interior if they logged out inside one.

The legacy onlyLastLocationNoSpawnMenu flag still exists for backwards compatibility — when true it overrides spawn.mode and forces lastlocation. Leave it false so spawn.mode drives behaviour.

Apartment-inside start (new characters)

A brand-new character normally drops at defaultSpawnCoords. Set the convar bupa:apartmentInsideStart to true to instead start them inside an apartment. The script auto-detects the housing resource in use:

  • ps-housing
  • qb-apartments
  • qbx_apartments
  • 0r-apartment

If none is detected, it falls back to the default outside spawn.

server.cfg
set bupa:apartmentInsideStart "true"

The fallback outside spawn for a fresh character (when apartment start is off) is set by defaultSpawnCoords:

settings/options.lua
defaultSpawnCoords = vector4(432.29, -628.57, 28.72, 86.17),

Character creation form

The create-character form is validated server-side using the rules in settings/identity.lua. Invalid submissions are rejected with a per-field error.

settings/identity.lua
return {
    name = { minLength = 2, maxLength = 100 },
    dob = { format = 'YYYY-MM-DD', min = 1950, max = 2007 },
    height = true,
    backstory = { enable = true, minLength = 20, maxLength = 300 },
    nationalities = { 'American', 'British', 'German', 'Turkish', '...' },
}
Field Rule
First / last name minLengthmaxLength characters; digits and special characters are rejected.
Date of birth YYYY-MM-DD, birth year between dob.min and dob.max (1950–2007 by default).
Height Toggle with height = true/false.
Backstory Optional requirement (enable); when on, minLengthmaxLength characters.
Origin A dropdown of demonyms from the nationalities list, stored on the character.

Height and backstory are also persisted to the player's KVP.

Starter items

The first time a character is created, it receives the starter items from settings/access.lua. id_card / driver_license are routed through the ID-card integration:

settings/access.lua
Server.starterItems = {
    { item = 'phone',          amount = 1 },
    { item = 'id_card',        amount = 1 },
    { item = 'driver_license', amount = 1 },
    { item = 'burger',         amount = 4 },
    { item = 'water',          amount = 4 },
}