Spawn Select
Step by step installation guide, common issues & solutions, code snippets, error codes, config previews, locales previews, SQL previews, and changelogs; all in 1 easily accessible place.
Buy Here
This resource can be purchased as part of a bundle for a discount here.

1. Unzip the cd_spawnselect.zip folder and place this folder in your server's resource folder.
2. Add the resource to your server start config: ensure cd_spawnselect (it must be placed anywhere below your framework resource eg., es_extended, not above). The name of the folder must not be changed or the script will not function correctly.
3. WARNING do not edit the obfuscated files in any way.

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.

You may need to make some changes to the fxmanifest.lua, depending on your framework and dependencies. We have made this easier for you by commenting on the lines which you may need to change.

You MUST read all of the configurable options inside the config.lua 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 option does so you know if you need to change it or not.
The most important sections are the options under the Framework and Important sections at the top of the config.lua. Everything else is optional.

ESX
QBCore
vRP
No-framework
Other (custom framework)
There are no required changes you need to make. All you need to do is simply configure the config.lua correctly.
Step 1: Make sure the event named qb-spawn:client:openUI has not been changed, or if it has been changed you need to change this event name in the cd_spawnselect/client_customise_me.lua to what your modified QBCore has named it because when this event is triggered it will open the spawn select UI.
Step 2: At this time until a future update, the qb-spawn resource is still required to handle the first spawn of new characters so they can choose an apartment. This code in the client.lua of qb-apartments should look like this.
qb-apartments client main.lua
RegisterNetEvent('apartments:client:setupSpawnUI')
AddEventHandler('apartments:client:setupSpawnUI', function(cData)
QBCore.Functions.TriggerCallback('apartments:GetOwnedApartment', function(result)
if result ~= nil then
DoScreenFadeOut(0)
TriggerEvent('cd_spawnselect:OpenUI')
TriggerEvent("apartments:client:SetHomeBlip", result.type)
else
TriggerEvent('qb-spawn:client:setupSpawns', cData, true, Apartments.Locations)
TriggerEvent('qb-spawn:client:openUI', true)
end
end, cData.citizenid)
end)
Step 3: Remove lines 52-56 client_customise_me.lua in cd_spawnselect.
--Comment out or remove these lines.
-- RegisterNetEvent('qb-spawn:client:openUI')
-- AddEventHandler('qb-spawn:client:openUI', function()
-- DoScreenFadeOut(0)
-- Citizen.Wait(2000)
-- TriggerEvent('cd_spawnselect:OpenUI')
-- end)
Apart from that there are no other required changes you need to make to external scripts if you are using version 3.1.0+. All you need to do is simply configure the config.lua correctly.
There are no required changes you need to make. All you need to do is simply configure the config.lua correctly.
There are no required changes you need to make. All you need to do is simply configure the config.lua correctly.
There are no required changes you need to make. All you need to do is simply configure the config.lua correctly.

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 players "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.
client-side to client-side
From server to client
TriggerEvent('cd_spawnselect:OpenUI')
TriggerClientEvent('cd_spawnselect:OpenUI', source)

All of these chat commands can be renamed and disabled/enabled in the config/code.
If a command isn't working, make sure the config option for said feature is enabled in the config.lua.
Command
Description
/personalspawn
The command to add/delete/show your personal spawn.
/openspawnselect
(Test Command) This is a test command to open the spawn select UI.

Please check out our Troubleshooting Guide before contacting our support.
🔔 Not Using ESX If you do not use ESX, please read Step 1 again carefully, you will need to use the Custom Framework option.
🔔 Coords need to be floats not integers Make sure the coords in the config.lua and mjapdata,js have a decimal place at the end basically.
xPlayer Error? If you see this error attempt to index a nil value (local 'xPlayer'), this means you are triggering the event in Step 1 before ESX has fully registered 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.
SQL Default Value? 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”.
SQL Unknown Column? 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'.
Ped visible on first spawn? Do you see your ped when first loading into the server before the character selection screen activates?

