Spawn Selector
Choose a spawn location after selecting your character. Features camera flyover animations and configurable locations.
Spawn Modes
The behaviour after a player presses Play is controlled by two config options:
Config.UseSpawnSelector | Config.CustomSpawnSelector | Result |
|---|---|---|
true | (ignored) | The built-in spawn selector screen is shown |
false | false | No selector — the player spawns directly at their last position (or Config.DefaultSpawn for new characters) |
false | true | No built-in selector — your own spawn selector resource takes over (see below) |
How It Works (built-in selector)
- Select your character from the selection screen
- The spawn selector appears with predefined locations
- Hover over a location to see a camera flyover preview
- Click to confirm your spawn point
Default Locations
| Name | Description |
|---|---|
| Pillbox Hill | Central city location |
| Mission Row | Near the police station |
| Mirror Park | Residential area |
| Del Perro | Beach/pier area |
| Last Location | Spawn at your last known position |
Configuration
lua
Config.SpawnLocations = {
{ label = "Pillbox Hill", coords = vector4(...) },
{ label = "Mission Row", coords = vector4(...) },
-- add more locations...
}
| Option | Default | Description |
|---|---|---|
Config.UseSpawnSelector | false | Show the built-in spawn selector screen |
Config.CustomSpawnSelector | false | Hand off to your own spawn selector resource (requires UseSpawnSelector = false) |
Config.UseQBHouses | false | Include qb-apartments as spawn option |
Config.DefaultSpawn | vector4 | Default spawn coordinates |
Using Your Own Spawn Selector
If you already have a spawn selector resource, you can let it take over. Set:
lua
Config.UseSpawnSelector = false,
Config.CustomSpawnSelector = true,
When a player picks a character and presses Play, the multicharacter script:
- Logs the character in on the server
- Closes its UI, releases NUI focus and destroys its camera
- Fires the client event below — then it's out of your way
lua
RegisterNetEvent("code9_multichar:client:spawnSelector", function(charData)
-- charData.position = the character's last saved position {x, y, z, w}
-- charData.identifier, charData.firstname, charData.lastname, ... are also available
-- The player is already logged in and the menu is closed here.
-- Open your own spawn selector and teleport the player wherever you want.
exports["my_spawn_selector"]:Open(charData)
end)
