Skip to content

Spawn Select

Buy Here

FiveM Forums Post

YouTube Showcase Video

INSTALLATION GUIDE

Step 0 - First Steps

1. Download your resource from FiveM's Keymaster.

2. Unzip the cd_spawnselect.zip folder and place this folder in your server's resource folder.

3. Add the resource to your server start config (server.cfg): ensure cd_spawnselect. If you are using a framework, it must be placed anywhere below your framework resource e.g., es_extended, not above.

ensure es_extended
ensure cd_spawnselect

Step 1 - Fxmanifest

Depending on your framework and dependencies, you may need to make some changes inside the [cd_spawnselect/fxmanifest.lua]. We have made this easier by commenting on the lines you possibly need to change.

Step 2 - Configure Resource

You MUST read all configurable options inside the [cd_spawnselect/configs/config.lua] file and configure them to suit your server's needs. Please read the commented out help text at the end of each line so you can understand what each config option does.

The most important sections are the options under the Frameworkand Importantsections at the top of the config.lua. Everything else is optional.

Step 3 - SQL Database

You MUST import the SQL file to your database. This SQL file is located inside theREAD_ME_AFTER_PURCHASING folder, the file is named SQL_main.sql. Watch this video if you are unsure how to do this HeidiSQL / PHPMyAdmin.

Step 4 - Required Changes

OPTIONAL FEATURES

This section is to help you understand how the built-in features of this resource work, and if applicable, how you can make them compatible with other resources. These features are not required, they are optional and can be configured in the [configs/config.lua].

Force Opening the UI

IF you want to open the spawn select UI for a player you can trigger the client event below. You can also send coordinates in the first argument; these coordinates will be used for the player's "Last Location". If the coordinates in the first argument are nil then the script will get the "Last Location" coordinates from the GetLastPosition function in the server_customise_me.lua.

lua
TriggerEvent('cd_spawnselect:OpenUI')
lua
TriggerClientEvent('cd_spawnselect:OpenUI', source)

INFORMATION

Chat Commands

These chat commands can be renamed and/or disabled in the Keys and Commands section of the [configs/config.lua].

The exact usage for each command will be displayed in the chat suggestions when using the commands in-game.

CommandDescription
/personalspawnThe command to add/delete/show your personal spawn.
/openspawnselect(Test Command) This is a test command to open the spawn select UI.

COMMON ISSUES

Please check out our Troubleshooting Guide before contacting our support.

Folder Name Make sure the folder name is cd_terminalhacker.

Encrypted Files Do not edit the encrypted files in any way.

Not Using ESX If you do not use ESX, please read Step 1 again carefully; you must use the Custom Framework option.

Coords need to be floats not integers Make sure the coords in the config.lua and mapdata.js have a decimal place at the end.

xPlayer Error?

eg., if you see this error: attempt to index a nil value (local 'xPlayer').

This means you are triggering the TriggerEvent('cd_spawnselect:OpenUI') event before ESX has fully cached and loaded your player data. Some servers take longer than others due to lower VPS specs, bad optimization, etc... so it takes the SQL queries longer to complete. If you use a multicharacter script, you can fix this by increasing the wait timer by a few seconds before triggering the event from your multiple character script.

SQL Default Value?

eg., if you see an error similar to this example when inserting an SQL query into your database - BLOB/TEXT column 'personal_spawn' can't have a default value.

You can use VARCHAR(256) instead of LONGTEXT in the SQL query.

SQL Unknown Column?

eg., if you see an SQL error in the server console similar to this example - ER_BAD_FIELD_ERROR: Unknown colum 'personal_spawn' in 'where clause'.

You are missing one of the required database columns. The SQL file can be found in the "READ_ME_AFTER_PURCHASING" folder.

Ped visible on first spawn?

eg., if you see your ped when first loading into the server before the character selection screen activates.

This should not happen, there should be a black screen, so means another script is conflicting. This is most likely caused by 1 line of code in es_extended or essentialmode or spawnmanager. Search for DoScreenFadeIn in the client-side of either of these resources and remove it then restart your server. (It could be in other resources too but these are the common ones).

ERROR CODES

If you see an error code not listed below, please open a script support ticket in the Codesign Discord.

CHANGELOG

Files Changed

Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies

KeyMeaning
Full Re-Download RequiredDelete the old folder and replace it with the latest version. Reuse your config.lua unless told otherwise.
Update Specific FilesOnly the files listed below need to be replaced.
Config Update RequiredYour config.lua must be updated for this version.
Requires Auto SQL EnabledEnable Config.AutoInsertSQL in config.lua to apply required database updates.

Skipping Updates

If you’ve skipped previous updates, it’s recommended to update all files to avoid issues.
For example, if you're on v4.0.1, skipped v4.0.2, and are updating to v4.0.3, use the Full Download option.

Hello!