If you see an error code which isn't listed below please open a script support ticket in the Codesign Discord.
Server
Client
N/A
3456 - The position in the users database table for this player's character was 0,0,0. The next time a player exits the game this should update the coordinates in the database.
6874 - The player's last saved position was nil.
9871 - The player's job spawn coordinates were nil.
6433 - The player's personal spawn coordinates were nil.
3345 - The coordinates for the chosen spawn location were nil.
8897 - There was an error in the GetJob function in the client customize me.
2234 - There was an error in the HasFullySpawnedIn function in the client customize me from something you have changed.

Files Changed: Not every update requires you to replace the whole folder. We do this because we understand it's a pain to redo the configs for every update.
  • All Files - This means you should delete your old cd_spawnselect folder, download and add in the latest version, reconfigure the configs folder and restart your server.
  • Specific Files - This means you can simply copy and paste the SPECIFIC new files over the old ones and restart the server.
Update Type: On rare occasions, you are forced to update to the latest version. Mostly due to authentication updates where the old versions will no longer work.
  • Mandatory - This means you MUST update to this new version or the old versions will no longer work.
  • Optional - This means its completely your choice whether you wish to update to the latest version. But we do not offer support for old versions for obvious reasons; they are old.
v3.0.0
v4.0.0
v4.0.1
v4.0.2
v4.0.3

v3.0.0 - v3.1.2
Files Changed:
  • All files
  • Specific Files
Update Type:
  • Mandatory
  • Optional
Changelog:
Add
  • Added locales for the UI.
  • Added the ability to rename all esx events such as the setjob and playerloaded events.
  • Added drag-and-drop QBCore compatibility.
Edit
  • Minor code clean up.
  • Updated the codesign error handlers.
  • Changed the default police job spawn to MRPD.
  • Moved the framework code and chat commands to the client customise me to allow for further customization.
  • Rewrote a large majority of the code for optimisation and overall cleaned up the code.
  • The script is now drag-and-drop with esx, qbcore, vrp and no framework without having to make changes to external scripts.
Fix
  • Fixed random server error on server start.
  • Fixed rare falling to death error.
  • Fixed the issue where the OpenUI event would not register if the event was triggered before the script was authorised.
  • Fixed the bug where you would be frozen and invisible after spawning.
  • Temporary fix for the canary issue until the new Tebex FiveM license system is ready to launch, when this is released we will be fully switching over to the new system.
  • Fixed an issue that sometimes caused players to be frozen in the sky.
  • Reworked the camera animation after you have chosen your character. This should also resolve visual issues of clipping through landmarks when spawning in certain locations.
  • Fixed an issue when using the "no framework" config option.

Files Changed:
  • All files
  • Specific Files
Update Type:
  • Mandatory
  • Optional
Changelog:
Authentication
  • We are now using the official Authentication System provided by FiveM. The old auth system will be taken offline 1 week from now (give or take a few days if needed).
Add
  • Added compatibility for oxmysq

Files Changed:
  • All files
  • Specific Files
fxmanifest.lua - (IMPORTANT)
server/main/server.lua - (IMPORTANT)
client/main/client.lua - (IMPORTANT)
html (FULL FOLDER) - (IMPORTANT)
Update Type:
  • Mandatory
  • Optional
Changelog:
Authentication
  • Small authentication update to ensure stability.

Files Changed:
  • All files
  • Specific Files
fxmanifest.lua - (IMPORTANT)
server/server.lua
configs/client_customise_me.lua
Update Type:
  • Mandatory
  • Optional
Changelog:
Add
  • Added compatibility with latest oxmysql.
Fix
  • Fixed an issue where the UI would open before the script has fully loaded.

Files Changed:
  • All files
  • Specific Files
fxmanifest.lua - (IMPORTANT)
html (FULL FOLDER) - (IMPORTANT)
Update Type:
  • Mandatory
  • Optional
Changelog:
Add
  • Added the ability for users to zoom and scroll on the spawnselect map UI (same as dispatch).
Copy link
On this page
START HERE
INSTALLATION GUIDE
Step 1 - Insert the SQL
Step 2 - Fxmanifest
Step 3 - Configure the resource
Step 4 - Required Changes
Optional
INFORMATION
Chat commands
COMMON ISSUES
ERROR CODES
CHANGELOG