Koja Scripts

Features

What Koja Spawn Selector does: the 3D map and controls, the location panel, locks, last location, the camera flight and the ESX, QBCore and Koja Multicharacter integrations.

Features

The 3D map

The map is the same 3D layer as the Koja Dispatcher: GTA V radar tiles with level of detail, terrain from the in-game heightmap and extruded buildings, graded in the warm Koja Appearance colours.

ControlAction
Left dragMove the map
Right dragRotate and tilt the camera
ScrollZoom at the cursor
+ / − / crosshair (right dock)Zoom in, zoom out, back to the selected spot
Click a pinSelect it. Click the selected pin again to spawn

When the map opens, the camera starts high above the island and glides down to the preselected spot. A pulsing ring and a light beam in the accent colour mark the selected location.

The location panel

  • Header — position in the list (03 / 08) and the server name.
  • Card — the selected spot with its category, description, street, coordinates and, for the last location, how long ago it was saved. Without an image, the card shows the map around the spot.
  • List — every location grouped by category. Locked spots show a lock and their label ("Police only").
  • Toolbar — at the top of the map, filters the list and the pins by category.
  • Footer — Spawn here, and an exit button when cancelling is allowed.
KeyAction
↑ / ↓ or W / S, mouse wheel over the listBrowse
EnterSpawn at the selected spot
EscClose, when canCancel is on
+ / -Zoom

Locks

Locks are decided on the server when the list is built:

  1. jobs (with minimum grade and onDuty)
  2. gangs
  3. ace
  4. ServerEditable.CanAccess
  5. Every check added with AddAccessCheck

The first one that says no locks the spot, and its reason becomes the label. When the player confirms, the server looks the spot up in the list it sent and refuses locked or unknown ids, so a modified UI cannot spawn anywhere else.

Last location

The position of every spawned player is saved every SaveInterval seconds, on logout, on disconnect and when the resource stops. Positions in a routing bucket other than 0 are skipped when IgnoreBuckets is on, so nobody comes back inside an instanced interior. Tracking starts only after the player landed, so the hidden ped of the selection screen is never saved.

The camera flight

  1. The ped is placed and frozen, and streaming starts around the spot (it already started while the player was browsing).
  2. A top-down shot from Height metres.
  3. A descent to a shot behind and above the ped.
  4. The game waits for collision and the scene (up to LoadTimeout), then the ped appears.
  5. A last move over the shoulder and a blend into the gameplay camera.

A letterbox and a "Spawning into" card are shown over the flight. Set Config.Cinematic.Enabled = false or cinematic = false on a spawn for a plain fade.

Integrations

WithWhat happens
ESXOpens on esx:playerLoaded. New characters skip it unless Config.NewCharacter.UseSelector is on
QBCore / QBox (qb-multicharacter)Replaces qb-spawn. New characters with qb-apartments pick a starter apartment; after spawning, the usual QBCore:Client:OnPlayerLoaded events fire
qb-housesOwned houses are listed under Property
Koja MulticharacterOpens this map after character selection. ESC goes back to the character list
No locations at allThe player gets a message and spawns at Config.Fallback