Database
Koja Spawn Selector uses one table. It is created when the resource starts; sql/koja_spawnselector.sql has the same statement if you prefer to import it.
sql/koja_spawnselector.sql
CREATE TABLE IF NOT EXISTS `koja_spawnselector` (
`identifier` VARCHAR(80) NOT NULL,
`x` FLOAT NOT NULL DEFAULT 0,
`y` FLOAT NOT NULL DEFAULT 0,
`z` FLOAT NOT NULL DEFAULT 0,
`heading` FLOAT NOT NULL DEFAULT 0,
`last_choice` VARCHAR(80) NULL DEFAULT NULL,
`updated_at` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`identifier`)
);| Column | What it holds |
|---|---|
identifier | Character identifier from koja-lib: ESX identifier (with the char1: prefix on multicharacter), QBCore citizenid |
x, y, z, heading | Last saved position |
last_choice | Id of the location picked last time, for Config.Open.RememberChoice |
updated_at | Unix time of the last position save; 0 = no position yet |
Framework fallback
A character without a saved position (first start after installing) gets "Last location" from the framework when Config.LastLocation.FrameworkFallback is on:
| Framework | Read from |
|---|---|
| ESX | users.position |
| QBCore / QBox | players.position |
Nothing is ever written to the framework tables.
Resetting
-- one character
DELETE FROM `koja_spawnselector` WHERE `identifier` = 'char1:abc123';
-- everyone back to the default view
TRUNCATE `koja_spawnselector`;