Skip to content

Select & spawn ​

The flow for every player: join → select → (creator) → spawn picker → arrival → playing. /logout goes back to select. The server tracks each player in a session state machine (connecting → select → creator → spawn → loaded) and rejects RPCs outside their state. Until they spawn, players sit in their own routing bucket (Config.BucketBase + server id, population off).

Select screen ​

Character select

When the network session is active, the client hides the player at Config.SelectScene.coords and prepares the select scene and payload. If np_loadingscreen is running, it stays visible during that work and hands off only after the select UI is ready; without it, the client uses FiveM's direct shutdown natives.

  • Slot cards along the bottom. The focused character gets its own local preview ped (np_npchandler) with its saved appearance, walk style and an idle animation (Config.SelectScene.anims, or a job idle), and the camera cross-fades to it.
  • Info panel: job (with the Config.JobStyles tile), CID, phone, age, cash and bank, time played, last seen and the last location (street and zone, saved by the client while playing).
  • Status chips: players online / max, the in-game time and weather of the select scene (Config.SelectScene.time, weather), and settings. The server name is Config.ServerName or the sv_projectName / sv_hostname convar.
  • Initial focus: the default character, else the one played last.
  • Settings sheet: Liquid Glass on / off, language (English / Deutsch), and Quit game (drops the player). Stored in client KVP, per player.
Key Action
1–9 Pick a slot
← → Switch character
Enter Play (or create on an empty slot)
N New character
Del Delete
Esc Close popovers and dialogs, else open the settings
Options popover ↑ ↓ pick, ← → move the character to another slot, Enter, C copy the look code

Slots ​

The number of usable slots is computed on the server for each license:

unlocked = max(database override or Config.Slots.default,
               highest Config.Slots.permissions value whose np_admin node the player has,
               Config.Slots.playtimeUnlock.slots if the summed playtime ≥ hours)
           capped to 1 … Config.Slots.max
  • The database override lives in np_character_slots. Set it from the staff panel, or from code with exports.np_character:setSlots(license, n) (e.g. from a Tebex package). nil removes it.
  • Playtime is summed over every character of the license, deleted ones included.
  • Slots above unlocked and up to max are shown locked with Config.Slots.lockedReason, or a reason built from the rules ("Supporter rank or 500 h played").
  • The server re-checks the slot on char:new and char:create: locked slots, used slots and full accounts are rejected.

Manage a character ​

Manage and delete

The options popover on a character:

Option Effect
Request name change New first and last name plus a reason. The name rules are checked right away. Staff apply it from /charadmin; Config.Rename.cost is then charged on the next spawn. One pending request per character
Move to slot Moves the character; it swaps with a character in the target slot
Copy look code Stores the character's appearance as a look code and copies it
Set as default Auto-selected on join. One default per license
Delete character See below

Delete, restore, purge ​

  1. The delete dialog shows cash + bank, job and time played. The player types the full name (case-insensitive, trimmed; the server checks it) and then holds the delete button.
  2. The character is soft-deleted (deleted_at set) and hidden from select. The character that is currently logged in can't be deleted.
  3. Staff can restore it from /charadmin within Config.DeleteGraceDays days. If its slot is taken by then, it moves to the first free slot.
  4. At start and every hour, the server purges soft-deleted characters older than the grace period: the framework rows (Config.FrameworkTables, or qbx_core:ForceDeleteCharacter on qbx) and the meta row. Staff can also purge a deleted character right away by deleting it again in the panel.

Deletes and purges fire the server event np_character:deleted and are logged.

Spawn picker ​

Spawn picker

After Play (or after creating a character) the server computes the list of spawns for that character and stores it in the session. The web lists them grouped as Recent, Property, Job, Public and Hospital, and pins them on the real GTA V map (satellite or road atlas, with Cayo Perico and any map layers such as Roxwood). A sky camera flies over the focused spawn.

The map opens on all spawns, then flies to the focused one. Drag to pan, and use the scroll wheel, the + / − keys, the buttons or a double-click to zoom. The top button switches between satellite and road atlas.

Providers ​

The list is built in this order (duplicate ids are dropped):

Type Id Source
last last The last saved location (or the framework's position column). Not offered for a new character
job job:<id> Config.JobSpawns[job] for the character's job. duty = true adds the on-duty switch (on by default)
property (default) <provider>:<id> Every registerSpawnProvider function, in registration order, up to 32 spawns each
public public:<id> Config.Spawns
hospital hospital Config.Hospital, only when selectable = true

If the list ends up empty, the hospital is added, so a player always has a spawn.

Default icons and tints per type: last = green clock-rotate-left, property = lilac house, job = blue briefcase (or the job's Config.JobStyles icon), public = neutral location-dot, hospital = red hospital.

Spawn providers ​

lua
-- server
exports.np_character:registerSpawnProvider('motels', function(src, cid)
  local room = MySQL.single.await('SELECT room, x, y, z, h FROM motel_rooms WHERE citizenid = ?', { cid })
  if not room then return {} end
  return {
    { id = 'room' .. room.room, type = 'property', label = 'Pink Cage Motel', sublabel = 'Room ' .. room.room,
      coords = { x = room.x, y = room.y, z = room.z, w = room.h } },
  }
end)
Field Notes
id Required. Prefixed with <provider>: by the server, so it can't collide with or impersonate built-in spawns
coords Required. { x, y, z, w } or a vector4. Spawns outside the map bounds are dropped
type 'last', 'property', 'job', 'public' or 'hospital'. Default 'property'
label, sublabel, icon, tint Optional. Icon and tint default by type
locked, lockedReason Shown but not selectable
onDuty Boolean: shows the duty switch
forced true makes the client skip the picker

Provider names must match [%w_-]+ (max 32 characters). A provider that errors is skipped and logged. Providers are removed when their resource stops.

np_prison registers the provider np_prison: a jailed character gets a forced cell spawn (type job). Because a forced spawn only skips the picker when it is the only spawn in the list, np_prison also puts a relogging inmate back in the cell itself.

Forced spawns ​

Two cases skip the picker:

Case Spawn
The character is downed (framework isdead / inlaststand, ESX is_dead) The hospital, "You were taken to the hospital"
The player crashed or timed out (drop reason contains crash, timed out, timeout, lost connection or restart) and rejoins within Config.Rejoin.minutes The last location, "Back where you left off"

Choosing a spawn ​

spawn:choose only accepts an id from the list the server computed for this player; coordinates from the client are never used. Locked spawns are rejected. Then the server:

  1. logs the character in through the framework (qb / qbx / esx), unless creating it already did,
  2. moves the player back to routing bucket 0 and sets duty when the spawn had the switch,
  3. hands out the starter pack (first spawn of a new character) and charges an applied rename,
  4. fires np_character:loaded (server) and np_character:client:loaded, and logs the spawn.

Arrival ​

While the screen is faded out, the client applies the appearance, walk style and voice, and teleports the player. Then the arrival plays: 'lsia' (chosen on the summary, new characters only) is a scripted camera over the airport, about 8 s, skippable with Enter, Esc or Space, that ends behind the player; otherwise the game fades in. Then the local np_character:loaded event fires (see also Bridges → Client side).

While playing, the client saves the position every Config.SavePositionInterval ms. Playtime and last seen are saved on every position save, on logout and on drop.