---
url: /helpful-guides/discord-roles.md
description: >-
How to claim Discord roles for Codesign paid scripts, link your FiveM and
Discord accounts, use the /claim bot command, and verify team members with
/dev commands for support access.
---
# Discord Roles
::: danger ** PLEASE READ CAREFULLY**
***
Only the person who purchased the resource(s) should claim their roles on discord.
Developers/co-owners should **NOT** claim a purchase they did not make.
:::
## Our Discord
In order to receive roles you need to be a member of our [Discord](https://discord.gg/codesign).
This is our primary way of providing support for our paid scripts.
Join now and keep track of updates, events, giveaways and promotions!
## Automatic Roles
In case you are already a member and connected your Discord account when purchasing - the roles will be automatically assigned.
Automatic roles will not work in the following cases
* No Discord account linked
* Gifted purchase
* Discord linked but not joined Codesign Discord
## Claiming roles
You can always manually claim the roles in order to be able to receive support and access to customer-only channels.
Use the bot commands below in the #bot-spam discord channel.
::: info Where's my Tebex ID?
You can find your Tebex Transaction Id in the emails from Tebex or Codesign.
You may need to check your email [spam inbox](https://i.imgur.com/QBuD0zR.gif). You can also find it in your [Tebex Payment History](https://checkout.tebex.io/payment-history/login).
:::
Use discord‘s slash command by typing in `/claim`, select the `tbx` option and paste your transaction ID.

## Verify your team members
Do your developers, co-owners or team members need support too?
Once you have completed [#Step 3](discord-roles.md#step-3-claim-discord-roles-to-receive-support) and your team member(s) have joined the [Codesign Discord](https://discord.gg/codesign), the only way we can offer your team member(s) support is if you, the resource owner, manually verify them in the [Codesign Discord](https://discord.gg/codesign). This will automatically give them a customer role and enable them to open support tickets and receive support. Use the bot commands below in the #bot-spam discord channel.
> Remember you must use discord’s slash command for this bot.
>
> **`/dev add @User`**
>
> **`/dev remove @User`**
>
> **`/dev list`**
---
---
url: /helpful-guides/fivem-asset-escrow-system.md
description: >-
Guide to FiveM's Asset Escrow system for protected scripts. Covers correct
FiveM account setup, minimum server artifacts version 4960+, common errors,
and solutions for entitlement and syntax issues.
---
# FiveM Asset Escrow System
## About the Escrow System
The Asset Escrow system allows FiveM creators to protect their scripts, maps and models.
It also ensures servers are running scripts they own licences for.
## How to use
There are only a couple of steps required to use Escrowed resources:
### Use the correct FiveM account
❗️ Your purchases are linked to your FiveM account, and your FiveM account is linked to your FiveM server license key.
Meaning the FiveM account you use to login on Tebex before the purchase, needs to be the FiveM same account that you use to log into to generate your server license key.
### Minimum server artifacts version required
❗️ It is required that your server is using server artifacts version 4960+.
✔️ This is required to be able to use resources on the new system. But you will eventually need to update at some point anyway right?
## Common problems
### You lack the required entitlement?
#### Reason 1 - Restart
After you purchase or transfer the resource(s) a server restart is always required.
:::tip ** Solution**
Simply restart your server.
:::
#### Reason 2 - Wrong CFX Key
Your server is using a FiveM server license key that is not linked to the initial purchase, meaning the resource(s) were purchased on the wrong FiveM account.
:::tip ** Solution 1** - Transfer
Whoever has access to the FiveM account the purchase(s) were made on needs to login to [FiveM's Portal](https://portal.cfx.re) and [transfer](https://i.imgur.com/iB5OU95.png) them to the correct account.
:::
:::tip ** Solution 2** - License Key
If you login to [FiveM's Portal](https://portal.cfx.re) and you are able to see your [resource(s)](blob:https://imgur.com/afb16169-2f51-4439-8fda-e3c66b7c68d0), this means your server is using a license key that is not linked to your purchase(s). So either create a new license key on [Portal](https://portal.cfx.re) using this FiveM account or [transfer](https://i.imgur.com/iB5OU95.png) them to the correct account.
:::
:::tip ** Solution 3** - Owner
If you do not have access or can not contact the owner of the FiveM account the purchase(s) were made on, contact the Codesign Team in a Management Ticket on our [Discord](https://discord.gg/codesgn).
:::
*You can contact the Codesign Team in a Management Ticket on our* [*Discord*](https://discord.gg/codesgn) *to check which FiveM account your purchase(s) are linked to.*
### Failed to verify protected resource?
#### Reason 1 - Corrupted files
Files were possibly corrupted during transfer.
:::tip ** Solution - Binary Transfer**
Ensure the encrypted files are copied; the `.fxap` file must be included!
[FileZilla](https://filezilla-project.org/) by default automatically detects the required data type. This can corrupt `.fxap` files.
**Force the binary transfer type** - on the top menu select `Transfer > Transfer Type > Binary` and then transfer the files again.
In case this fails try using [WinSCP](https://winscp.net/eng/index.php) instead.
:::
### Syntax error?
#### Reason 1 - Restart
A server restart is always required after adding a new resource or updating an existing one.
::: tip ** Solution** - Restart server
Simply restart your server.
:::
#### Reason 2 - Artifacts version
You are not using a compatible server artifacts version - [#Minimum server artifacts version](fivem-asset-escrow-system.md#read-before-purchasing).
::: tip ** Solution** - Artifacts
Download a newer server artifacts version from [https:/runtime.fivem.net](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/) (at least version 4960+).
:::
#### Reason 3 - Editing encrypted code
**You have edited the encrypted code**.
::: tip ** Solution** - Edited Files
Delete the current folder and redownload a fresh unedited version from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
:::
### Couldn't start resource?
#### Reason 1 - Server Time
If this only happens to some players, but not all of them, this is because the time on your VPS/dedicated server is behind.
::: tip ** Solution** - Server Time
Make sure in your windows settings, the time is being set automatically [Example](https://i.imgur.com/SVKO3c3.png).
`Start > Settings > Time and Language`. Or watch this [video](https://youtu.be/PjmahVzbMm8).
:::
## FAQ
#### **I own 3 servers, can I use the same resource on my 3 different servers at the same time?**
Yes, as long as you are using a server license key that was generated from your FiveM account. This also applies for dev/local host servers too. Read this for more information [#Use correct FiveM account](fivem-asset-escrow-system.md#1.-use-correct-fivem-account).
#### **Can I transfer the resource to another FiveM account?**
::: danger Recent changes
A transfer is only possible within the first 28 days of purchasing a resource!
:::
Yes, you can transfer an asset **1 time only** and it is permanent so it can not be undone. You can login to [CFX Portal](https://portal.fivem.net/asset-grants)and [transfer](https://i.imgur.com/iB5OU95.png) them to the correct account. Be aware that tranfers are 1 time only.
---
---
url: /helpful-guides/authentication-and-transfers.md
description: >-
Information about FiveM asset authentication via Keymaster, one-time asset
transfers (within 28 days of purchase), Discord role transfers, and important
security guidelines for Codesign customers.
---
# Authentication & Transfers
## Regarding Authentication & Transfers
*Updated 28th May 2023.*
As everybody (*hopefully*) knows we made a switch to [FiveM’s Asset Escrow](https://docs.codesign.pro/information/new-fivem-auth-info) system at the beginning of 2022.
We would like to explain how the system works and what to expect in certain cases of abuse:
### The Keymaster system
Once You make a purchase it is automatically assigned to Your Keymaster / FiveM account.
This being Your account it is Your decision on who will have access, as well as Your duty to protect it.
**We cannot be held responsible** for anything unwanted happening to Your keymaster account and assigned assets, and **we keep the right to deny any assistance on this matter**.
**The reasoning behind this is fairly simple** - we do not have access to information on transfers, logs and shared accounts.
### Asset transfers
The transfer system currently allows for a **one-time transfer**.
::: danger Recent changes
A transfer is only possible within the first **28 days** of purchasing a resource!
:::
Before You transfer an asset You are prompted with this message:
::: danger CFX Warning
**WARNING:** Transfer will remove this license from your account and move it to another [Cfx.re](http://cfx.re) account. This action is irreversible and can be done only once for each license.
:::
The Keymaster system in its current state does not allow reversing this action.
As of the latest Keymaster update both the sender and receiver need to confirm the transfer through their registered e-mail address.
Please **take care** of Your Keymaster accounts, **do not give access** to untrusted people, and do not make shady deals.
In case a community member is purchasing a resource for a server it is always easier to use the “Gift” option on Tebex, so the asset(s) always end up on the correct account.
#### **Regarding returns:**
::: info
We are no longer able to complete a one time return due to changes in Tebex's system.
:::
\~~If your account gets compromised and assets get transferred **we can return** them to the **original Keymaster account** which made the purchase.~~ \
\
\~~We can only complete this return **ONCE.** Any further requests will be denied.~~
\~~If You have such issues please contact us through our~~ [~~Discord~~ ](https://discord.gg/codesign)~~server by opening a management ticket.~~
### Discord
### Role ( Support ) transfers
Since the Keymaster system allows for a one-time transfer, our “Customer” role transfer policy will remain compliant with this.
The **Customer** role, along with asset roles, allows a Discord user to receive support for the purchased resources.
In order to complete a transfer of ownership certain criteria will have to be met:
* A ticket was opened from the original owner requesting a transfer
* Mention of a Discord user who will receive the roles
* A statement that explains the reason for the transfer
* The request needs to be a full transfer request - meaning the owner will lose all support privileges.
Once a transfer is complete **it cannot be reversed**.
These rules also apply to customers whose Discord accounts have been compromised and are requesting a transfer to another one.
---
---
url: /helpful-guides/register-key-mapping.md
description: >-
Guide to FiveM RegisterKeyMapping for custom key binds. Explains how to unbind
keys, disable key mapping, and why per-player key binds persist after config
changes.
---
# Register Key Mapping
## ::: danger Changing keybinds
**If you want to change the default key bind for all players, you MUST change it in the `configs/config.lua`** ***BEFORE***** starting the resource on your main server.**
:::
## Info
We have started using the FiveM native called `RegisterKeyMapping` [FiveM Documentation](http://runtime.fivem.net/doc/natives/?_0xD7664FD1). This removes the need for while loops checking every frame for keypresses, therefore allowing the resource to be more optimised. This FiveM native works by triggering the chat command it has been registered with when the keybind is pressed. This new method also allows each client to change their own key binds in-game. [Example](https://i.imgur.com/GRWKelR.jpeg) `Open Gta5 settings > Key Bindings > FiveM`.
## How to Unbind Keys
Once you have started the resource on your server for the first time, even if you change the key in the config.lua, it will not change for the players who have already joined. Although it will change for the players who join after you have changed it.
**Option 1:**
* To unbind keys **for your client only** you can type `unbind keyboard`[`input_parameter`](https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/) in F8.
**Option 2:**
* Go to `C:\Users\[USERNAME]\AppData\Roaming\CitizenFX`
* Open `fivem.cfg`
* Remove the lines with this resource name.
* Restart FiveM. Keybinds will be set back to default values set in the config.
## How to Disable KeyMapping
* Firstly unbind the keys using the method above, disable the key in the config.lua and then you can rewrite the code to use the regular method of while loops checking for key presses `IsControlJustReleased` or other methods to trigger the events we provide to you in our docs.
## Notes
* There is no way to mass unbind keys for all of your server's players.
* The full list of available keys can be found [here](https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/).
---
---
url: /helpful-guides/self-debugging.md
description: >-
A guide for FiveM server owners and developers on self-debugging LUA and SQL
code. Includes troubleshooting steps, LUA table debugging with cd_devtools,
and SQL debug mode activation.
---
# Self Debugging
## For new server owners and developers
As a server owner or server developer at some point you will experience code failing, scripts not running like they should, resources behaving weirdly, etc.\
This can happen with any script either purchased from a creator or one of your own!
At Codesign we always attempt to help with this, however, things can become difficult when we cannot recreate the issue ourselves.
We've made a small checklist of important things to check:
* **When** does the error happen?
* E.g. - When I click this button
* **Where** does the error happen?
* E.g. - This specific part of the map, or this specific section of the UI
* **How often** does the error happen?
* E.g. - Every time, at this specific time
* **What** do I expect to happen
* What actually happens?
Below you can find more detailed instructions which can help figure these questions out:
## Troubleshooting
**1.** Check if the script has been authorized correctly. Enable Config.DebugPrints in the config.lua and check the server console to make sure there are no errors saying `You lack the required entitlement?` and check for 2 client-sided prints saying `Loaded Successfully!`.
**2.** Check for obvious error prints in the server console and the client F8 console. If you don't see any obvious errors make sure to restart the script while the server is live and check again.
**3.** If applicable, change the key in the config.lua to one that you know works, as one of your other resources, may be disabling that specific key. Please read for more information regarding [#key-mapping](register-key-mapping.md).
**4.** If none of the above worked, have a second read through the installation guide, you may have missed something - you are only human.
*If all else fails, contact the Codesign Team in the* [*Codesign Discord*](https://discord.gg/codesign)*..*
## **LUA Debugging**
### **Basic LUA Debugging Example**

**Option 1:** You can print the variables being received/sent in events/functions (or just any variables in general). But you will not be able to print booleans unless you convert them into strings.
**Option 2:** You can also use prints to debug what may be causing a script to error or what may be causing the code to not reach a certain line. We can do this by adding a print on every line in a certain part of the code which is having issues (just change the string in the print so it's unique eg., "here 1", "here 2"), and you will be able to see which line the code is not able to get passed, then you will know what line of code is causing the problem.
**Option 3:** In most cases, these are both best used together to actually see what's going on in the code.
### LUA Table Debugging
If you try to print a table using the methods above, it will normally look like this - table: 0xe2a670.
So in order to see the data inside tables we need to use another method, luckily we released a free resource which does just this!

[**Download**](https://codesign.pro/package/4571930)
[**Documentation**](https://docs.codesign.pro/free-scripts/devtools)
[**YouTube Preview**](https://youtu.be/7iClw0DqVUU)
### Useful Tip for LUA Debugging
What this does is display all of the prints on your screen instead of only displaying them in the client-side F8 console, it's just a small quality-of-life feature for developers.

::: tabs
\= How to enable
Type this in your client-side F8 console:
```
con_miniconChannels script:*
```
\= How to disable
Type this in your client-side F8 console:
```
con_miniconChannels 0
```
:::
### FAQ
**Do you still need more help with prints?**
Here are a couple of links to help you further:
* [Documentation](https://www.tutorialspoint.com/lua/lua_strings.htm)
* [YouTube Tutorial](https://youtu.be/7sj-qf99RPk)
## SQL Debugging

This will print all SQL queries into your server console so you can see what's going on database-wise.
::: tabs
\= How to enable
Add any of these lines anywhere in your server.cfg.
```
set mysql_debug "Console"
```
```
set mysql_debug
```
:::
---
---
url: /paid-scripts/bridge.md
description: >-
cd_bridge is the core resource for all Codesign FiveM scripts. Handles
framework connections, database setup, auto-detection of supported resources,
and error handling.
---
# Bridge
::: info What is cd\_bridge used for?
**This resource is the core of all Codesign scripts.** It handles framework connections, database setup, and error handling behind the scenes. When the bridge starts, it automatically detects and starts every compatible resource—including all Codesign scripts and any Codesign-compatible scripts you have installed.
:::
## 📘 Start Here
* [**Installation Guide**](https://docs.codesign.pro/paid-scripts/bridge/installation-guide)\
Step-by-step setup and configuration.
* [**Troubleshooting Guide**](https://docs.codesign.pro/paid-scripts/bridge/troubleshooting-guide)\
Common issues and error codes.
### 🧠 Need Help?
* **Support:** Join our Discord –
---
---
url: /paid-scripts/bridge/installation-guide.md
description: >-
Step-by-step guide to install and configure cd_bridge for FiveM. Covers
downloading from CFX Portal, creating the [codesign] folder, correct
server.cfg start order, and auto-detection setup.
---
# Installation Guide
## 1. Download Script
Download the Script from the FiveM Portal Website
1. [**👉 Download cd\_bridge →**](https://portal.cfx.re/assets/granted-assets?search=cd_bridge)
2. Unzip the downloaded file.
3. In your server’s `resources` directory, create a folder named `[codesign]` if it does not already exist.
4. Place **`cd_bridge`** (and all other Codesign scripts) inside the `[codesign]` folder
![]()
Example resources folder with a `[codesign]` directory
## 2. Resource Start Order
Configure `server.cfg` Correctly
***
After placing the script inside the `[codesign]` folder, ensure it starts last.
Add this to the bottom of your `server.cfg`:
`ensure [codesign]`
**Why?**\
`cd_bridge` auto-detects and integrates with frameworks (ESX / QBCore / QBox) and other scripts such as inventory, phone, fuel, vehicle keys, and notifications.
These scripts must start **before** `[codesign]` for detection to work correctly.
Important
***
⚠️ Place `ensure [codesign]` at the very bottom of your `server.cfg`.
![]()
Example server.cfg start order with `[codesign]` loaded last
## 3. Configure Script
Bridge Configuration
***
You should review all configurable options in `cd_bridge/shared/config.lua` to understand what is available.
* We recommend leaving the bridge config as default so it can automatically detect your supported scripts.
* Each config option includes a commented list showing which scripts are supported.
* Only edit these values if you want to manually choose which integration the bridge should use.
---
---
url: /paid-scripts/bridge/troubleshooting-guide.md
description: >-
Troubleshooting guide for cd_bridge with error codes, common issues, QBCore
ACE permissions setup, and auto-detection troubleshooting for FiveM servers.
---
# Troubleshooting Guide
## Error Codes
## ::: info Info
If you encounter an error code not listed below, please open a support ticket in the [Codesign Discord](https://discord.gg/codesign) for assistance.
:::
### Server
**0000** - N/A
### Client
**0000** - N/A
## Common Issues
Please check out our [**Self Debugging Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder is `cd_bridge`.
**Encrypted Files** Do not edit the encrypted files in any way.
::: details **Using QBCore but No Admin Permissions?**
We have confirmed that this issue is caused by **missing or incorrect QBCore ACE permissions** in your `server.cfg`.
Below are the **verified, working permission settings** that should be used to resolve this issue.
**Important:**\
You do **not** need to change any of the permission structure or commands below.
The **only required change** is to replace the placeholder identifiers (`xxxxxx`) with **your own player identifiers** (FiveM ID or license).
Leave everything else exactly as-is unless you fully understand the ACE permission system. The defaults are already configured correctly for QBCore and txAdmin.
```properties
## Permissions ##
add_ace group.admin command allow # allow all commands
{{addPrincipalsMaster}} # This is the way txAdmin assigns permissions to the server owner
# Resources
add_ace resource.qb-core command allow # Allow qb-core to execute commands
# Gods
add_ace qbcore.god command allow # Allow all commands
# Inheritance
add_principal qbcore.god group.admin # Allow gods access to the main admin group used to get all default permissions
add_principal qbcore.god qbcore.admin # Allow gods access to admin commands
add_principal qbcore.admin qbcore.mod # Allow admins access to mod commands
# Players
add_principal identifier.fivem:xxxxxx qbcore.god # Player Name
add_principal identifier.license:xxxxxx qbcore.admin # Player Name
add_principal identifier.license:xxxxxx qbcore.mod # Player Name
```
:::
::: details **Auto-Detect Not Detecting Your Resource**
If auto-detection is not working, it is usually due to one of the following reasons:
1. The resource name has been changed from its default name. Auto-detection relies on default resource names to identify supported integrations.
2. `cd_bridge` is started too early. It must be placed **at the bottom of your `server.cfg`** so it can detect resources that start before it.
Ensure the resource name is unchanged and that `cd_bridge` is started after all frameworks and integrated resources.
:::
---
---
url: /paid-scripts/bridge/resource-integration.md
description: >-
Complete compatibility reference for cd_bridge listing supported frameworks,
databases, banking, billing, dispatch, draw text UI, duty, gangs, HUD,
inventory, mechanics, and notifications.
---
# Resource Integration
### Framework
Handles core server functions such as players, jobs, money, and permissions.
| Script Name | Compatibility type | Notes |
|-------------|----------------------------|------------------------------------------------------------|
| esx | **Built-In (cd\_bridge)** | |
| qbcore | **Built-In (cd\_bridge)** | |
| qbox | **Built-In (cd\_bridge)** | |
| vrp | **Built-In (cd\_bridge)** | |
| standalone | **Built-In (cd\_bridge)** | |
| other | **Major Changes Required** | Framework functions inside cd\_bridge require modification. |
### Database Wrapper
Allows scripts to connect with supported database resources.
| Script Name | Compatibility type | Notes |
| ---------------------------------------------------------- | -------------------------------------------------------------- | ----- |
| [ghmattimysql](https://github.com/vecchiotom/ghmattimysql) | **Built-In (cd\_bridge)** | |
| [oxmysql](https://github.com/overextended/oxmysql) | **Built-In (cd\_bridge)** | |
### Banking
Handles adding transaction logs to supported banking resources.
| Script Name | Compatibility type | Notes |
| ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- | ----- |
| [esx\_banking](https://github.com/esx-framework/ESX-Legacy-Addons/tree/main/[esx_addons]/esx_banking) | **Built-In (cd\_bridge)** | |
| [fd\_banking](https://felis.gg/product/banking) | **Built-In (cd\_bridge)** | |
| okokBanking | **Built-In (cd\_bridge)** | |
| [okokBankingV2](https://okok.tebex.io/package/7144972) | **Built-In (cd\_bridge)** | |
| [omes\_banking](https://github.com/OmesDev/omes_banking) | **Built-In (cd\_bridge)** | |
| [p\_banking](https://pscripts.tebex.io/category/2367228) | **Built-In (cd\_bridge)** | |
| [ps-banking](https://github.com/Project-Sloth/ps-banking) | **Built-In (cd\_bridge)** | |
| [qb-banking](https://github.com/qbcore-framework/qb-banking) | **Built-In (cd\_bridge)** | |
| [Renewed-Banking](https://github.com/Renewed-Scripts/Renewed-Banking) | **Built-In (cd\_bridge)** | |
| [RxBanking](https://rxscripts.xyz/scripts/advanced-banking) | **Built-In (cd\_bridge)** | |
| [tgg-banking](https://www.teamsgg.dev/scripts/banking) | **Built-In (cd\_bridge)** | |
| [tgiann-bank](https://www.tgiann.com/en/package/5222964) | **Built-In (cd\_bridge)** | |
***
### Billing
Handles invoices, fines, and bills between players or jobs.
| Script Name | Compatibility type | Notes |
| ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- | ----- |
| [codem\_billing](https://codem.tebex.io/package/5920201) | **Built-In (cd\_bridge)** | |
| [esx\_billing](https://github.com/esx-framework/ESX-Legacy-Addons/tree/main/[esx_addons]/esx_billing) | **Built-In (cd\_bridge)** | |
| [okokBilling](https://okok.tebex.io/package/5246431) | **Built-In (cd\_bridge)** | |
***
### Dispatch
Sends alerts to supported dispatch and MDT resources.
| Script Name | Compatibility type | Notes |
| -------------------------------------------------------------------- | -------------------------------------------------------------- | ----- |
| [cd\_dispatch](https://codesign.pro/product/4206357) | **Built-In (cd\_bridge)** | |
| [cd\_dispatch3d](https://codesign.pro/dispatch) | **Built-In (cd\_bridge)** | |
| [codem-dispatch](https://codem.tebex.io/package/6354183) | **Built-In (cd\_bridge)** | |
| [core\_dispatch](https://www.c8re.store/package/4462305) | **Built-In (cd\_bridge)** | |
| [esx\_outlawalert](https://github.com/esx-community/esx_outlawalert) | **Built-In (cd\_bridge)** | |
| emergencydispatch | **Built-In (cd\_bridge)** | |
| [lb-tablet](https://lbscripts.com/package/tablet) | **Built-In (cd\_bridge)** | |
| [origen\_police](https://www.origennetwork.store/package/5884106) | **Built-In (cd\_bridge)** | |
| [ps-dispatch](https://github.com/Project-Sloth/ps-dispatch) | **Built-In (cd\_bridge)** | |
| [qs-dispatch](https://www.quasar-store.com/product/dispatch-and-mdt) | **Built-In (cd\_bridge)** | |
| [rcore\_dispatch](https://store.rcore.cz/package/5789351) | **Built-In (cd\_bridge)** | |
| [tk\_dispatch](https://tkscripts.com/product/dispatch) | **Built-In (cd\_bridge)** | |
***
### Draw Text UI
Shows small on-screen interaction text for players.
| Script Name | Compatibility Type | Notes |
| -------------------------------------------------------------------- | -------------------------------------------------------------- | ----- |
| [esx\_textui](https://docs.esx-framework.org/en/esx_core/esx_textui) | **Built-In (cd\_bridge)** | |
| [cd\_drawtextui](https://github.com/dsheedes/cd_drawtextui) | **Built-In (cd\_bridge)** | |
| [jg-textui](https://github.com/jgscripts/jg-textui) | **Built-In (cd\_bridge)** | |
| [okokTextUi](https://okok.tebex.io/package/6024831) | **Built-In (cd\_bridge)** | |
| [ox\_lib](https://github.com/overextended/ox_lib) | **Built-In (cd\_bridge)** | |
| [ps-ui](https://github.com/Project-Sloth/ps-ui/tree/main) | **Built-In (cd\_bridge)** | |
| [qbcore](https://github.com/qbcore-framework) | **Built-In (cd\_bridge)** | |
| [tgiann-core](https://www.tgiann.com/en/package/5869215) | **Built-In (cd\_bridge)** | |
| [vms\_notifyv2](https://www.vames-store.com/package/6637379) | **Built-In (cd\_bridge)** | |
| [ZSX\_UIV2](https://zsx-development.tebex.io/package/5289531) | **Built-In (cd\_bridge)** | |
***
### Duty
Gets and listens for duty changes so Codesign scripts stay updated with the player’s current duty status.
| Script Name | Compatibility type | Notes |
| ----------------------------------------------------------------- | -------------------------------------------------------------- | ----- |
| [core\_multijob](https://www.c8re.store/package/4334089) | **Built-In (cd\_bridge)** | |
| [jobs\_creator](https://fivem.jaksam-scripts.com/package/5369987) | **Built-In (cd\_bridge)** | |
| [origen\_police](https://www.origennetwork.store/package/5884106) | **Built-In (cd\_bridge)** | |
***
### Gang
Gets gang data and listens for gang changes so Codesign scripts stay updated with the player’s current gang.
| Script Name | Compatibility type | Notes |
| -------------------------------------------------------- | -------------------------------------------------------------- | ----- |
| [av\_gangs](https://av-scripts.tebex.io/package/6351957) | **Built-In (cd\_bridge)** | |
| [rcore\_gangs](https://store.rcore.cz/package/4913168) | **Built-In (cd\_bridge)** | |
***
### Hud
Hides or shows supported HUD resources when a Codesign UI is open, so they do not overlap.
| Script Name | Compatibility type | Notes |
| ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- | ----- |
| [0r-hud-v3](https://0resmon.tebex.io/package/0r-hud-v3-11-status-hud-10-speedometer-open-source) | **Built-In (cd\_bridge)** | |
| [17mov\_Hud](https://17movement.net/products/advanced-hud) | **Built-In (cd\_bridge)** | |
| [Codem-BlackHUDV2](https://codem.tebex.io/package/5066843) | **Built-In (cd\_bridge)** | |
| [esx\_hud](https://github.com/esx-framework/ESX-Legacy-Addons/tree/main/[esx_addons]/esx_hud) | **Built-In (cd\_bridge)** | |
| [izzy-hudv5](https://izzy.tebex.io/package/6406984) | **Built-In (cd\_bridge)** | |
| [izzy-hudv6](https://izzy.tebex.io/package/6623038) | **Built-In (cd\_bridge)** | |
| [izzy-hudv7](https://izzy.tebex.io/package/7114787) | **Built-In (cd\_bridge)** | |
| [jg-hud](https://jgscripts.com/scripts/hud) | **Built-In (cd\_bridge)** | |
| [lation\_ui](https://lationscripts.com/product/modern-ui) | **Built-In (cd\_bridge)** | |
| [mHud](https://codem.tebex.io/package/5754650) | **Built-In (cd\_bridge)** | |
| [tgiann-lumihud](https://www.tgiann.com/en/package/6369632) | **Built-In (cd\_bridge)** | |
| [vms\_hud](https://www.vames-store.com/package/5700743) | **Built-In (cd\_bridge)** | |
| [wais-hudv6](https://0resmon.tebex.io/package/6933753) | **Built-In (cd\_bridge)** | |
***
### Inventory
Handles player items, item checks, item metadata, adding items, and removing items.
| Script Name | Compatibility type | Notes |
| --------------------------------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------- |
| [ak47\_inventory](https://menanak47.tebex.io/package/6436604) | **Built-In (cd\_bridge)** | |
| [ak47\_qb\_inventory](https://menanak47.tebex.io/package/6436608) | **Built-In (cd\_bridge)** | |
| [chezza-inventory](https://store.chezza.dev/package/4770357) | **Built-In (cd\_bridge)** | |
| [codem-inventory](https://codem.tebex.io/package/5900973) | **Built-In (cd\_bridge)** | |
| [core\_inventory](https://www.c8re.store/package/5121548) | **Built-In (cd\_bridge)** | |
| [esx](https://github.com/esx-framework) | **Built-In (cd\_bridge)** | *Supports any inventory that uses default qb-core functions* |
| esx\_inventory | **Built-In (cd\_bridge)** | |
| [jaksam\_inventory](https://fivem.jaksam-scripts.com/package/7091785) | **Built-In (cd\_bridge)** | |
| [jpr-inventory](https://jpresources.tebex.io/package/7028437) | **Built-In (cd\_bridge)** | |
| [origen\_inventory](https://www.origennetwork.store/package/5881161) | **Built-In (cd\_bridge)** | |
| [ox\_inventory](https://github.com/overextended/ox_inventory) | **Built-In (cd\_bridge)** | |
| [ps-inventory](https://github.com/Project-Sloth/ps-inventory) | **Built-In (cd\_bridge)** | |
| [qbcore](https://github.com/qbcore-framework) | **Built-In (cd\_bridge)** | *Supports any inventory that uses default esx functions* |
| [qb-inventory](https://github.com/qbcore-framework/qb-inventory) | **Built-In (cd\_bridge)** | |
| [qs-inventory](https://www.quasar-store.com/product/inventory) | **Built-In (cd\_bridge)** | |
| [tgiann-inventory](https://www.tgiann.com/en/package/6273000) | **Built-In (cd\_bridge)** | |
***
### Mechanic
Gets and sets custom vehicle properties used by supported mechanic scripts, and runs any required events or exports when a vehicle is spawned or stored.
| Script Name | Compatibility type | Notes |
| ----------------------------------------------------- | -------------------------------------------------------------- | ----- |
| [cd\_mechanic](https://codesign.pro/mechanic) | **Built-In (cd\_bridge)** | |
| [jg-mechanic](https://jgscripts.com/scripts/mechanic) | **Built-In (cd\_bridge)** | |
***
### Notification
Sends on-screen notifications to players.
| Script Name | Compatibility type | Notes |
| ------------------------------------------------------------------------------ | -------------------------------------------------------------- | ----- |
| [cd\_notifications](https://codesign.pro/notifications) | **Built-In (cd\_bridge)** | |
| [codem-notification](https://codem.tebex.io/package/5399171) | **Built-In (cd\_bridge)** | |
| [codem-supreme-notification](https://codem.tebex.io/package/7211810) | **Built-In (cd\_bridge)** | |
| [esx](https://github.com/esx-framework/esx_core/tree/main/[core]/es_extended) | **Built-In (cd\_bridge)** | |
| [lation\_ui](https://lationscripts.com/product/modern-ui) | **Built-In (cd\_bridge)** | |
| [mythic\_notify](https://github.com/JayMontana36/mythic_notify) | **Built-In (cd\_bridge)** | |
| [okokNotify](https://okok.tebex.io/package/4724993) | **Built-In (cd\_bridge)** | |
| [origen\_notify](https://www.origennetwork.store/package/5913604) | **Built-In (cd\_bridge)** | |
| [ox\_lib](https://github.com/overextended/ox_lib) | **Built-In (cd\_bridge)** | |
| [pNotify](https://github.com/Nick78111/pNotify) | **Built-In (cd\_bridge)** | |
| [ps-ui](https://github.com/Project-Sloth/ps-ui) | **Built-In (cd\_bridge)** | |
| [qbcore](https://github.com/qbcore-framework/qb-core) | **Built-In (cd\_bridge)** | |
| [qbox](https://github.com/Qbox-project/qbx_core) | **Built-In (cd\_bridge)** | |
| [rtx\_notify](https://rtx.tebex.io/package/5402098) | **Built-In (cd\_bridge)** | |
| [tgiann-lumihud](https://www.tgiann.com/en/package/6369632) | **Built-In (cd\_bridge)** | |
| [vms\_notifyv2](https://www.vames-store.com/package/6637379) | **Built-In (cd\_bridge)** | |
| ZSX\_UI | **Built-In (cd\_bridge)** | |
| [ZSX\_UIV2](https://zsx-development.tebex.io/package/5289531) | **Built-In (cd\_bridge)** | |
| [17mov\_Hud](https://17movement.net/products/advanced-hud) | **Built-In (cd\_bridge)** | |
***
### Persistent Vehicles
Sets or unsets a vehicle as persistent when it is spawned or stored.
| Script Name | Compatibility type | Notes |
| ------------------------------------------------------------------------- | -------------------------------------------------------------- | ----- |
| [cd\_garage](https://codesign.pro/product/4206352) | **Built-In (cd\_bridge)** | |
| [AdvancedParking](https://kiminazes-script-gems.tebex.io/package/4287488) | **Built-In (cd\_bridge)** | |
***
### Phone
Gets, sets, and updates player phone numbers for supported phone resources.
| Script Name | Compatibility Type | Notes |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------| ----- |
| [esx\_phone](https://github.com/esx-framework/esx_phone) | **Built-In (cd\_bridge)** | |
| [gcphone](https://github.com/manueljlz/gcphone) | **Built-In (cd\_bridge)** | |
| [gksphone](https://www.gkshop.org/) | **Built-In (cd\_bridge)** | |
| [high-phone](https://phone.high-scripts.com/) | **Built-In (cd\_bridge)** | |
| [lb-phone](https://lbscripts.com/) | **Built-In (cd\_bridge)** | |
| [ns\_Phone](https://store.neutral-studios.com/package/7594856) | **Built-In (cd\_bridge)** | |
| [qb-phone](https://github.com/qbcore-framework/qb-phone) | **Built-In (cd\_bridge)** | |
| [okokPhone](https://okok.tebex.io/package/6123242) | **Built-In (cd\_bridge)** | |
| [qb-phone](https://github.com/qbcore-framework/qb-phone) | **Built-In (cd\_bridge)** | |
| [qbx\_npwd](https://github.com/Qbox-project/qbx_npwd) | **Built-In (cd\_bridge)** | |
| qs-smartphone | **Built-In (cd\_bridge)** | |
| [qs-smartphone-pro](https://www.quasar-store.com/package/5652439) | **Built-In (cd\_bridge)** | |
| [roadphone](https://fivem.roadshop.org/package/4885785) | **Built-In (cd\_bridge)** | |
| [sd-phone](https://fivem.samueldev.shop/phone) | **Built-In (cd\_bridge)** | |
| [yphone](https://teamsgg.dev/scripts/yphone) | **Built-In (cd\_bridge)** | |
| [17mov\_Phone](https://17movement.net/scripts/7107328) | **Built-In (cd\_bridge)** | |
***
### Society
Adds or removes money from job societies after job purchases or payments.
| Script Name | Compatibility type | Notes |
| ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- | ----- |
| [esx\_society](https://github.com/esx-framework/ESX-Legacy-Addons/tree/main/[esx_addons]/esx_society) | **Built-In (cd\_bridge)** | |
| [fd\_banking](https://felis.gg/product/banking) | **Built-In (cd\_bridge)** | |
| okokBanking | **Built-In (cd\_bridge)** | |
| [okokBankingV2](https://okok.tebex.io/package/7144972) | **Built-In (cd\_bridge)** | |
| [p\_banking](https://pscripts.tebex.io/category/2367228) | **Built-In (cd\_bridge)** | |
| [qb-banking](https://github.com/qbcore-framework/qb-banking) | **Built-In (cd\_bridge)** | |
| [Renewed-Banking](https://github.com/Renewed-Scripts/Renewed-Banking) | **Built-In (cd\_bridge)** | |
| [RxBanking](https://rxscripts.xyz/scripts/advanced-banking) | **Built-In (cd\_bridge)** | |
| [tgg-banking](https://www.teamsgg.dev/scripts/banking) | **Built-In (cd\_bridge)** | |
| [tgiann-bank](https://www.tgiann.com/en/package/5222964) | **Built-In (cd\_bridge)** | |
***
### Target
Handles third-eye interaction systems for players.
| Script Name | Compatibility type | Notes |
| ---------------------------------------------------------- | -------------------------------------------------------------- | ----- |
| [ox\_target](https://github.com/overextended/ox_target) | **Built-In (cd\_bridge)** | |
| [qb-target](https://github.com/qbcore-framework/qb-target) | **Built-In (cd\_bridge)** | |
***
### Time & Weather
Syncs time and weather while players are inside a shell.
| Script Name | Compatibility Type | Notes |
| -------------------------------------------------------------------- | -------------------------------------------------------------- | ----- |
| [cd\_easytime](https://github.com/dsheedes/cd_easytime) | **Built-In (cd\_bridge)** | |
| [qb-weathersync](https://github.com/qbcore-framework/qb-weathersync) | **Built-In (cd\_bridge)** | |
| [vSync](https://github.com/DevTestingPizza/vSync/releases) | **Built-In (cd\_bridge)** | |
***
### **Vehicle Fuel**
Gets and sets the vehicle fuel level.
| Script Name | Compatibility Type | Notes |
| --------------------------------------------------------------------- | -------------------------------------------------------------- | ----- |
| [BigDaddy-Fuel](https://bigdaddyscripts.com/Products/View/1988/Fuel) | **Built-In (cd\_bridge)** | |
| [cdn-fuel](https://github.com/CodineDev/cdn-fuel) | **Built-In (cd\_bridge)** | |
| [esx-sna-fuel](https://github.com/Sna-aaa/esx-sna-fuel) | **Built-In (cd\_bridge)** | |
| [FRFuel](https://github.com/thers/FRFuel) | **Built-In (cd\_bridge)** | |
| [lc\_fuel](https://github.com/LeonardoSoares98/lc_fuel) | **Built-In (cd\_bridge)** | |
| [LegacyFuel](https://github.com/InZidiuZ/LegacyFuel) | **Built-In (cd\_bridge)** | |
| [lj-fuel](https://github.com/liberium12/lj-fuel) | **Built-In (cd\_bridge)** | |
| [lyre\_fuel](https://lyrescripts.com/package/5896852) | **Built-In (cd\_bridge)** | |
| [mnr\_fuel](https://github.com/Monarch-Devs/mnr_fuel) | **Built-In (cd\_bridge)** | |
| [myFuel](https://shop.myscripts.eu/package/5502279) | **Built-In (cd\_bridge)** | |
| [ND\_Fuel](https://github.com/ND-Framework/ND_Fuel) | **Built-In (cd\_bridge)** | |
| [okokGasStation](https://okok.tebex.io/package/5751548) | **Built-In (cd\_bridge)** | |
| [ox\_fuel](https://github.com/overextended/ox_fuel) | **Built-In (cd\_bridge)** | |
| [ps-fuel](https://github.com/Project-Sloth/ps-fuel) | **Built-In (cd\_bridge)** | |
| [qb-fuel](https://github.com/qbcore-framework/qb-fuel) | **Built-In (cd\_bridge)** | |
| [qb-sna-fuel](https://github.com/Sna-aaa/qb-sna-fuel) | **Built-In (cd\_bridge)** | |
| [qs-fuelstations](https://www.quasar-store.com/product/fuel-stations) | **Built-In (cd\_bridge)** | |
| [rcore\_fuel](https://store.rcore.cz/package/6222210) | **Built-In (cd\_bridge)** | |
| [Renewed-Fuel](https://renewed.tebex.io/package/5962533) | **Built-In (cd\_bridge)** | |
| [ti\_fuel](https://tebit.tebex.io/package/5266389) | **Built-In (cd\_bridge)** | |
| [x-fuel](https://codem.tebex.io/package/6001598) | **Built-In (cd\_bridge)** | |
***
### Vehicle Keys
Gives and removes vehicle keys from players.
| Script Name | Compatibility Type | Notes |
| -------------------------------------------------------------------------------------| -------------------------------------------------------------------------| ----- |
| [ak47\_vehiclekeys](https://menanak47.tebex.io/package/6204330) | **Built-In (cd\_bridge)** | |
| [ak47\_qb\_vehiclekeys](https://menanak47.tebex.io/package/6204330) | **Built-In (cd\_bridge)** | |
| [cd\_garage](https://codesign.pro/product/4206352) | **Built-In (cd\_bridge)** | |
| [fast-vehiclekeys](https://fastscripts.tebex.io/package/6540865) | **Built-In (cd\_bridge)** | |
| [fivecode\_carkeys](https://fivecode.tebex.io/package/5458905) | **Built-In (cd\_bridge)** | |
| [F\_RealCarKeysSystem](https://f-development.tebex.io/package/5361959) | **Built-In (cd\_bridge)** | |
| [ic3d\_vehiclekeys](https://www.ic3d-spanetplace.com/package/7057516) | **Built-In (cd\_bridge)** | |
| is\_vehiclekeys | **Built-In (cd\_bridge)** | |
| jc\_vehiclekeys | **Built-In (cd\_bridge)** | |
| [loaf\_keysystem](https://github.com/loaf-scripts/loaf_keysystem) | **Built-In (cd\_bridge)** | |
| [mk\_vehiclekeys](https://mankind.tebex.io/package/5423031) | **Built-In (cd\_bridge)** | |
| [mm\_carkeys](https://github.com/SOH69/mm_carkeys) | **Built-In (cd\_bridge)** | |
| [MrNewbVehicleKeys](https://mrnewbscripts.tebex.io/package/6254556) | **Built-In (cd\_bridge)** | |
| [mx\_carkeys](https://mx-script.tebex.io/package/7112856) | **Built-In (cd\_bridge)** | |
| [qb-vehiclekeys](https://github.com/qbcore-framework/qb-vehiclekeys) | **Built-In (cd\_bridge)** | |
| [qbx\_vehiclekeys](https://github.com/Qbox-project/qbx_vehiclekeys) | **Built-In (cd\_bridge)** | |
| qs-vehiclekeys | **Built-In (cd\_bridge)** | |
| [Renewed-Vehiclekeys](https://renewed.tebex.io/package/5885710) | **Built-In (cd\_bridge)** | |
| [stasiek\_vehiclekeys](https://github.com/xxxstasiek/stasiek_vehiclekeys) | **Built-In (cd\_bridge)** | |
| [t1ger\_keys](https://github.com/t1ger-scripts/t1ger-mix-bundle/tree/main/t1ger_keys) | **Built-In (cd\_bridge)** | |
| [tgiann-hotwire](https://tgiann.com/en/package/4891445) | **Built-In (cd\_bridge)** | |
| [ti\_vehiclekeys](https://tebit.tebex.io/package/5189000) | **Built-In (cd\_bridge)** | |
| [vehicle\_keys (jaksam)](https://fivem.jaksam-scripts.com/package/5369990) | **Built-In (cd\_bridge)** | |
| [xd\_locksystem](https://github.com/LielXD/xd_locksystem) | **Built-In (cd\_bridge)** | |
***
### Vehicle Shop
Not used currently.
| Script Name | Compatibility type | Notes |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | -------------- |
| cd\_dealership | **Built-In (cd\_bridge)** | *Coming Soon!* |
| [esx\_vehicleshop](https://github.com/esx-framework/ESX-Legacy-Addons/tree/main/[esx_addons]/esx_vehicleshop) | **Built-In (cd\_bridge)** | |
| [jg-dealerships](https://jgscripts.com/scripts/dealerships) | **Built-In (cd\_bridge)** | |
| [okokVehicleShop](https://okok.tebex.io/package/4874585) | **Built-In (cd\_bridge)** | |
| [qb-vehicleshop](https://github.com/qbcore-framework/qb-vehicleshop) | **Built-In (cd\_bridge)** | |
| [qbx-vehicleshop](https://github.com/Qbox-project/qbx_vehicleshop) | **Built-In (cd\_bridge)** | |
| [qs-vehicleshop](https://www.quasar-store.com/product/vehicle-shop-creator) | **Built-In (cd\_bridge)** | |
| [vms\_vehicleshopv2](https://www.vames-store.com/package/6153182) | **Built-In (cd\_bridge)** | |
***
---
---
url: /paid-scripts/bridge/changelog.md
description: >-
The existing frontmatter description, icon, and changelog key remain. This
file tracks all cd_bridge version updates, new features, fixes, and
compatibility improvements.
---
# Changelog
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
## v1.0.42
## ::: info Changes
* Added additional debug messages for the configuration database and UI loading process.
* The job label is now passed when creating a society account with Renewed Banking.
:::
## ::: warning Fixes
* Fixed the client-side AUTOFIX print function.
:::
## v1.0.41
## ::: warning Fixes
* Fixed incorrect data being sent through the `CreateJobAccount` export when using Renewed Banking.
* Fixed the `AddTransaction` export error when using okokBanking V1.
:::
## v1.0.40
## ::: warning Fixes
* Fixed HUD visibility not being restored when restarting scripts through the bridge.
:::
## v1.0.39
## ::: tip Added
* Added a Medal automatic clipping event for use in Codesign scripts.
:::
## ::: info Changes
* Significantly improved the bridge SQL debug messages to make them easier to read.
:::
## ::: warning Fixes
* Fixed issue with `okokBanking` being named okokBankingV2 in bridge.
* Fixed an error with the `GetMileage` export in `cd_mechanic`.
* Fixed an error when using `SendAlert` with `origen_police`.
* Disabled custom duty checks server-side when using `origen_police` with QBCore or Qbox, as the required export for checking its custom duty state is only supported on ESX.
:::
## v1.0.38
## ::: tip Added
* Added the `GetVehicleMileage` function to retrieve vehicle mileage from supported mileage scripts.
:::
## v1.0.37
## ::: info Changes
* Updated the `SpawnNetworkedVehicle` function to force the heading value to a decimal, fixing issues where headings were not set correctly when passed as an integer.
:::
## v1.0.36
## ::: info Changes
* Minor improvments.
:::
## v1.0.34
## ::: tip Added
* Added `AddMoneyToOfflinePlayer` function.
:::
## ::: info Changes
* Moved version checking from individual scripts into the bridge, so all version checks are now handled in one place.
:::
## v1.0.30
## ::: warning Fixes
* Fixed issue with okokBanking being named okokBankingV2 in bridge.
* Fixed GetPlayerInfo error relating to dispatch function in bridge.
:::
## v1.0.29
## ::: info Changes
* Various internal changes
:::
## v1.0.28
## ::: tip Added
* Added new function `IsVehicleInAreaWithinDistance`.
* Added new function `GetPedHeadshot`.
* Added support for `okokBanking` v1 (Cfg.Society).
:::
## ::: warning Fixes
* Fixed error causing job grade to be nil on ESX.
* Fixed a typo in the server banking DB function for `ps-banking` integration.
* Fixed an issue where the door lock icon in `cd_doorlock` was blank.
* Fixed an error on Qbox when retrieving all jobs data.
* Fixed the get society functions in `Renewed Banking`.
* Fixed the get society functions in `fd_banking`.
:::
## v1.0.27
## ::: tip Added
* Added support for `jpr-inventory` (Config.Inventory).
* Added support for `esx_textui` (Config.DrawTextUi).
* Added support for `lation_ui` (Config.Notification and Config.DrawTextUi).
:::
## ::: info Changes
* As always more updates to the built-in debug and error handling system.
* Moved duplicate inventory functions into a new shared file `(shared_inventory_functions.lua)`.
* Re-added `ps-inventory` to the config and auto-detect.
:::
## ::: warning Fixes
* Fixed an issue where the job grade was nil on ESX.
* Fixed issues with `wais-hudv6` not showing and hiding the HUD correctly.
* Fixed issues with the QB version of `ak47_inventory` not working correctly.
* Fixed a typo in the DB function where Exec was nil (corrected to exec).
:::
## v1.0.26
```bash [Files Changed]
Full Folder Changed, All Files Except Config
```
## ::: tip Added
* Added support for `core_multijob` (Config.Duty).
* Added support for `ic3d_vehiclekeys` (Config.vehicleKeys).
* Added automatic detection of supported resources at any time; when a resource starts or stops, the bridge reconfigures itself accordingly.
* Added new function `GetClosestPlayersCharacterInfo`, which returns the character name and source of the closest players within a set distance.
* Added new function `GetItemList()` to retrieve all items on the client side.
* Added new function `NormalizeVehiclePlate()` to convert standard 8-character plates with spaces into a compatible, standardised format.
:::
## ::: info Changes
* Added locales to the error handling system for all supported languages in the bridge.
* Further updates to the built-in debug and error handling system.
* Huge improvements to all inventory item metadata and item quality/durability for all 13 supported inventories, making it easier to manage and handle both.
* Improved built-in compatibility with all Codesign scripts across the ecosystem.
* Updated the `WaitForEntityFromNetId` function to be available on both client and server, allowing it to wait for an entity from a net ID or timeout.
:::
## ::: warning Fixes
* Fixed `esx_society` and `esx_addonaccount` errors when getting society data.
* Fixed `GetVehicleProperties` and `SetVehicleProperties` not working on qbox.
* Fixed notification titles displaying "Title"; they now show the resource name (e.g. "Dispatch").
* Fixed client-side job grade label retrieval on esx.
* Fixed `cd_notifications` not being auto-detected correctly.
* Added the ability to prevent the HUD from reopening certain UIs when they should remain hidden.
:::
## v1.0.25
## ::: danger File Removed
`cd_bridge/server/integrations/notifications.lua`
:::
## ::: tip Added
* Added `tgiann-lumihud` support for HUD and notifications.
* Added support for 3 new vehicle key systems: `fast-vehiclekeys`, `is_vehiclekeys`, `mm_carkeys`.
* Added support for `RxBanking`.
* Added new client-side `dead_cuffed_dragged` system to support police, job creator, and ambulance scripts, preventing UI usage when a player is dead, cuffed, or being dragged.
* Added new server side function `BanPlayer` (only works on Qbcore and QBox).
:::
## ::: info Changes
* Bridge now hides draw text alongside player and vehicle HUDs when opening a Codesign UI to prevent overlapping UI's.
:::
## ::: warning Fixes
* Fixed issue where the HUD disappeared instead of reappearing due to inverted logic.
* Fixed issue with `codem-blackhudv2` HUD showing when it should hide and hiding when it should show.
* Fixed errors with standalone server-side `GetAdminPerms` and `HasAdminPerms`.
* Fixed symbols not being fully removed from `ox_lib` draw text.
:::
***
## v1.0.24
## ::: tip Major Integration & Compatibility Update
**(NEW) Banking Support (13 added)** *(used for logging transactions in Codesign scripts)*\
`esx`, `esx_banking`, `fd_banking`, `okokBanking`, `okokBankingV2`, `omes_banking`, `p_banking`, `ps-banking`, `qb-banking`, `qbcore`, `Renewed-Banking`, `tgg-banking`, `tgiann-bank`
**(NEW) Billing Support (3 added)**\
`codem_billing`, `esx_billing`, `okokBilling`
**Dispatch Support (11 added)**\
`cd_dispatch`, `cd_dispatch3d`, `codem-dispatch`, `core_dispatch`, `emergencydispatch`, `lb-tablet`, `origen_police`, `ps-dispatch`, `qs-dispatch`, `rcore_dispatch`, `tk_dispatch`
**Duty System Support (2 added)**\
`jaksam jobs_creator`, `origen_police`
**(NEW) HUD Support (13 added)** *(player & vehicle HUDs can now be hidden when opening Codesign UI)*\
`0r-hud-v3`, `17mov_Hud`, `cd_carhud`, `cd_playerhud`, `Codem-BlackHUDV2`, `esx_hud`, `izzy-hudv5`, `izzy-hudv6`, `izzy-hudv7`, `jg-hud`, `mHud`, `vms_hud`, `wais-hudv6`
**Inventory Support (5 added)**\
`ak47_inventory`, `core_inventory`, `jaksam_inventory`, `origen_inventory`, `ps-inventory`
**Notification Support (6 added)**\
`17mov_Hud`, `codem-notification`, `codem-supreme-notification`, `rtx_notify`, `ZSX_UI`, `ZSX_UIV2`
**Phone Support (3 added)**\
`high-phone`, `roadphone`, `yseries`
**(NEW) Society Support (8 added)**\
`esx_society`, `fd_banking`, `okokBankingV2`, `p_banking`, `qb-banking`, `Renewed-Banking`, `tgg-banking`, `tgiann-bank`
**Vehicle Keys Support (2 added)**\
`mx_carkeys`, `Renewed-Vehiclekeys`
**(NEW) Vehicle Shop Support (WIP)**\
`cd_vehicleshop`, `esx_vehicleshop`, `jg-dealerships`, `okokVehicleShop`, `qb-vehicleshop`, `qbx-vehicleshop`, `qs-vehicleshop`, `vms_vehicleshopv2`
:::
## ::: tip New Systems / Features
* Added **permission system for standalone servers** using: FiveM identifiers, & Badger Discord permissions.
* Added **character switch detection** using framework player unload/logout events.
* Added **txAdmin restart server support** so scripts handle scheduled restarts correctly.
* Added support for **plate change** in inventories that support it.
:::
## ::: tip New Functions
* `GetVehicleLabel` Retrieves vehicle label from script data, falling back to the default GTA vehicle name.
* `GetAllOnlinePlayersWithSameJob`
* `GetPlayerMoney` *(client side)*
* `GetIdentifier` *(client side)*
* `IsPlayerDeadOrCuffed`\
Supports:
* Framework death states
* `origen_police` cuffs
* `jaksam jobs_creator` cuffs
:::
## ::: info Changes
* `ox_lib` text UI symbols are now automatically removed.
* **Late resource detection warning removed** — this is now automatically fixed without user interaction.
:::
## v1.0.23
## ::: tip Added
* **Remote Error Reporting:** Added a centralized debugging system that collects all server error codes and sends them directly to our Discord when initiated by an authorized server owner. This allows the Codesign team to view complete error logs during support tickets, eliminating the need for screenshots and speeding up troubleshooting.
* **Remote Debug Reporting:** Added centralized reporting for debug logs, allowing authorized server owners to send full debug output directly to our Discord for faster support resolution.
* Added a server → client → server callback system.
* Added `Cfg.Banking` to add compatibility for Banking scripts, starting with `Renewed-Banking` and `okokBankingV2`.
* Added `Cfg.Society` to add compatibility with Societys, currently compatible with `esx_addonaccount`, `qb-banking`, `Renewed-Banking` and `okokBankingV2`.
* Added `Cfg.Mechanic` to add compatibility with mechanic scripts, starting with `cd_mechanic`.
* Added new file `client/framework/framework_functions.lua` and `server/framework/framework_functions.lua` to handle all generic shared framework functions.
:::
## ::: info Changes
* Persistent vehicles are now unregistered in the `DespawnNetworkedVehicle` function.
* Added debug print of player identifiers when admin permissions are missing.
* Late resource detection now automatically resolves the issue instead of requiring manual fixes.
:::
## ::: warning Fixes
* Fixed incorrect formatting in QBox `GetSourceFromIdentifier` function.
* Fixed ESX errors when spawning vehicles outside of a players OneSync scope.
* Fixed a typo in `shared/auto_detect.lua` causing script error.
* Improved method for forcing passengers to exit a vehicle when storing.
* Fixed `Draw3DText` error.
:::
***
## v1.0.22
## ::: tip Added
* Added `RemoveVehicleKeys` support to vehicle key integrations *(not all key systems support external key removal)*.
* Added `Cfg.Gang` for custom gang scripts (better compatibility and debugging).
* Added `Cfg.Duty` for resources which use their own job duty system (better compatibility and debugging).
:::
## ::: info Changes
* Improved locales handling.
:::
## ::: warning Fixes
* Fixed QBCore `GiveWeapon` function issues.
:::
## v1.0.21
```bash [Files Changed]
Full Folder, All Files Except config.lua
```
## ::: tip Added
* Added support for `av_gangs`.
* Added support for `tgiann-core` draw text ui.
* Added support for `17mov_Phone`.
:::
## ::: warning Fixes
* Fixed `Cfg.DisableDuty` not working on client side.
:::
## v1.0.20
```bash [Files Changed]
Full Folder, All Files Except config.lua
```
## ::: tip Added
* Added various new functions such as `TeleportEntity`, `GetCharacterName()` (client-side) and `HasPlayerLoaded` (client-side).
* Added new export `ReadNUIDirectory`.
:::
## ::: info Changes
* Further improvements to the built-in debug system to detect client–server character information mismatches.
* Excluded all cd\_ scripts from late resource start warnings.
:::
## ::: warning Fixes
* Fixed Cfg.DisabledDuty not working on client side.
:::
## v1.0.19
```bash [Files Changed]
Full Folder, All Files Except config.lua
```
## ::: tip Added
* Added various new commonly used utility functions.
* Added support for `ZSX_UIV2` notifications and text ui.
* Added new file for persistent vehicle compatibility.
* Added late resource start detection to warn when integrated resources start after `cd_bridge`, preventing auto-detection.
:::
## ::: info Changes
* Updated the locales.
* Removed mysql-async compatibility.
:::
## ::: warning Fixes
* Fixed `qbx_vehiclekeys` key-giving event.
* Fixed esx default inventory not getting item labels correctly.
* Fixed client side `HasAdminPerms` function.
:::
***
## v1.0.18
```bash [Files Changed]
All Files Except config.lua
```
## ::: tip Added
* Add `Cfg.DisableDuty`. Use `Cfg.DisableDuty` to completely disable duty handling. When enabled, the script will ignore your framework's built-in duty system and operate without any duty checks. Enable this if you do not use a duty system or want duty to always be treated as active.
:::
## ::: info Changes
* Expanded the server-side `HasJob` function to support job-grade–only permission checks and multiple job grade formats.
:::
## ::: warning Fixes
* Fixed the `okokPhone` get phone number export.
* Added extra safety checks for `GetVehicleModelHash`.
:::
## v1.0.17
```bash [Files Changed]
All Files Except config.lua
```
## ::: tip Added
* Added support for `mnr_fuel`.
* Added support for `lyre_fuel`.
* Added `GetVehicleModelHash` function to support multiple vehicle model input formats.
:::
## v1.0.16
```bash [Files Changed]
All Files Except config.lua
```
## ::: tip Added
* Added support for `qs-fuelstations`.
* Added support for `tgiann-inventory`.
:::
## ::: info Changes
* Cache SharedVehicles instead of calling multiple times.
* Expanded the HasJob function to support additional input formats.
:::
## ::: warning Fixes
* Fixed wrong resource name for `okokVehicleShop` in custom vehicle data.
* Fixed a typo in the `cd_bridge:OnGangChanged` event.
:::
## v1.0.15
```bash [Files Changed]
All Files Except config.lua
```
## ::: tip Added
* Added server-side `vehicle_functions` file containing `GetAllPossiblePlates`, `IsVehicleOwned`, and `DoesPlayerOwnVehicle`.
* Added `GetLicenseIdentifier`, `CanCarryItem` and `AddWeapon` functions.
:::
***
## v1.0.14
```bash [Files Changed]
Full Folder, All Files Except config.lua
```
## ::: tip Added
* Added support for okokvehicleshop by fetching data directly from its vehicle database.
* Added function GetKeyMappingKeyLabel.
* Default Config.Language to EN if no locales found in LocalesTable.
:::
## v1.0.13
```bash [Files Changed]
Full Folder, All Files Except config.lua
```
## ::: tip Added
* Added new functions: SetCallisgn, GetClosestPlayer, GetClosestPlayers, InVehicle, GetClosestVehicle, GetVehiclesInArea, GetDefaultVehicleLabel, IsVehicleEmpty, CapitalizeFirst, IsBlankString
:::
## ::: info Changes
* Job, gang, and duty state changes are now handled more reliably.
* Player loaded handling has been improved to be more consistent and predictable.
:::
## ::: warning Fixes
* Fixed the native 7239b21a38f536ba errors on qbcore/qbox.
:::
## v1.0.12
## ::: warning Fixes
* Fixed cd\_garage vehicle keys detection.
* Fixed qbcore drawtextui.
:::
## v1.0.11
```bash [Files Changed]
Full Folder, All Files Except config.lua
```
## ::: tip Added
* Added new function `GetSourceFromIdentifier`.
* Added support for rcore gangs.
:::
## ::: warning Fixes
* Fixed JobChanged error.
* Fixed and improved the player loaded code for triggering server cache events.
:::
## v1.0.10
## ::: info Changes
* Improved the logic of framework code.
:::
## v1.0.9
## ::: danger Folder Reorganization
Make sure to completely delete the old `cd_bridge` folder before adding the new one.
:::
## ::: tip Added
* Added `ReadDirectory` export to read a directory and retrieve all file data.
:::
## ::: info Changes
* Re added the AddItem inventory function.
* Added caching for the get all inventory items function to improve performance.
:::
## v1.0.8
## ::: info Changes
* Added clearer debug prints
:::
## ::: warning Fixes
* Fixed qbcore job data being nil when joining after a server restart.
* Fixed qbox job data being nil when joining after a server restart.
* Fixed the DB error on start up when using esx framework.
* Fixed callback error when Cfg.BridgeDebug is enabled.
:::
## v1.0.6
## ::: tip Added
* Added "other" framework option to allow the easier integration of custom frameworks.
* Added "other" option for inventory, drawtext, notifications, vehicle fuel and vehicle keys.
* Removed the need for ox\_lib to be in the fxmanifest (easier installation).
* Added GetSharedVehicles(), which stores vehicle data for all frameworks.
* Added Keys table to config.
:::
## ::: warning Fixes
* Fixed vehicle fuel functions not using config set values.
:::
## v1.0.5
```bash [Files Changed]
Full Folder, All Files Except config.lua
```
## ::: warning Fixes
* Fixed QBCore admin perms checks.
* Fixed QBCore get job name and get job grade checks on client side.
* Fixed /bridgedebug qbcore perms not print correctly due to being table.
* Added GetGangName, GetGangLabel and GetGangGrade functions.
:::
## v1.0.3
## ::: tip Added
* Improved debug features and prints
:::
## ::: warning Fixes
* Various minor fixes
* Fixed multiple qbox resource detection issues
:::
---
---
url: /paid-scripts/garage.md
description: >-
FiveM vehicle garage system with multi-location support, full vehicle
management, developer API, and cd_bridge integration for ESX, QBCore, and QBox
frameworks.
---
# Garage
[**Buy Here**](https://codesign.pro/product/4206352)
[**FiveM Forums Post**](https://forum.cfx.re/t/release-paid-vehicle-garage-by-codesign/1900453)
[**YouTube Showcase Video**](https://www.youtube.com/watch?v=nwHE1_pYNPA)
## 📘 Start Here
* [**Installation Guide**](installation-guide.md)\
Step-by-step setup and configuration.
* [**Configuration**](features.md)\
All optional features that can be enabled in config explained.
* [**Compatibility**](resource-integration/)\
What’s built-in vs needs changes.
### 🔧 Developer Reference
* [**Chat Commands**](developer-api/chat-commands.md)\
Player & staff commands with usage examples.
* [**Events**](developer-api/events.md)\
Triggerable events (client/server) with Lua examples.
* [**Exports**](developer-api/exports.md)\
Optional functions to integrate cd\_garage with other scripts.
* [**Keys & Controls**](developer-api/keys.md)\
Default keybinds and interaction methods.
* [**Items**](developer-api/items.md)\
Default items and item-based interaction methods.
### 🧠 Need Help?
* [**Troubleshooting Guide**](troubleshooting-guide.md)\
Common issues and error codes.
* **Support:** Join our Discord –
### 💡 Developer Notes
* Keep integrations simple: use provided **Exports** and **Events**.
* All code samples are **Lua**, beginner-friendly, and copy/paste ready.
* Prefer **auto-detect** config options where available.
---
---
url: /paid-scripts/garage/installation-guide.md
description: >-
Step-by-step installation guide for cd_garage. Covers cd_bridge dependency,
download from CFX Portal, configuration, and key bind setup for FiveM.
---
# Installation Guide
## Installation video
{% youtube HHkdvehjw5U %}
*If you are getting stuck on any of the steps feel free to follow the video guide*
***
### 1. Codesign Bridge
## ::: warning Note
**This script requires `cd_bridge` to be installed and running before it can function**
:::
**`cd_bridge`** is plug-and-play and requires no setup. It automatically handles:
* Framework integration
* Database setup
* Script compatibility
* Error Handling
Once started, it will detect and connect to all supported scripts automatically.
[**See the \[Full Bridge Setup Guide\]**](https://docs.codesign.pro/paid-scripts/bridge/installation-guide)
***
### 2. Download Script
**Download the Script from the FiveM Portal Website**
1. [**Download cd\_garage →**](https://portal.cfx.re/assets/granted-assets?search=cd_garage)
2. Unzip the downloaded file
3. In your server's `resources` directory, create a folder named `[codesign]` if it does not already exist
4. Place **`cd_garage`** (and all other Codesign scripts ) inside the **`[codesign]`** folder
![]()
Example resources folder with a `[codesign]` directory
***
### 3. Install Dependencies
**Required & Optional Dependencies**
* Dependencies are either included in **`[cd_garage/dependencies]`** or have a text file with a download link (GitHub/Cfx Portal).
* Place them in your server's **`[codesign]`** folder
* Do not place them inside the `cd_garage` folder
* Required dependencies start automatically
| Resource Name | Download | Required | Details |
|--------------------|------------------------|----------|---------------------------------------------|
| **cd\_garageshell** | cd\_garage/dependencies | true | Only required if you use the inside garages |
| **cd\_drawtextui** | Github | false | Optional draw-text UI |
| **cd\_keymaster** | Github | false | Optional vehicle lockpicking mnigame |
***
### 4. Database Setup (SQL)
**No manual SQL setup required.**
The script automatically inserts all required database tables.
```lua
Config.AutoInsertSQL = true
```
Make sure this is enabled in `cd_garage/configs/config.lua`.
***
### 5. Configure Script
**Review the `config.lua` Settings**
* First, review and edit **`cd_garage/configs/config.lua`**.
* Start the resource.
* Use **`/garageconfig`** in-game to finish the remaining garage settings.
***
### 6. Create Garage Locations
**Set Up Locations In-Game**
* Use `/garageconfig` in-game to create garage locations.
* You can create public garages, private garages, job garages, gang garages, and impounds.
* Existing locations can also be edited or deleted through the same UI.
***
### 7. Migrate Your Old Locations
**Import Locations from v5**
* Keep a copy of your old v5 `config.lua`.
* Start the resource and use `/garageconfig` in-game.
* Use the M**igration Tab** to import your old public, private, job, gang, and impound locations.
---
---
url: /paid-scripts/garage/troubleshooting-guide.md
description: >-
Troubleshooting guide for cd_garage with common issues, error codes, and
solutions for the FiveM vehicle garage system.
---
# Troubleshooting Guide
## Error Codes
## ::: info Info
If you encounter an error code not listed below, please open a support ticket in the [Codesign Discord](https://discord.gg/codesign) for assistance.
:::
### Server
* **5111** - This warning appears when `Config.UseExploitProtection` is disabled. It likely means the `model` variable in the `vehicle/mods` column is missing for a player's vehicle. This could be caused by a faulty vehicle shop or, less commonly, a player using a cheat engine. To fix it, delete the vehicle or manually add the plate in the JSON file.
```sql [ESX]
SELECT * FROM owned_vehicles WHERE JSON_EXTRACT(vehicle, '$.model') IS NULL;
```
```sql [QBCore / QBox]
SELECT * FROM owned_vehicles WHERE JSON_EXTRACT(vehicle, '$.model') IS NULL;
```
### Client
## Common Issues
Please check out our [**Self Debugging Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder is `cd_garage`.
**Escrowed Files** Do not edit the escrowed files in any way.
### Screen Flickering?
::: details **Screen Flickering?**
**Example:** If your screen is flickering while using cd\_easytime.
**Reason:** This is due to you having multiple time/weather sync scripts running at the same time fighting each other eg., vSync or vMenu.
**Solution:** Stop the other time/weather script that is causing this or stop cd\_easytime and remove it from the dependencies in the fxmanifest.lua of cd\_garage.
:::
### RGB Colours Not Saving Correctly?
::: details **RGB Colours Not Saving Correctly?**
**Example:** If your vehicles RGB colours are not saving when you store a vehicle or not applying when spawning a vehicle in the garage.
**Reason:** This is because you have not made the changes to your frameworks `GetVehicleProperties()` and `SetVehicleProperties()` functions that your mechanic/customs resource requires you to do.
**Solution:** Make required changes to `GetVehicleProperties()` and `SetVehicleProperties()` according to your mechanic/customs resource.
:::
### Item(s) Not Found In Inventory Database Table:
::: details **Item(s) Not Found In Inventory Database Table:**
**Example:** If you get an error when the script or server start with the name of an item, such as `fakeplate`.
**Reason:** You have enabled `Config.FakePlates` but the fake plate item has not been added to your servers items.
**Solution:** The error message tells you the name of the item that is missing, add it to your servers items.
:::
### Configurator UI Stuck Loading
::: details **Configurator UI Stuck Loading**
**Example:** If the configurator UI is stuck loading, check your client F8 console for an error like this:

**Reason:**
* The default los\_santos.webp image is around 14MB.
* Some GPUs may not have enough VRAM to load it correctly.
**Solution:**
* Download the lower-quality version of the image.
* Replace the los\_santos.webp file inside: cd\_garage/html/images/map
---
---
url: /paid-scripts/garage/features.md
description: >-
Features overview for cd_garage including vehicle storage, multiple garage
types, impound system, key system, and house garage integration for FiveM.
---
# Features
### Boat & Air garages
**How Do Boat & Air Garages Work?**
When a player purchases a boat or aircraft, you'll need to update the **garage\_type** field in the database for that vehicle.
## ::: tip Resource Integrations
**Using boat, helicopter, or plane garages?**\
[Follow these setup guides to make selected scripts add non-car vehicles correctly](resource-integration/integration-guides.md)
**Need vehicle type events?**\
Use these events to let other scripts register boats, helicopters, or planes with the correct garage vehicle type
[View UpdateGarageType Event](developer-api/events.md#update-garage-type)
:::
::: info
If your server doesn't use boats or aircraft, you can skip this step, the default **garage\_type** is set to **"car"**.
:::
::: details Option 1: SQL Method (Server-Side)
Ideally, the **garage\_type** should be set in the same SQL query that adds the vehicle to the database when it's purchased for example, in your vehicle shop script.
The **garage\_type** value must be a **string** and can only be one of the following:
* `'car'`
* `'boat'`
* `'heli'`
* `'plane'`
For example, to make a boat appear in the **boat garage**, edit the SQL query in your vehicle shop to insert `'boat'` into the **garage\_type** column of the **owned\_vehicles** or **player\_vehicles** table.\
Do the same with `'air'` for aircraft.
You don't need to do this for cars or bikes the default **garage\_type** is already set to `'car'`.
:::
::: details Option 2: Event Method (Client-Side)
You can trigger this **client-side event** to automatically update the **garage\_type** in the **owned\_vehicles/player\_vehicles** database table.
```lua
TriggerEvent('cd_garage:UpdateGarageType')
```
This event is triggered from the **client side** but handled on the **server**, meaning you can call it after a player purchases a vehicle to ensure the correct garage type is saved automatically.
:::
***
### Custom vehicle logos
*Credits to @Baby Amnesia for making this tutorial.*
***
### Fake Plates
**How Do Fake Plates Work?**
* Set the usable fake plate item name in the in-game Config UI.
* Stand near a vehicle you own and use the fake plate item.
* A random new plate will be generated and added to the vehicle.
* The fake plate is saved and will stay on the vehicle until it is removed.
* The vehicle owner or allowed jobs, such as police, can remove the fake plate using `/removefakeplate`.
## ::: warning Built-in Vehicle Keys Required
Fake plates only work with the built-in vehicle key system.
:::
***
### Gang Garages
**How Do Gang Garages Work?**
* Gang garages let gang members share access to stored vehicles.
* When a player stores their personal vehicle in a gang garage, other members of the same gang can take it out and use it.
* The vehicle stays available to the gang until the owner takes it out and stores it back in their personal garage.
* Other gang members cannot store another player's vehicle in their own personal garage.
## ::: warning Disabled on ESX
* Gang garages are only available on QBCore or QBox.
* ESX treats gangs as normal jobs, so gang garages are not used.
* If you use ESX, use job garages for gang-related vehicles instead.
:::
### Garage Slots
**How do garage slots work?**
* Garage slots let you control how many vehicles a player can own.
* You can enable garage slots to set a maximum vehicle limit for each player.
* Players can buy extra slots on the UI at any public garage location.
* You can set the price for extra slots in the config.
* Players can check how many slots they have on the UI at any garage location.
::: details **Usage Example (Server-Side Only)**
Place this code in your **vehicle shop resource**.\
It checks if a player has enough garage slots before allowing them to buy another vehicle.
```lua
if exports['cd_garage']:GetGarageCount(source, 'car') + 1 <= exports['cd_garage']:GetGarageLimit(source) then
print('allow purchase') -- Player has space, allow the purchase
else
print('garage limit reached') -- Player is at their limit, deny the purchase
end
```
**What does this code do?**
* `GetGarageCount(source, 'car')` checks how many cars the player currently owns.
* `GetGarageLimit(source)` checks how many garage slots the player is allowed to have.
* The code adds `+1` to include the vehicle the player is trying to buy.
* If the new total is still within the player's garage limit, the purchase is allowed.
* If the player has reached their limit, the purchase is blocked and shows:
`garage limit reached`
:::
***
### Job Garages
**How do job garages work?**
* Job garages can be set up in three different ways.
* Each garage location can use a different job garage method.
* Choose the method based on how you want job vehicles to be owned and shared.
* This garage script does not include any way to purchase job vehicles.
* If you use **Personal Owned** or **Society Owned** vehicles, you must handle the vehicle purchase/setup yourself.
## ::: tip Resource Integrations
**Using job garages?**\
[Follow these setup guides to make selected scripts add job vehicles correctly](resource-integration/integration-guides.md#job-garage)
**Need job vehicle events?**\
[View SetJobOwnedVehicle Event](developer-api/events.md#set-job-owned-vehicle)
:::
**Job Garage Methods**
**Regular**
* Shared job vehicles that are spawned from the garage.
* These vehicles are not owned by any player or society.
* No database vehicle setup is needed.
**Personal Owned**
* Job vehicles owned by individual players.
* Only the vehicle owner can access their own job vehicle from the job garage.
**Society Owned**
* Job vehicles owned by the job/society.
* Any allowed member of that job can access and use them.
| Method | Ownership | Access | Saved In Database | Best Used For |
|--------------|----------------------------------------|------------------------------|-------------------|------------------------------------------|
| **Regular** | None, vehicles are spawned, not owned. | All players with the job. | false | Shared or temporary job vehicles. |
| **Personal** | Owned by the player. | Only the vehicle owner. | true | Employee-owned job vehicles. |
| **Society** | Owned by the job. | All members of the same job. | true | Shared company or organization vehicles. |
#### Setup: Regular Job Vehicles
* Shared job vehicles that are added and configured in the in-game Config UI.
* These vehicles are managed from the **Job Locations** page.
#### Setup: Personal-Owned Job Vehicles
::::details **SQL (preferred)**
* Set this value in the same SQL query that creates the vehicle after purchase.
* Table: `owned_vehicles` or `player_vehicles`
* Column: `job_personalowned`
* Value: the player's job name as text
[**View Example**](https://docs.codesign.pro/paid-scripts/garage/resource-integration/esx#personal-owned-job-garage)
```sql
local plate = 'ABCD1234'
local job = 'police'
exports.oxmysql:execute('UPDATE player_vehicles SET job_personalowned=@job WHERE plate=@plate', {
['@job'] = job,
['@plate'] = plate
})
```
::: info
The examples above are from a QBCore server. The SQL query or database structure may be different depending on your framework.
:::
::::
::: details **Event**
You can also assign the vehicle you are sitting in as a personal owned job vehicle using this event.
[**View SetJobOwnedVehicle Event**](https://docs.codesign.pro/paid-scripts/garage/developer-api/events#set-job-owned-vehicle)
:::
#### Setup: Society Owned Job Vehicles
::::details **SQL (preferred)**
* Set this value in the same SQL query that creates the vehicle after purchase.
* Table: `owned_vehicles` or `player_vehicles`
* Column: `job_societyowned`
* Value: a table/list of allowed job names
[**View Example**](https://docs.codesign.pro/paid-scripts/garage/resource-integration/esx#personal-owned-job-garage)

**This image shows how the `owned_vehicles / player_vehicles` database table should look for a society owned job vehicle.**
```sql
local plate = 'ABCD1234'
local job = {
'police',
'sheriff',
'bcso'
}
exports.oxmysql:execute('UPDATE player_vehicles SET job_societyowned=@job WHERE plate=@plate', {
['@job'] = json.encode{job},
['@plate'] = plate
})
```
::: info
The examples above are from a QBCore server. The SQL query or database structure may be different depending on your framework.
:::
::::
::: details **Event**
You can also assign the vehicle you are sitting in as a society owned job vehicle using this event.
[**View SetJobOwnedVehicle Event**](https://docs.codesign.pro/paid-scripts/garage/developer-api/events#set-job-owned-vehicle)
:::
### Persistent Vehicles
**How do persistent vehicles work?**
* Persistent vehicles are saved and respawned automatically if they despawn.
* They can also respawn after a player leaves and rejoins the server.
* By default, only vehicles spawned from the garage are persistent.
* Other vehicles can be made persistent using the events below.
* A vehicle’s position is saved to cache after it stays still for more than 5 seconds. It is not saved to the database straight away.
* Persistent vehicles are saved to the database when the resource stops, restarts, or during a scheduled txAdmin restart.
## ::: tip Resource Integrations
**Using built-in persistent vehicles?**
[Follow these setup guides to make selected scripts delete vehicles correctly](https://docs.codesign.pro/paid-scripts/garage/resource-integration/esx#add-keys-server-side)
**Using another persistent vehicle script?**
[View persistent vehicle scripts that already work through our bridge](https://docs.codesign.pro/paid-scripts/garage/resource-integration)
**Integration Events**
Use these events to make other scripts work with the built-in persistent vehicle system.
[View Add Persistent Vehicle Event](https://docs.codesign.pro/paid-scripts/garage/developer-api/events#add-persistent-vehicle)
[View Remove Persistent Vehicle Event](https://docs.codesign.pro/paid-scripts/garage/developer-api/events#remove-persistent-vehicle)
:::
## ::: warning Possible Modifications Required
* If this feature is enabled, add the event below to any external resource that removes vehicles.
* This includes resources such as **`/dv`** commands, impound scripts, or plate changing scripts.
* If the event is not added, the deleted vehicle may respawn automatically.
:::
### Private Garages
**How do private garages work?**
* Private garages can be created by admins using the in-game configurator.
* They can also be created by code using an event.
* Property scripts should use the event method to create property garages automatically.
* Each private garage can have one main owner.
* Other players can also be added and allowed to access the garage.
### Vehicles Model Data
* Vehicle model data controls what is shown in the garage UI.
* This includes details such as the vehicle name, class, and price.
* The vehicle price is also used to calculate percentage-based fees, such as:
* Return vehicle fees
* Garage tax
* Impound fees
* This means more expensive vehicles can cost more to return, tax, or retrieve from impound.
* If the vehicle price cannot be found, the script will use the fallback price from the config.
* The vehicle label is also loaded from this data.
* If no label is found, the script will use the default game name from `vehicles.meta`.
::: details ESX
* On ESX, we pull vehicle model data from the `vehicles` database table.
* This is the easiest way to set up vehicle model data on ESX servers.
![]()
The **"vehicles"** database table, commonly used on **ESX** servers.
#### **Multiple vehicles Tables**
* If your ESX server uses multiple `vehicles` tables, you can add them in `cd_bridge/shared/config.lua`.
* This is useful for servers with extra vehicle tables, such as donator vehicles or emergency vehicles.
* Add each table name to `ESXVehiclesTables`.
* The bridge will check these tables when loading vehicle data.
:::
::: details QBCore
* On QBCore, we pull vehicle model data **`QBShared.Vehicles` in `qb-core/shared.lua`**.
:::
::: details Fallback data if vehicle cannot not found in vehicle model data
* If vehicle model data cannot be found, the script will try to get the vehicle display name from the vehicle handling files, such as `vehicles.meta`.
* For example, if the vehicle has `Adder`, the script will use `Adder` as the display name.
* The vehicle price will use the fallback price set in the in-game configurator.
:::
### Vehicle Keys
**How do vehicle keys work?**
* If you use the built-in vehicle key system, keys are given automatically for vehicles spawned by Codesign resources.
* If a vehicle is spawned by another resource, such as a `/car` command, vehicle shop, civilian job script, or similar resource, you must trigger the key event yourself.
* This makes sure the player receives the correct keys for that vehicle.
## ::: tip Resource Integrations
**Using built-in vehicle keys?**
[Follow these setup guides to make selected scripts give keys correctly](https://docs.codesign.pro/paid-scripts/garage/resource-integration/esx#add-keys-server-side)
**Using another key script?**
[View key scripts that already work through our bridge](https://docs.codesign.pro/paid-scripts/garage/resource-integration)
**Integration Events**
Use this event to make other scripts give players keys when using the built-in vehicle key system.
[View Add Key Event](https://docs.codesign.pro/paid-scripts/garage/developer-api/events#add-keys)
[View Remove Key Event](https://docs.codesign.pro/paid-scripts/garage/developer-api/events#add-keys)
[View Add Owned Key Event](https://docs.codesign.pro/paid-scripts/garage/developer-api/events#add-keys)
:::
## ::: warning Vehicle Key Script Conflicts
* If you use the built-in vehicle key system, remove or disable all other vehicle key scripts to prevent conflicts.
* Make sure the other key scripts are fully stopped, as some resources can still start automatically if they are listed as dependencies, even if they are removed from your server start config.
:::
***
### Vehicle Plate Format
## ::: danger PLEASE READ CAREFULLY!
You must complete this step correctly. You must read the information below and confirm your server's plate format.
Please read all 3 options below carefully before confirming which one you use.
*Please note that you NEED to use the plate format your server already uses; changing them just because you like the benefits can cause script-breaking issues.*
:::
> #### What is vehicle plate formats?
>
> Your vehicle shop/car dealer is the script that usually decides what plate format owned vehicles will use on your server. So you need to configure the `Config.PlateFormats` in the \[configs/config.lua] file to what plate format your server uses. We have added compatibility with all 3 known plate formats.
>
> #### Short Explanation
>
> By default, every vehicle's plate in FiveM is [8 characters long](https://i.imgur.com/3wrMtKC.png). So for example if your vehicle shop forces the plate to be [4 characters long](https://i.imgur.com/kHsBd6q.png), when you use the FiveM native to get a vehicle's plate `GetVehicleNumberPlateText(vehicle)`, this will return a [string that is 8 characters long](https://imgur.com/a/fTlktur) even though the plate is 4 characters long on your vehicle in-game (ABCD); because FiveM will add [whitespaces ](https://en.wikipedia.org/wiki/Whitespace_character)until the plate is 8 characters long including whitespaces.
::::tabs
\=== 1. Trimmed
**What do you mean by "trimmed" plate format?**
By "trimmed", we mean your vehicle shop removes all spaces and [whitespaces ](https://en.wikipedia.org/wiki/Whitespace_character)from the default 8-character plate.
#### Example of what the **"trimmed"** plate looks like when using DEBUG PRINTS.

**Example of what the "trimmed" plate looks like in the DATABASE.**

**Example of what the "trimmed" plate looks like IN-GAME.**
![]()
#### Does your server use the "trimmed" vehicle plate format?
Then you need to set the `Config.PlateFormats` in the `config.lua` to **`'trimmed'`**.
\=== 2. With Spaces
**What do you mean by "with spaces" plate format?**
By **"**with spaces", we mean your vehicle shop does not modify the plate, so all plates will be 8 characters long no matter how many letters or numbers are in the plate because it will include [whitespaces](https://en.wikipedia.org/wiki/Whitespace_character) to make the length 8.
#### Example of what the **"with spaces"** plate looks like when using DEBUG PRINTS.

**Example of what the "with spaces" plate looks like in the DATABASE.**
![]()
**Example of what the "with spaces" plate looks like IN-GAME.**
![]()
#### Does your server use the "**with\_spaces**" vehicle plate format?
# Then you need to set the `Config.PlateFormats` in the `config.lua` to **`'with_spaces'`**.
\=== 3. Mixed (qbcore+esx\_vehicleshop)
**What do you mean by "mixed" plate format?**
By "mixed", we mean your vehicle shop will remove any [whitespaces](https://en.wikipedia.org/wiki/Whitespace_character) at the start and the end of the plate, but it will not remove spaces in the centre of the plate. You should only be using this option if you use Qbcore or esx\_vehicleshop.
**QBCore:** This option is recommended for QBCore servers as this is what QBCore also uses in its get plate function. Normally, QBCore's plates are 8 characters long with no spaces, so the examples below may not be relevant to you.
**esx\_vehicleshop:** If your vehicle plates in the database are the same format as the examples below, you should use this option, as some esx vehicle shops by default, force the plate format to be 7 characters long with a space in the middle.
#### Example of what **the "mixed"** plate looks like when using DEBUG PRINTS.
![]()
**Example of what the "mixed" plate looks like in the DATABASE.**

**Example of what the "mixed" plate looks like IN-GAME.**

#### Does your server use the "**mixed**" vehicle plate format?
# Then you need to set the `Config.PlateFormats` in the `config.lua` to **`'`mixed`'`**.
::::
## ::: info To sum up the above:
**Do you use QBCore or QBox?**
Use the "mixed" option.
**Do you use esx\_vehicleshop, and are your plates formatted like \[ABC 123]?**
Use the "mixed" option.
**My plates are 8 characters with no spaces \[ABCD1234]?**
Use the "mixed" option.
:::
---
---
url: /paid-scripts/garage/developer-api/events.md
description: >-
Events reference for cd_garage including client and server events for vehicle
storage, impound, key management, and garage integration.
---
# Events
## ::: info Note
These events are entirely optional and can be triggered as needed to integrate cd\_garage with your own scripts or custom systems.
:::
## Client
## ::: tip Client-Side Events
* Defined with **`RegisterNetEvent`** **in client files**.
* Triggered using **`TriggerEvent`** (if from client) or **`TriggerClientEvent`** (if from server).
* Run only on **one player's game client** (the player's PC).
:::
***
### **Impound Vehicle**
Opens the impound UI. You can send a vehicle's ID as the first argument; otherwise, it will automatically select the closest vehicle.
```lua [@parameters]
---@param vehicle number | entity The vehicle entity to be impounded.
---@example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
TriggerEvent('cd_garage:ImpoundVehicle', vehicle)
```
```lua [client-side to client-side]
TriggerEvent('cd_garage:ImpoundVehicle', vehicle)
```
```lua [server-side to client-side]
TriggerClientEvent('cd_garage:ImpoundVehicle', source, vehicle)
```
***
### **Impound Vehicle Directly**
Impounds a vehicle directly using code without opening the impound UI. Sends detailed data such as the plate, impound location, vehicle properties, and retrieval status.
```lua [@parameters]
--- @field plate string The vehicle's plate.
--- @field impound number The Impound ID from Config.ImpoundLocations.
--- @field props table The vehicle's properties.
--- @field time number The time the vehicle was impounded.
--- @field description string The reason or description for the impound.
--- @field canretrive boolean Whether the vehicle can be retrieved by the owner.
--- @field vehicle number | entity The vehicle entity.
```
```lua [client-side to client-side]
TriggerEvent('cd_garage:ImpoundVehicle:Direct', {
plate = plate,
impound = impound,
props = props,
time = time,
description = description,
canretrive = canretrive,
vehicle = vehicle,
})
```
```lua [server-side to client-side]
TriggerClientEvent('cd_garage:ImpoundVehicle:Direct', source, {
plate = plate,
impound = impound,
props = props,
time = time,
description = description,
canretrive = canretrive,
vehicle = vehicle,
})
```
***
### **Toggle Vehicle Lock**
Toggles the lock state of the closest vehicle to the player.
```lua [client-side to client-side]
TriggerEvent('cd_garage:ToggleVehicleLock')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_garage:ToggleVehicleLock', source)
```
***
### **Set Vehicle Locked**
Locks a vehicle using the garage's built-in key system. You must send the vehicle's ID in the first argument.
```lua [@parameters]
--- @param vehicle number The vehicle entity to lock.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
TriggerEvent('cd_garage:SetVehicleLocked', vehicle)
```
```lua [client-side to client-side]
TriggerEvent('cd_garage:SetVehicleLocked', vehicle)
```
```lua [server-side to client-side]
TriggerClientEvent('cd_garage:SetVehicleLocked', source, vehicle)
```
***
### **Set Vehicle Unlocked**
Unlocks a vehicle using the garage's built-in key system. You must send the vehicle's ID in the first argument.
```lua [@parameters]
--- @param vehicle number The vehicle entity to unlock.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
TriggerEvent('cd_garage:SetVehicleUnlocked', vehicle)
```
```lua [client-side to client-side]
TriggerEvent('cd_garage:SetVehicleUnlocked', vehicle)
```
```lua [server-side to client-side]
TriggerClientEvent('cd_garage:SetVehicleUnlocked', source, vehicle)
```
### **Update Garage Type**
Updates the vehicle's garage type in the database based on your current vehicle.
```lua [client-side to client-side]
TriggerEvent('cd_garage:UpdateGarageType')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_garage:UpdateGarageType', source)
```
***
### **Add Keys**
Gives the player keys for a specific vehicle based on its plate.
```lua [@parameters]
-- @param plate string The vehicle's plate. Example: "ABCD1234"
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local plate = GetVehicleNumberPlateText(vehicle)
TriggerEvent('cd_garage:AddKeys', plate)
```
```lua [client-side to client-side]
TriggerEvent('cd_garage:AddKeys', plate)
```
```lua [server-side to client-side]
TriggerClientEvent('cd_garage:AddKeys', source, plate)
```
***
### **Remove Keys**
Removes the player's keys for a specific vehicle based on its plate.
```lua [@parameters]
-- @param plate string The vehicle's plate. Example: "ABCD1234"
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local plate = GetVehicleNumberPlateText(vehicle)
TriggerEvent('cd_garage:RemoveKeys', plate)
```
```lua [client-side to client-side]
TriggerEvent('cd_garage:RemoveKeys', plate)
```
```lua [server-side to client-side]
TriggerClientEvent('cd_garage:RemoveKeys', source, plate)
```
***
### **Show Keys UI**
Opens the vehicle keys UI for the player, displaying all vehicles they currently have keys for.
```lua [client-side to client-side]
TriggerEvent('cd_garage:ShowKeys')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_garage:ShowKeys', source)
```
***
### **Open Property Garage**
Opens an existing property garage or creates one at the player’s current location.
* When the event is triggered, the script checks for a property garage near the player.
* If one is found, that garage will open.
* If one is not found, a new property garage will be created.
* It is recommended to pass the vehicle spawn coordinates in the first argument so the exact spawn location can be used.
* If no coordinates are provided, the player’s current coordinates and heading will be used.
```lua [@parameters]
--- @param vehicleSpawnCoords? vector4 Optional vehicle spawn coordinates.
--- If not provided, the player's current coordinates and heading will be used.
--- @example
local vehicleSpawnCoords = vector4(0.0, 0.0, 0.0, 0.0) or {x = 0.0, y = 0.0, z = 0.0, h = 0.0}
TriggerEvent('cd_garage:PropertyGarage:Open', vehicleSpawnCoords)
```
```lua [client-side to client-side]
TriggerEvent('cd_garage:PropertyGarage:Open', vehicleSpawnCoords)
```
```lua [server-side to client-side]
TriggerClientEvent('cd_garage:PropertyGarage:Open', source, vehicleSpawnCoords)
```
***
### **Store Vehicle in Property Garage**
Stores the player’s current vehicle in the nearby property garage.
```lua [client-side to client-side]
TriggerEvent('cd_garage:PropertyGarage:StoreVehicle')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_garage:PropertyGarage:StoreVehicle', source)
```
***
## Server
## ::: tip Server-Side Events
* Defined with **`RegisterServerEvent`** and **`AddEventHandler`** **in server files**.
* Triggered using **`TriggerEvent`** (if from server) or **`TriggerServerEvent`** (if from client).
* Run on the **server**, not on any individual player's game client.
:::
***
### **Set Job Owned Vehicle**
Marks the vehicle the player is currently sitting in as either a **personal** or **society** owned job vehicle.\
This event must be triggered while the player is **inside the vehicle**.
```lua [@parameters]
--- @param method string The ownership type: 'personal' or 'society'.
--- @param plate string The vehicle plate.
--- @param jobs table Optional. Only used for society owned vehicles to allow extra jobs access.
--- @example For personal owned vehicles:
local method = 'personal'
local plate = 'ABCD1234'
TriggerServerEvent('cd_garage:SetJobOwnedVehicle', method, plate)
--- @example For society owned vehicles:
local method = 'society'
local plate = 'ABCD1234'
local jobs = {
'police',
'sheriff'
}
TriggerServerEvent('cd_garage:SetJobOwnedVehicle', method, plate, jobs)
```
```lua [client-side to server-side]
TriggerServerEvent('cd_garage:SetJobOwnedVehicle', method, plate)
```
```lua [server-side to server-side]
TriggerEvent('cd_garage:SetJobOwnedVehicle', method, plate)
```
### Create Private Garage
Creates a private garage using code. This is mainly useful for property scripts that need to create a garage automatically.
```lua [@parameters]
--- @param data table The private garage data.
--- @param data.garage_label string The display name of the private garage.
--- @param data.allowed_vehicle_types table The vehicle types allowed in this garage. Example: 'car' 'boat' 'heli' 'plane'.
--- @param data.coords table The garage location data.
--- @param data.coords.open table The location where players open the garage.
--- @param data.coords.spawn table The location where vehicles spawn.
--- @param data.data table Private garage owner and access data.
--- @param data.data.owner_identifier string Main owner identifier.
--- @param data.data.access_identifiers table Optional list of player identifiers allowed to access the garage.
--- @param data.blip table Optional blip settings.
--- @example
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
local data = {
garage_label = 'Private Garage',
allowed_vehicle_types = {'car'},
coords = {
open = {
x = coords.x,
y = coords.y,
z = coords.z,
interact_distance = 5,
view_distance = 15
},
spawn = {
x = coords.x,
y = coords.y,
z = coords.z,
heading = heading
}
},
data = {
owner_identifier = 'steam:110000112345678',
access_identifiers = { -- optional
'steam:110000112345678',
'steam:110000112345679'
}
},
blip = { -- optional
enabled = true,
sprite = 357,
scale = 0.6,
color = 9
}
}
TriggerServerEvent('cd_garage:PrivateGarage:Create', data)
```
```lua [client-side to server-side]
TriggerServerEvent('cd_garage:PrivateGarage:Create', data)
```
```lua [server-side to server-side]
TriggerEvent('cd_garage:PrivateGarage:Create', data)
```
***
### Create Property Garage
Creates a property garage using code. This is mainly useful for property scripts that need to create a garage automatically when a property is purchased.
```lua [@parameters]
--- @param data table The property garage data.
--- @param data.garage_label string The display name of the property garage.
--- @param data.allowed_vehicle_types table The vehicle types allowed in this garage. Example: 'car' 'boat' 'heli' 'plane'.
--- @param data.coords table The garage location data.
--- @param data.coords.open table The location where players open the garage.
--- @param data.coords.spawn table The location where vehicles spawn.
--- @param data.data table Property owner and access data.
--- @param data.data.owner_identifier string Main owner identifier.
--- @param data.data.access_identifiers table Optional list of player identifiers allowed to access the garage.
--- @param data.blip table Optional blip settings.
--- @example
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
local data = {
garage_label = 'Property Garage',
allowed_vehicle_types = {'car'},
coords = {
open = {
x = coords.x,
y = coords.y,
z = coords.z,
interact_distance = 5,
view_distance = 15
},
spawn = {
x = coords.x,
y = coords.y,
z = coords.z,
heading = heading
}
},
data = {
owner_identifier = 'steam:110000112345678',
access_identifiers = { -- optional
'steam:110000112345678',
'steam:110000112345679'
}
},
blip = { -- optional
enabled = true,
sprite = 357,
scale = 0.6,
color = 9
}
}
TriggerServerEvent('cd_garage:PropertyGarage:Create', data)
```
```lua [client-side to server-side]
TriggerServerEvent('cd_garage:PropertyGarage:Create', data)
```
```lua [server-side to server-side]
TriggerEvent('cd_garage:PropertyGarage:Create', data)
```
***
### **Set Garage State**
Updates the vehicle's in garage status in the database.
```lua [@parameters]
--- @param plate string The vehicle's license plate. Example: "ABCD1234"
--- @param state number The vehicle's garage state. 0 = not in garage, 1 = in garage, 2 = in impound.
--- @example
local plate = "ABCD1234"
local state = 1
TriggerEvent('cd_garage:SetGarageState', plate, state)
```
```lua [server-side to server-side]
TriggerEvent('cd_garage:SetGarageState', plate, state)
```
***
### Add Owned Keys
Used when adding an owned vehicle to a player's garage. This ensures the new vehicle appears in the player's keys UI.
```lua [@parameters]
--- @param plate string The vehicle's plate. Example: "ABCD1234"
--- @param model number The vehicle's model hash. Example: 127317925
--- @example
local plate = "ABCD1234"
local model = GetEntityModel(GetVehiclePedIsIn(PlayerPedId()))
TriggerServerEvent('cd_garage:VehicleKeys:AddOwnedKeys', plate, model)
```
```lua [client-side to server-side]
TriggerServerEvent('cd_garage:VehicleKeys:AddOwnedKeys', plate, model)
```
```lua [server-side to server-side]
TriggerEvent('cd_garage:VehicleKeys:AddOwnedKeys', plate, model, src)
```
***
### Add Persistent Vehicle
Used to mark a vehicle as persistent, allowing it to automatically save and respawn if it despawns while the server is running.
```lua [@parameters]
--- @param plate string The vehicle's plate. Example: "ABCD1234"
--- @param netId number The vehicle's network ID. Example: NetworkGetNetworkIdFromEntity(vehicle)
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local plate = GetVehicleNumberPlateText(vehicle)
local netId = NetworkGetNetworkIdFromEntity(vehicle)
TriggerServerEvent('cd_garage:PersistentVehicles:Add', plate, netId)
```
```lua [client-side to server-side]
TriggerServerEvent('cd_garage:PersistentVehicles:Add', plate, netId)
```
```lua [server-side to server-side]
TriggerEvent('cd_garage:PersistentVehicles:Add', plate, netId)
```
***
### Remove Persistent Vehicle
Used to remove a vehicle from the persistent system, preventing it from saving or respawning automatically.
```lua [@parameters]
--- @param plate string The vehicle's plate. Example: "ABCD1234"
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local plate = GetVehicleNumberPlateText(vehicle)
TriggerServerEvent('cd_garage:PersistentVehicles:Remove', plate)
```
```lua [client-side to server-side]
TriggerServerEvent('cd_garage:PersistentVehicles:Remove', plate)
```
```lua [server-side to server-side]
TriggerEvent('cd_garage:PersistentVehicles:Remove', plate)
```
***
### Persistent Vehicle Plate Changed
When a vehicle's plate is changed while persistent vehicles are enabled, the old plate must be removed from the persistent system. This prevents the vehicle from being saved or respawning using its previous plate.
```lua [@parameters]
--- @param old_plate string The vehicle's old plate. Example: "ABCD1234"
--- @param new_plate string The vehicle's new plate. Example: "1234ABCD"
--- @example
local old_plate = "ABCD1234"
local new_plate = "1234ABCD"
TriggerServerEvent('cd_garage:PersistentVehicles:PlateChanged', old_plate, new_plate)
```
```lua [client-side to server-side]
TriggerServerEvent('cd_garage:PersistentVehicles:PlateChanged', old_plate, new_plate)
```
```lua [server-side to server-side]
TriggerEvent('cd_garage:PersistentVehicles:PlateChanged', old_plate, new_plate)
```
***
### **Transfer Vehicle**
Transfers a vehicle to another players garage.
```lua [@parameters]
--- @param plate string The plate of the vehicle to transfer.
--- @param serverid number The server ID of the player to transfer the vehicle to.
--- @example
local plate = 'ABCD1234'
local serverId = 23
TriggerServerEvent('cd_garage:TransferVehicle', plate, serverId)
```
```lua [client-side to server-side]
TriggerEvent('cd_garage:TransferVehicle', plate, serverid)
```
```lua [server-side to server-side]
TriggerEvent('cd_garage:TransferVehicle', plate, serverid)
```
### **Save Vehicle Damage Timer**
Saves the damage data for all vehicles currently tracked by cd\_garage. Typically used before a server restart.
```lua [server-side to client-side]
TriggerClientEvent('cd_garage:SaveAllVehicleDamage', -1)
```
***
### **Save Impound Timer**
Saves all active impound timers to the database, ensuring impounded vehicle durations are correctly updated and persistent.
```lua [server-side to server-side]
TriggerEvent('cd_garage:SaveImpoundTimers')
```
---
---
url: /paid-scripts/garage/developer-api/exports.md
description: >-
Exports reference for cd_garage including functions for vehicle management,
garage operations, and integration with other resources.
---
# Exports
## ::: info Note
These exports are entirely optional and can be used as needed within your own scripts or integrations.
:::
## Client
### **Get Garage Type**
Returns the garage type of the specified vehicle (e.g., car, boat, air).
```lua [Parameters]
--- @param vehicle number The vehicle entity to check.
--- @return string garageType The garage type assigned to the vehicle.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local garageType = exports.cd_garage:GetGarageType(vehicle)
print("This vehicle belongs to the " .. garageType .. " garage type.")
-- Example output:
-- "This vehicle belongs to the car garage type."
```
```lua
local garageType = exports.cd_garage:GetGarageType(vehicle)
```
### **Get Keys Data**
Retrieves all stored key data for the player, including owned and temporary vehicle keys.
```lua [Parameters]
--- @return table keysData A table containing all key information for the player.
--- @example
-- Example: Loop through all keys and print plate + model
local keysData = exports.cd_garage:GetKeysData()
for plate, data in pairs(keysData) do
print("Plate: " .. plate)
print("Vehicle: " .. data.vehicle)
print("Has Key: " .. tostring(data.has_key))
end
-- Example output:
-- Plate: ABCD1234
-- Vehicle: 67563675
-- Has Key: true
```
```lua
local keysData = exports.cd_garage:GetKeysData()
```
### **Does Player Have Keys**
Checks whether the player currently has keys for a specific vehicle based on its plate.
```lua [Parameters]
--- @param plate string The vehicle's plate. Example: "ABCD1234"
--- @return boolean hasKeys Returns true if the player has keys for the specified vehicle.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local plate = exports.cd_garage:GetPlate(vehicle)
local hasKeys = exports.cd_garage:DoesPlayerHaveKeys(plate)
if hasKeys then
print("Player has keys for this vehicle.")
else
print("Player does not have keys for this vehicle.")
end
```
```lua
local hasKeys = exports.cd_garage:DoesPlayerHaveKeys(plate)
```
### **Get Plate**
Returns the license plate text of the specified vehicle.
```lua [Parameters]
--- @param vehicle number | entity The vehicle entity to get the plate from.
--- @return string plate The vehicle's license plate text.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local plate = exports.cd_garage:GetPlate(vehicle)
print("This vehicle's plate is: " .. plate)
-- Example output:
-- This vehicle's plate is: ABCD1234
```
```lua
local plate = exports.cd_garage:GetPlate(vehicle)
```
### **Get Correct Plate Format**
Returns the vehicle's license plate text formatted according to the cd\_garage config settings (supports `trimmed`, `with_spaces`, or `mixed` formats).
```lua [Parameters]
--- @param plate string The vehicle's original plate text.
--- @return string plate The formatted license plate text.
--- @example
local plate = " ABC 12 "
local correctPlate = exports.cd_garage:GetCorrectPlateFormat(plate)
print("This vehicle's formatted plate is: " .. correctPlate)
-- Example output:
-- This vehicle's formatted plate is: ACB 12
```
```lua
local plate = exports.cd_garage:GetCorrectPlateFormat(plate)
```
### **Get Config**
```lua [Parameters]
--- @return table config The full cd_garage config.lua.
--- @example
local config = exports.cd_garage:GetConfig()
print(json.encode(config, { indent = true }))
```
```lua
local config = exports.cd_garage:GetConfig()
```
### **Get Vehicles Model Data**
Retrieves vehicle model data such as name, category, price, model hash and spawn name for all vehicles the garage has cached.
```lua [Parameters]
--- @return table vehiclesData A table containing all vehicle data for all vehicles.
--- @example
local vehicleModelData = exports.cd_garage:GetVehiclesModelData()
for modelHash, modelData in pairs(vehicleModelData) do
print("Name: " .. modelData.name)
print("Model: " .. modelData.model)
print("Model Hash: " .. modelHash)
print("Price: " .. modelData.price)
print("Category: " .. modelData.category)
end
print(json.encode(vehicleModelData, { indent = true }))
```
::: details Example Output
**Note**
* This table can include hundreds of vehicles.
* The example below only shows how the data is structured.
```lua
{
[1922257928] = {
name = "Sheriff Cruiser",
model = "sheriff2",
hash = 1922257928,
price = 100000,
category = "emergency",
},
[1093792632] = {
name = "Nero Custom",
model = "nero2",
hash = 1093792632,
price = 260000,
category = "super",
},
}
```
:::
```lua
local vehicleModelData = exports.cd_garage:GetVehiclesModelData()
```
### **Get Garage Locations**
Returns a table of all garage locations and their data.
```lua [Parameters]
--- @return table garageLocations A table containing all garage locations and their data.
--- @example
local garageLocations = exports.cd_garage:GetGarageLocations()
print(json.encode(garageLocations, { indent = true }))
```
::: details Public Garage Example Output
```lua
{
['5H74-KIY4-VS9W'] = {
garage_id = "5H74-KIY4-VS9W",
garage_label = "Legion Square",
location_type = "public",
shell = "10cargarage_shell",
has_inside_garage = true,
default = false,
allowed_vehicle_types = {
[1] = "car",
},
coords = {
open = {
x = 214.83,
y = -805.37,
z = 30.82,
view_distance = 10,
interact_distance = 5,
ped_heading = 336.61,
},
spawn = {
x = 211.65,
y = -796.6,
z = 29.29,
heading = 343,
},
},
blip = {
enabled = true,
sprite = 357,
color = 4,
scale = 1.0,
},
}
}
```
:::
::: details Impound Example Output
```lua
{
['L8P9-2V65-4HFW'] = {
garage_id = "L8P9-2V65-4HFW",
garage_label = "City Impound",
location_type = "impound",
has_inside_garage = false,
default = false,
allowed_vehicle_types = {
[1] = "car",
},
coords = {
open = {
x = 401.28,
y = -1631.44,
z = 29.29,
view_distance = 15,
interact_distance = 5,
ped_heading = 225.5,
},
spawn = {
x = 404.66,
y = -1642.03,
z = 29.29,
heading = 225.5,
},
},
blip = {
enabled = true,
sprite = 289,
color = 3,
scale = 1.0,
},
},
}
```
:::
::: details Job Garage Example Output
**Note**
* `data.method` can be `"regular"`, `"personal"`, or `"society"`.
* Only `regular` job garages use the `data.vehicles` table.
```lua
{
['RF66-VNTO-A5HZ'] = {
garage_id = "RF66-VNTO-A5HZ",
garage_label = "BCSO",
location_type = "job",
has_inside_garage = false,
default = false,
allowed_vehicle_types = {
[1] = "car",
},
coords = {
open = {
x = 1868.33,
y = 3686.05,
z = 33.78,
view_distance = 15,
interact_distance = 5,
ped_heading = 211.34,
},
spawn = {
x = 1872.68,
y = 3687.19,
z = 33.65,
heading = 211.34,
},
},
blip = {
enabled = true,
sprite = 357,
color = 4,
scale = 0.6,
},
data = {
method = "regular",
jobs = {
[1] = "police",
},
vehicles = {
[1] = {
plate = "PD",
job = "police",
job_grade = 0,
model = 2046537925,
custom_label = "Police Cruiser",
spawn_max = true,
livery = {
method = "livery",
value = 0,
},
props = {
model = 2046537925,
plate = "PD",
engineHealth = 1000.0,
bodyHealth = 1000.0,
fuelTankHealth = 1000.0,
fuelLevel = 100.0,
},
},
[2] = {
plate = "PD2",
job = "police",
job_grade = 0,
model = -1627000575,
custom_label = "Police Buffalo",
spawn_max = true,
livery = {
method = "livery",
value = 3,
},
props = {
plate = "PD2",
model = -1627000575,
engineHealth = 1000.0,
bodyHealth = 1000.0,
fuelTankHealth = 1000.0,
fuelLevel = 100.0,
},
},
},
},
},
}
```
:::
::: details Gang Garage Example Output
```lua
{
['ZTLC-HUJG-OTVL'] = {
garage_id = "ZTLC-HUJG-OTVL",
garage_label = "Ballas",
location_type = "gang",
has_inside_garage = false,
default = false,
allowed_vehicle_types = {
[1] = "car",
},
coords = {
open = {
x = 102.48,
y = -1955.1,
z = 20.73,
view_distance = 10,
interact_distance = 5,
},
spawn = {
x = 104.51,
z = 20.27,
y = -1954.2,
heading = 336.53,
},
},
blip = {
enabled = true,
sprite = 84,
color = 22,
scale = 0.6,
},
data = {gang_garage = "ballas"},
},
}
```
:::
::: details Private Garage Example Output
```lua
{
['9QAP-GZN9-U007'] = {
garage_id = "9QAP-GZN9-U007",
garage_label = "Gee Private Garage",
location_type = "private",
has_inside_garage = false,
default = false,
allowed_vehicle_types = {
[1] = "car",
},
coords = {
open = {
x = 113.64,
y = -1600.24,
z = 29.53,
view_distance = 10,
interact_distance = 2,
ped_heading = 0,
},
spawn = {
x = 113.64,
y = -1600.24,
z = 29.53,
heading = 17.47,
},
},
blip = {
enabled = true,
sprite = 357,
color = 4,
scale = 0.5,
},
data = {
owner_identifier = "QFE19818",
access_identifiers = {
[1] = "GQZ91611",
},
},
},
}
```
:::
::: details Property Garage Example Output
```lua
{
['9QAP-GZN9-U007'] = {
garage_id = "9QAP-GZN9-U007",
garage_label = "Ramp Property Garage",
location_type = "property",
has_inside_garage = false,
default = false,
allowed_vehicle_types = {
[1] = "car",
},
coords = {
open = {
x = 113.64,
y = -1600.24,
z = 29.53,
view_distance = 10,
interact_distance = 2,
ped_heading = 0,
},
spawn = {
x = 113.64,
y = -1600.24,
z = 29.53,
heading = 17.47,
},
},
blip = {
enabled = true,
sprite = 357,
color = 4,
scale = 0.5,
},
data = {
owner_identifier = "QFE19818",
access_identifiers = {
[1] = "GQZ91611",
},
},
},
}
```
:::
```lua
local garageLocations = exports.cd_garage:GetGarageLocations()
```
## Server
### **Get Garage Limit**
Returns the maximum number of vehicles a player can store in their garage.
```lua [Parameters]
--- @param source number The player's server ID.
--- @return number limit The maximum number of vehicles the player can store.
--- @example
local limit = exports.cd_garage:GetGarageLimit(source)
print("This player can store up to " .. limit .. " vehicles in their garage".)
-- Example Output:
-- This player can store up to 10 vehicles in their garage.
```
```lua
local limit = exports.cd_garage:GetGarageLimit(source)
```
### **Get Garage Count**
Returns how many vehicles the player currently has stored in a specific garage type.
```lua [Parameters]
--- @param source number The player's server ID.
--- @param garage_type string The garage type (e.g., "car", "boat", "air", "job").
--- @return number count The total number of vehicles stored in that garage type.
--- @example
local garage_type = "car"
local count = exports.cd_garage:GetGarageCount(source, garage_type)
print("This player currently has " .. count .. " vehicles stored in their garage.")
-- Example Output:
-- This player currently has 8 vehicles stored in their garage.
```
```lua
local count = exports.cd_garage:GetGarageCount(source, garage_type )
```
### **Get Config**
Retrieves the full configuration table (config.lua) for cd\_garage.
```lua [Parameters]
--- @return table config The full cd_garage configuration table.
--- @example
local config = exports.cd_garage:GetConfig()
print(json.encode(config, { indent = true }))
```
```lua
local config = exports.cd_garage:GetConfig()
```
### **Get Vehicles Model Data**
Retrieves vehicle model data such as name, category, price, model hash and spawn name for all vehicles the garage has cached.
```lua [Parameters]
--- @return table vehiclesData A table containing all vehicle data for all vehicles.
--- @example
local vehicleModelData = exports.cd_garage:GetVehiclesModelData()
for modelHash, modelData in pairs(vehicleModelData) do
print("Name: " .. modelData.name)
print("Model: " .. modelData.model)
print("Model Hash: " .. modelHash)
print("Price: " .. modelData.price)
print("Category: " .. modelData.category)
end
print(json.encode(vehicleModelData, { indent = true }))
```
::: details Example Output
**Note**
* This table can include hundreds of vehicles.
* The example below only shows how the data is structured.
```lua
{
[1922257928] = {
name = "Sheriff Cruiser",
model = "sheriff2",
hash = 1922257928,
price = 100000,
category = "emergency",
},
[1093792632] = {
name = "Nero Custom",
model = "nero2",
hash = 1093792632,
price = 260000,
category = "super",
},
}
```
:::
```lua
local vehicleModelData = exports.cd_garage:GetVehiclesModelData()
```
### **Is Vehicle In Impound**
Checks whether a specified vehicle (by plate) is currently in the impound.
```lua [Parameters]
--- @param plate string The vehicle's license plate. Example: "ABCD1234"
--- @return boolean isImpounded Returns true if the vehicle is impounded, false otherwise.
--- @example
local plate = "ABCD1234"
local isImpounded = exports.cd_garage:IsVehicleInImpound(plate)
if isImpounded then
print("The vehicle with plate " .. plate .. " is currently impounded.")
else
print("The vehicle with plate " .. plate .. " is not impounded.")
end
-- Example Output:
-- The vehicle with plate ABCD1234 is currently impounded.
```
```lua
local isImpounded = exports.cd_garage:IsVehicleImpounded(plate)
```
### **Get Vehicle Impound Data**
Retrieves impound information for a specific vehicle based on its plate.
```lua [Parameters]
--- @param plate string The vehicle's license plate. Example: "ABCD1234"
--- @return table|nil impoundData A table containing vehicle, impounder, impound, and owner information.
--- @example
local plate = "ABCD1234"
local impoundData = exports.cd_garage:GetVehicleImpoundData(plate)
if impoundData then
print('Owner Identifier:', impoundData.owner_identifier)
print('Impounder Job:', impoundData.impounder.job)
print('Impounder Character Name:', impoundData.impounder.char_name)
print('Vehicle Plate:', impoundData.vehicle.plate)
print('Vehicle Props:', json.encode(impoundData.vehicle.props))
print('Vehicle Label:', impoundData.vehicle.label)
print('Impound ID:', impoundData.impound.id)
print('Impound Label:', impoundData.impound.label)
print('Impound Description:', impoundData.impound.description)
print('Impound Price:', impoundData.impound.price)
print('Can Retrieve:', impoundData.impound.can_retrive)
print('Created At:', impoundData.impound.created_at)
print('Release Time:', impoundData.impound.release_time)
else
print('No impound data found for plate:', plate)
end
```
::: details Example Output
```lua
{
owner_identifier = "QFE19818",
impounder = {
job = "police",
char_name = "Ramp Walker",
},
vehicle = {
plate = "64LVL447",
label = "Adder",
props = {} -- Standard vehicle properties have been removed to keep this example short.
},
impound = {
id = "L8P9-2V65-4HFW",
label = "City Impound",
description = "Suspected of supporting trump",
price = 2800,
can_retrive = true,
created_at = 1785940425000,
release_time = 1786113120000,
},
}
```
:::
```lua
local impoundData = exports.cd_garage:GetVehicleImpoundData(plate)
```
### **Get Correct Plate Format**
Returns the vehicle's license plate text formatted according to the cd\_garage config settings (supports `trimmed`, `with_spaces`, or `mixed` formats).
```lua [Parameters]
--- @param plate string The vehicle's original plate text.
--- @return string plate The formatted license plate text.
--- @example
local plate = " ABC 12 "
local correctPlate = exports.cd_garage:GetCorrectPlateFormat(plate)
print("This vehicle's formatted plate is: " .. correctPlate)
-- Example output:
-- This vehicle's formatted plate is: ACB 12
```
```lua
local correctPlate = exports.cd_garage:GetCorrectPlateFormat(plate)
```
### **Get Garage Locations**
Returns a table of all garage locations and their data.
```lua [Parameters]
--- @return table garageLocations A table containing all garage locations and their data.
--- @example
local garageLocations = exports.cd_garage:GetGarageLocations()
print(json.encode(garageLocations, { indent = true }))
```
::: details Public Garage Example Output
```lua
{
['5H74-KIY4-VS9W'] = {
garage_id = "5H74-KIY4-VS9W",
garage_label = "Legion Square",
location_type = "public",
shell = "10cargarage_shell",
has_inside_garage = true,
default = false,
allowed_vehicle_types = {
[1] = "car",
},
coords = {
open = {
x = 214.83,
y = -805.37,
z = 30.82,
view_distance = 10,
interact_distance = 5,
ped_heading = 336.61,
},
spawn = {
x = 211.65,
y = -796.6,
z = 29.29,
heading = 343,
},
},
blip = {
enabled = true,
sprite = 357,
color = 4,
scale = 1.0,
},
}
}
```
:::
::: details Impound Example Output
```lua
{
['L8P9-2V65-4HFW'] = {
garage_id = "L8P9-2V65-4HFW",
garage_label = "City Impound",
location_type = "impound",
has_inside_garage = false,
default = false,
allowed_vehicle_types = {
[1] = "car",
},
coords = {
open = {
x = 401.28,
y = -1631.44,
z = 29.29,
view_distance = 15,
interact_distance = 5,
ped_heading = 225.5,
},
spawn = {
x = 404.66,
y = -1642.03,
z = 29.29,
heading = 225.5,
},
},
blip = {
enabled = true,
sprite = 289,
color = 3,
scale = 1.0,
},
},
}
```
:::
::: details Job Garage Example Output
**Note**
* `data.method` can be `"regular"`, `"personal"`, or `"society"`.
* Only `regular` job garages use the `data.vehicles` table.
```lua
{
['RF66-VNTO-A5HZ'] = {
garage_id = "RF66-VNTO-A5HZ",
garage_label = "BCSO",
location_type = "job",
has_inside_garage = false,
default = false,
allowed_vehicle_types = {
[1] = "car",
},
coords = {
open = {
x = 1868.33,
y = 3686.05,
z = 33.78,
view_distance = 15,
interact_distance = 5,
ped_heading = 211.34,
},
spawn = {
x = 1872.68,
y = 3687.19,
z = 33.65,
heading = 211.34,
},
},
blip = {
enabled = true,
sprite = 357,
color = 4,
scale = 0.6,
},
data = {
method = "regular",
jobs = {
[1] = "police",
},
vehicles = {
[1] = {
plate = "PD",
job = "police",
job_grade = 0,
model = 2046537925,
custom_label = "Police Cruiser",
spawn_max = true,
livery = {
method = "livery",
value = 0,
},
props = {
model = 2046537925,
plate = "PD",
engineHealth = 1000.0,
bodyHealth = 1000.0,
fuelTankHealth = 1000.0,
fuelLevel = 100.0,
},
},
[2] = {
plate = "PD2",
job = "police",
job_grade = 0,
model = -1627000575,
custom_label = "Police Buffalo",
spawn_max = true,
livery = {
method = "livery",
value = 3,
},
props = {
plate = "PD2",
model = -1627000575,
engineHealth = 1000.0,
bodyHealth = 1000.0,
fuelTankHealth = 1000.0,
fuelLevel = 100.0,
},
},
},
},
},
}
```
:::
::: details Gang Garage Example Output
```lua
{
['ZTLC-HUJG-OTVL'] = {
garage_id = "ZTLC-HUJG-OTVL",
garage_label = "Ballas",
location_type = "gang",
has_inside_garage = false,
default = false,
allowed_vehicle_types = {
[1] = "car",
},
coords = {
open = {
x = 102.48,
y = -1955.1,
z = 20.73,
view_distance = 10,
interact_distance = 5,
},
spawn = {
x = 104.51,
z = 20.27,
y = -1954.2,
heading = 336.53,
},
},
blip = {
enabled = true,
sprite = 84,
color = 22,
scale = 0.6,
},
data = {gang_garage = "ballas"},
},
}
```
:::
::: details Private Garage Example Output
```lua
{
['9QAP-GZN9-U007'] = {
garage_id = "9QAP-GZN9-U007",
garage_label = "Gee Private Garage",
location_type = "private",
has_inside_garage = false,
default = false,
allowed_vehicle_types = {
[1] = "car",
},
coords = {
open = {
x = 113.64,
y = -1600.24,
z = 29.53,
view_distance = 10,
interact_distance = 2,
ped_heading = 0,
},
spawn = {
x = 113.64,
y = -1600.24,
z = 29.53,
heading = 17.47,
},
},
blip = {
enabled = true,
sprite = 357,
color = 4,
scale = 0.5,
},
data = {
owner_identifier = "QFE19818",
access_identifiers = {
[1] = "GQZ91611",
},
},
},
}
```
:::
::: details Property Garage Example Output
```lua
{
['9QAP-GZN9-U007'] = {
garage_id = "9QAP-GZN9-U007",
garage_label = "Ramp Property Garage",
location_type = "property",
has_inside_garage = false,
default = false,
allowed_vehicle_types = {
[1] = "car",
},
coords = {
open = {
x = 113.64,
y = -1600.24,
z = 29.53,
view_distance = 10,
interact_distance = 2,
ped_heading = 0,
},
spawn = {
x = 113.64,
y = -1600.24,
z = 29.53,
heading = 17.47,
},
},
blip = {
enabled = true,
sprite = 357,
color = 4,
scale = 0.5,
},
data = {
owner_identifier = "QFE19818",
access_identifiers = {
[1] = "GQZ91611",
},
},
},
}
```
:::
```lua
local garageLocations = exports.cd_garage:GetGarageLocations()
```
---
---
url: /paid-scripts/garage/developer-api/chat-commands.md
description: >-
Chat commands reference for cd_garage including player and staff commands for
managing vehicles, garages, and impound lots.
---
# Chat Commands
## ::: info Note
These chat commands can be renamed or disabled in the **`Keys and Commands`** section of the `[configs/config.lua]`.
:::
## **Player Commands**
### **/givekey**
Give temporary keys (keys delete after server restart) to the closest player for the closest vehicle.
```bash
/givekey [serverid]
```
### **/showkeys**
Open the UI to manage keys.
```bash
/showkeys
```
### **/impound**
Impound system to impound a vehicle.
```bash
/impound
```
### **/lockpick**
Start lockpicking the closest vehicle.
```bash
/lockpick
```
### **/removefakeplate**
Remove a fake plate from the closest vehicle.
```bash
/removefakeplate
```
### **/vehlock**
Toggle vehicle lock.
```bash
/vehlock
```
## **Staff Commands**
### **/vehicle-add**
(Staff only) Add the vehicle you are currently sat inside to a player's garage.
```bash
/vehicle-add [serverid]
```
### **/vehicle-delete**
(Staff only) Delete the vehicle you are currently sat inside from the database.
```bash
/vehicle-delete
```
### **/vehicle-keys**
(Staff only) Give yourself keys to the vehicle you are currently sat inside.
```bash
/vehicle-keys
```
### **/vehicle-plate**
(Staff only) Change the plate of the vehicle you are currently sat inside.
```bash
/vehicle-plate [newPlate]
```
---
---
url: /paid-scripts/garage/developer-api/items.md
description: >-
Usable items reference for cd_garage including vehicle keys, tracking devices,
and other garage-related items.
---
# Items
## Items & Usage
*Items that players can use.*
| Item Name | Usable | Description |
|---------------|--------|-----------------------------------------------------------|
| `lockpick` | true | Use a lockpick to try and unlock a vehicle. |
| `vehicle_key` | true | Use a physical key item to start the engine of a vehicle. |
## Item Setup
### Adding Inventory Items
*Copy and paste the item format that matches your inventory system below. Each section is pre-configured and ready to use, simply add it to your inventory/framework and adjust values if needed.*
::: details esx / esx\_inventory
```sql
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('vehicle_key', 'Vehicle Key', 1, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('lockpick', 'Lockpick', 1, 0, 1);
```
:::
::: details qbcore / qb-inventory / codem-inventory / ps-inventory / qs-inventory (esx & qbox) / tgiann-inventory
```lua [qb-core/shared/items.lua]
['vehicle_key'] = {
name = 'vehicle_key',
label = 'Vehicle Key',
weight = 100,
type = 'item',
image = 'vehicle_key.png',
unique = true,
useable = true,
shouldClose = true,
description = 'Physical key used to control a vehicle.'
},
['lockpick'] = {
name = 'lockpick',
label = 'Lockpick',
weight = 300,
type = 'item',
image = 'lockpick.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Used to try and unlock a vehicle.'
},
```
:::
::: details ak47\_inventory / ak47\_qb\_inventory
```lua
["vehicle_key"] = {
name = "vehicle_key",
label = "Vehicle Key",
weight = 100,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 1,
},
["lockpick"] = {
name = "lockpick",
label = "Lockpick",
weight = 300,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
```
:::
::: details ox\_inventory
```lua [ox_inventory/data/items.lua]
['vehicle_key'] = {
label = 'Vehicle Key',
stack = false,
weight = 100,
},
['lockpick'] = {
label = 'Lockpick',
stack = true,
weight = 300,
},
```
:::
### Adding Inventory Images
*Default item images are included and can be used if you don’t have your own.*
---
---
url: /paid-scripts/garage/developer-api/keys.md
description: >-
Default keybinds for cd_garage including interaction keys for vehicle storage,
retrieval, and garage management features.
---
# Keys
## ::: info Note
* You can modify or disable these keys in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section of the `[configs/config.lua]`.
* Ensure you understand how [Key Mapping](https://docs.codesign.pro/coding-information/register-key-mapping) works.
:::
### Open Garage
E - Open the outside quick garage.
### Store vehicle
E - Store your vehicle.
### Physical Key
G - Insert or remove the physical vehicle key.
### Hotwire
G (hold) - Hotwire a vehicle.
### Vehicle Lock
M - Toggle vehicle lock.
---
---
url: /paid-scripts/garage/resource-integration.md
description: >-
Compatibility reference for cd_garage showing supported frameworks,
inventories, vehicle keys, fuel scripts, and notification systems.
---
# Resource Integration
| Status | Description |
| --- | --- |
| **Built-In (script)** | Fully integrated into the script and auto-detected, no modifications or configuration needed. |
| **Built-In (creator)** | Fully integrated by the resource creator, no modifications required. |
| **Built-In (cd\_bridge)** | Fully integrated through cd\_bridge and auto-detected, no extra changes needed in the supported resource. |
| **Minor Changes Required** | Small, simple edits such as adding or copying a single line of code. |
| **Moderate Changes Required** | Involves replacing existing logic or functions with the versions provided by Codesign. |
| **Major Changes Required** | Extensive modifications across multiple files or large code sections. |
## Supported Utility Compatibility
Additional resource types that can work through our bridge, such as notifications and similar utility scripts.
| Script Type | Compatibility Type | View Supported Scripts |
| ------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| Framework | **Built-In (cd\_bridge)** | [#framework](../../bridge/resource-integration.md#framework "mention") |
| Database Wrapper | **Built-In (cd\_bridge)** | [#database-wrapper](../../bridge/resource-integration.md#database-wrapper "mention") |
| Banking | **Built-In (cd\_bridge)** | [#banking](../../bridge/resource-integration.md#banking "mention") |
| Dispatch | **Built-In (cd\_bridge)** | [#dispatch](../../bridge/resource-integration.md#dispatch "mention") |
| Draw Text UI | **Built-In (cd\_bridge)** | [#draw-text-ui](../../bridge/resource-integration.md#draw-text-ui "mention") |
| Duty | **Built-In (cd\_bridge)** | [#duty](../../bridge/resource-integration.md#duty "mention") |
| Gang | **Built-In (cd\_bridge)** | [#gang](../../bridge/resource-integration.md#gang "mention") |
| Hud | **Built-In (cd\_bridge)** | [#hud](../../bridge/resource-integration.md#hud "mention") |
| Inventory | **Built-In (cd\_bridge)** | [#inventory](../../bridge/resource-integration.md#inventory "mention") |
| Mechanic | **Built-In (cd\_bridge)** | [#mechanic](../../bridge/resource-integration.md#mechanic "mention") |
| Notifications | **Built-In (cd\_bridge)** | [#notification](../../bridge/resource-integration.md#notification "mention") |
| Persistent Vehicles | **Built-In (cd\_bridge)** | [#persistent-vehicles](../../bridge/resource-integration.md#persistent-vehicles "mention") |
| Society | **Built-In (cd\_bridge)** | [#society](../../bridge/resource-integration.md#society "mention") |
| Target | **Built-In (cd\_bridge)** | [#target](../../bridge/resource-integration.md#target "mention") |
| Time & Weather | **Built-In (cd\_bridge)** | [#time-and-weather](../../bridge/resource-integration.md#time-and-weather "mention") |
| Vehicle Fuel | **Built-In (cd\_bridge)** | [#vehicle-fuel](../../bridge/resource-integration.md#vehicle-fuel "mention") |
| Vehicle Keys | **Built-In (cd\_bridge)** | [#vehicle-keys](../../bridge/resource-integration.md#vehicle-keys "mention") |
***
## Supported Garage Integrations
### Housing
| Script Name | Compatibility type | Notes |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------- | ----- |
| [ak47\_housing](https://menanak47.tebex.io/package/5755253) | **Built-In (creator)** | |
| [bcs\_housing](https://masbagus.tebex.io/) | **Built-In (creator)** | |
| [jpr-housingsystem](https://jpresources.tebex.io/package/5956053) | **Built-In (creator)** | |
| [loaf\_housing](https://store.loaf-scripts.com/package/4310850) | **Built-In (creator)** | |
| [nolag\_properties](https://teamsgg.dev/scripts/properties) | **Built-In (creator)** | |
| [ps-housing](https://github.com/Project-Sloth/ps-housing) | **Minor Changes Required** | [Integration Guide](https://docs.codesign.pro/paid-scripts/garage/resource-integration/paid-resources#ps-housing) |
| [RXHousing](https://store.rxscripts.xyz/scripts/advanced-housing) | **Built-In (creator)** | |
| [qb-houses](https://github.com/qbcore-framework/qb-houses) | **Built-In (cd\_garage)** | |
***
### Phone
| Script Name | Compatibility Type | Notes |
| --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----- |
| [gksphone](https://www.gkshop.org/) | **Built-In (creator)** | |
| [jpr-phonesystem](https://jpresources.tebex.io/package/5714959) | **Built-In (creator)** | |
| [lb-phone](https://lbscripts.com/) | **Built-In (creator)** | |
| [mPhone](https://codem.tebex.io/package/6372523%20/) | **Built-In (creator)** | |
| [okokPhone](https://okok.tebex.io/package/6123242) | **Built-In (creator)** | |
| [qb-phone (renewed)](https://github.com/Renewed-Scripts/qb-phone/tree/7004231ac178a455de9d551bcd7215c14b337cbb) | **Minor Changes Required** | [Integration Guide](https://docs.codesign.pro/paid-scripts/garage/resource-integration/qbcore#phone)|
| [qb-phone](https://github.com/qbcore-framework/qb-phone) | **Minor Changes Required** | [Integration Guide](https://docs.codesign.pro/paid-scripts/garage/resource-integration/qbcorea#garage-phone-apps)|
| [qs-smartphone-pro](https://www.quasar-store.com/package/5652439) | **Built-In (creator)** | |
| [roadphone](https://fivem.roadshop.org/package/4885785) | **Built-In (creator)** | |
| [yphone](https://teamsgg.dev/scripts/yphone) | **Built-In (creator)** | |
| [17mov\_Phone](https://17movement.net/scripts/7107328) | **Built-In (creator)** | |
***
### Vehicle Shop
| Script Name | Compatibility Type | Notes |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ----- |
| cdev-vehcleshop | **Built-In (creator)** | |
| [esx\_vehicleshop](https://github.com/esx-framework/ESX-Legacy-Addons/tree/main/[esx_addons]/esx_vehicleshop) | **Built-In (cd\_garage)** | |
| [okokVehicleShop](https://okok.tebex.io/package/4874585) | **Minor Changes Required** | [Integration Guide](https://docs.codesign.pro/paid-scripts/garage/resource-integration/paid-resources#okok-vehicleshop)|
| [qb-vehicleshop](https://github.com/qbcore-framework/qb-vehicleshop) | **Minor Changes Required** | [Integration Guide](./)|
| [vms\_vehicleshopv2](https://www.vames-store.com/package/6153182) | **Built-In (creator)** | |
***
---
---
url: /paid-scripts/garage/resource-integration/integration-guides.md
---
# Integration Guides
## Add Key
### es\_extended
View the code on GitHub: [ex\_extended/client/functions.lua](https://github.com/esx-framework/esx_core/blob/b3deeae1ebd6a465310857001e02b34236d97a0e/[core]/es_extended/client/functions.lua#L570)
Add the line of code exactly as seen in the screenshot below.
```lua:line-numbers=570 [ex_extended/client/functions.lua — line 570]
TriggerEvent('cd_garage:AddKeys', exports['cd_garage']:GetPlate(vehicle))
```
![]()
### okok-vehicleshop
Add the line of code exactly as seen in the screenshot below.
```lua [okokVehicleShop/cl_utils.lua — line 33 (approx)]
TriggerEvent('cd_garage:AddKeys', plate)
TriggerEvent('cd_garage:RemoveKeys', plate)
```
![]()
## Housing
### ps-housing
View the code on GitHub: [ps-housing/client/cl\_property.lua](https://github.com/Project-Sloth/ps-housing/blob/8e5eaa9684f720022d7089146a6b8354dd141fe2/client/cl_property.lua#L258).
Replace whole function.
![]()
## Job Garage
### esx\_policejob
#### **Personal Owned Job Garage**
View the code on GitHub: [esx\_policejob/server/main.lua](https://github.com/esx-framework/ESX-Legacy-Addons/blob/973ae5390b61e3e6e6e2f507fe8d13cb8d2370af/[esx_addons]/esx_policejob/server/main.lua#L377)
REPLACE the line of code exactly as seen in the screenshot below.
```sql:line-numbers=377 [esx_policejob/server/main.lua — line 377]
MySQL.insert('INSERT INTO owned_vehicles (owner, vehicle, plate, type, job_personalowned, `stored`) VALUES (?, ?, ?, ?, ?, ?)', { xPlayer.identifier, json.encode(vehicleProps), vehicleProps.plate, type, xPlayer.job.name, true},
```

#### **Society Owned Job Garage**
View the code on GitHub: [esx\_policejob/server/main.lua](https://github.com/esx-framework/ESX-Legacy-Addons/blob/973ae5390b61e3e6e6e2f507fe8d13cb8d2370af/[esx_addons]/esx_policejob/server/main.lua#L377)
REPLACE the line of code exactly as seen in the screenshot below.
```sql:line-numbers=377 [esx_policejob/server/main.lua — line 377]
MySQL.insert('INSERT INTO owned_vehicles (owner, vehicle, plate, type, job, `stored`) VALUES (?, ?, ?, ?, ?, ?)', { xPlayer.job.name, json.encode(vehicleProps), vehicleProps.plate, type, xPlayer.job.name, true},
```

## Remove Persistent Vehicle
### es\_extended
View the code on GitHub: [es\_extended/client/functions.lua](https://github.com/esx-framework/esx_core/blob/4ce57fc5662fc791b3dcdf73be96079e273bf61d/[core]/es_extended/client/functions.lua#L405)
Add the line of code exactly as seen in the screenshot below.
```lua:line-numbers=23 [es_extended/client/functions.lua — line 23]
TriggerServerEvent('cd_garage:RemovePersistentVehicles', exports['cd_garage']:GetPlate(vehicle))
```
![]()
## ::: info Do vehicles still respawn after deleting them?
* If deleted vehicles still respawn, one of your resources may not be using the ESX delete vehicle function.
* Go to [#persistent-vehicles](../features.md#persistent-vehicles "mention").
* Add the required delete vehicle event to that resource.
:::
## Garage Type
### esx\_boat
**Update Garage Type**
View the code on GitHub: [esx\_boat/client/main.lua](https://github.com/esx-framework/ESX-Legacy-Addons/blob/973ae5390b61e3e6e6e2f507fe8d13cb8d2370af/[esx_addons]/esx_boat/client/main.lua#L122)
Add the line of code exactly as seen in the screenshot below.
```lua:line-numbers=122 [esx_boat/client/main.lua — line 122]
TriggerEvent('cd_garage:UpdateGarageType')
```
![]()
### okok-vehicleshop
**Set garage type after a vehicle is purchased (for boats and air vehicles)**
Add the line of code exactly as seen in the screenshot below.
```lua
TriggerClientEvent('cd_garage:UpdateGarageType', source)
```
![]()
### qb-vehicleshop
View the code on GitHub: [qb-vehicleshop/client/main.lua](https://github.com/qbcore-framework/qb-vehicleshop/blob/6fddc5bc25d6b52eaee29d233d0e1c6652b99490/client.lua#L657)
Add the line of code exactly as seen in the screenshot below.
```lua:line-numbers=657 [qb-vehicleshop/client/main.lua — approx. line 657]
TriggerEvent('cd_garage:UpdateGarageType')
```

---
---
url: /paid-scripts/garage/resource-integration/housing-integration.md
description: >-
This page explains how housing developers can make their property garages work
with `cd_garage`.
---
# Housing Integration for Developers
This page explains how housing developers can make their property garages work with `cd_garage`.
There are two ways to integrate a housing garage.
## Method 1: Housing Script Handles the Interaction
Use this method if your housing script already has its own garage interaction points.
With this method, the housing script handles the interaction, but `cd_garage` still handles the garage data, vehicle list, vehicle spawning, and vehicle storing.
**How it works**
* The player uses the garage interaction from the housing script.
* The housing script triggers the `cd_garage` open property garage event.
* `cd_garage` checks if there is already a property garage near the player.
* If a property garage exists, it opens that garage.
* If no property garage exists, `cd_garage` creates one using the player’s current location.
* When storing a vehicle, the housing script triggers the store vehicle event.
* `cd_garage` stores the vehicle into the nearby property garage.
**Recommended**
* When opening the garage, send the vehicle spawn coords in the first event argument.
* This allows `cd_garage` to use the correct vehicle spawn location.
* If no spawn coords are sent, the player’s current coords and heading will be used.
[👉 View Open Property Garage Event →](/paid-scripts/garage/developer-api/events#open-property-garage)
[👉 View Store Vehicle in Property Garage Event →](/paid-scripts/garage/developer-api/events#store-vehicle-in-property-garage)
## Method 2: cd\_garage Handles the Garage
Use this method if you want `cd_garage` to fully handle the property garage.
With this method, the housing script only needs to create the garage when a player purchases or creates a property.
**How it works**
* A player purchases or creates a property.
* The housing script triggers the create property garage event.
* The property garage is saved to the `cd_garage` database.
* `cd_garage` handles the interaction point, garage UI, vehicle spawning, and vehicle storing.
* The garage can also be managed through the `cd_garage` system.
This is the recommended method for new integrations.
[👉 View Create Property Garage Event →](/paid-scripts/garage/developer-api/events.md#create-property-garage)
---
---
url: /paid-scripts/garage/migration-guide.md
description: >-
Migration guide for moving from other garage scripts to cd_garage. Covers
supported migrations and data preservation for vehicle storage.
---
# Migration Guide
**Migration Type Key**
| State | Description |
| --- | --- |
| Built-in Migration | Automatically supported with no SQL changes, code changes, or manual setup required. |
| Minor Migration Required | Requires a simple command, SQL query, or small code change. All required queries or code are provided. Usually completed in minutes. |
| Moderate Migration Required | Requires provided SQL queries and some code changes across a few files. Usually completed in 5–15 minutes. |
| Major Migration Required | Requires multiple SQL queries and larger code changes across several files. Usually takes 1+ hours. |
## Supported Garage Migrations
See which dispatch scripts can be migrated without needing to replace all existing alert exports or notification code.
## ::: info Automatic Migration Note
**No code changes are required when migrating from the listed scripts. Existing vehicle data is handled automatically by `cd_garage`, so your stored vehicles and vehicle-related database data will not be lost during the migration.**
:::
| Script Name | Migration Type | Notes |
| ------------------------------------------------------------ | ----------------------------------------------------------- | -------------------------------------------------------- |
| cd\_garage (v5) | **Built-In Migration** | Paste your old config into the in-game UI to migrate it. |
| [jg\_garage](https://jgscripts.com/scripts/advanced-garages) | **Built-In Migration** | Paste your old config into the in-game UI to migrate it. |
## Migration Data Comparison
This table shows what important data can usually be kept when moving to our garage system.
## ::: info Key
✅ **Migrated / Reused**
* Existing data can be migrated or reused
❌ **Reconfigure**
* Existing data cannot be migrated or reused, but can be reconfigured again
⚠️ **Not Used**
* Your old garage script does not have this feature
:::
| Data | jg-advancedgarages | cd\_garage v5 |
| ----------------------------------- | ------------------ | ------------- |
| Public garage locations | ✅ | ✅ |
| Impound locations | ✅ | ✅ |
| Private garage locations | ✅ | ✅ |
| Job garage locations | ✅ | ✅ |
| Gang garage locations | ✅ | ✅ |
| Stored player vehicles | ✅ | ✅ |
| Vehicle ownership | ✅ | ✅ |
| Vehicle garage ID / stored location | ✅ | ✅ |
| Vehicle mods / properties | ✅ | ✅ |
| Vehicle stored state | ✅ | ✅ |
| Impounded vehicle status | ✅ | ✅ |
| Vehicle fuel | ✅ | ✅ |
| Vehicle engine / body health | ✅ | ✅ |
| Garage vehicle types | ✅ | ✅ |
| Garage blips | ✅ | ✅ |
| Spawn points | ✅ | ✅ |
| Job garage vehicles | ✅ | ✅ |
| Personal owned job vehicles | ✅ | ✅ |
| Society owned job vehicles | ✅ | ✅ |
| Old config settings | ❌ | ❌ |
| Old keybind settings | ❌ | ❌ |
---
---
url: /paid-scripts/garage/migration-guide/upgrading-from-cd_garage-v5.md
description: >-
Full upgrade guide from cd_garage v5 to v6 including backup instructions,
migration steps, reconfiguration, and post-update checks.
---
# Upgrading From cd\_garage v5
**Important v6 Upgrade Notes**
* `cd_garage` v6 has been fully rewritten from the ground up.
* Most garage setup is now done in-game using `/garageconfig`.
* You can migrate your old v5 garage locations into the new system.
* Garage locations are now saved in the database.
* Vehicle keys have been reworked, with new built-in options including physical keys.
* Some old v5 settings will not transfer directly and must be configured again in the new in-game configurator.
***
**Before You Upgrade**
* Make a full database backup before making any changes.
* Save a copy of your old `cd_garage` v5 config.
* Do not delete your old v5 files until the upgrade is complete and tested.
* Do not run v5 and v6 at the same time.
***
**Installing v6**
* [installation-guide.md](../installation-guide.md "mention")
***
**Migrating Your Old Config**
* Open the in-game garage config UI using `/garageconfig`.
* Go to the migration section.
* Paste your old v5 config into the migration tool.
* Run the migration.
* Review all imported garage locations.
::: warning
#### **Regular Job Garage Vehicle Names**
* The vehicle name may show as the model hash if no label is found in the vehicle model data [#vehicles-model-data](../features.md#vehicles-model-data "mention").
* To fix this, manually rename the vehicles in the in-game config UI.
:::
***
**What Will Be Migrated**
* Public garage locations.
* Private garage locations.
* Job garage locations.
* Gang garage locations.
* Impound locations.
* All personal owned job vehicles.
* All society owed job vehicles.
***
**What You Need To Configure After Migration**
* Only the migrated data, such as garage locations, is imported automatically.
* Most other settings must be configured again in the new in-game configurator.
* Use `/garageconfig` to review and set up the remaining garage settings.
***
**After Upgrade Checklist**
* Check all public garages.
* Check all private garages.
* Check job and gang garages.
* Check impounds.
* Check spawn points and headings.
* Test storing and retrieving vehicles.
* Test impounding and retrieving vehicles.
* Test vehicle keys if using the built-in key system.
* Check the server console for errors.
---
---
url: /paid-scripts/garage/changelog.md
description: >-
Latest updates, changes, and improvements for cd_garage. Tracks version
history, new features, bug fixes, and compatibility updates.
---
# Changelog
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
## ::: danger Important Notice (cd\_bridge dependency)
Since **v5.1.0**, `cd_garage` requires `cd_bridge` to work.\
This improves compatibility and makes future updates easier.
:::
## v6.0.3
```bash [Files Changed]
fxmanifest.lua
configs/config.lua
server/garage/get_vehicles.lua
server/garage/store_vehicle.lua
client/main/client.lua
```
## ::: tip Added
* Added backwards compatibility for the old society vehicle method, where the job name is used as the vehicle identifier.
:::
## ::: info Changes
* Improved the UI loading debug and warning messages to confirm when the UI has successfully loaded.
:::
## v6.0.2
```bash [Files Changed]
fxmanifest.lua
client/garage/sort_vehicle_data.lua
server/features/keys/keys.lua
```
## ::: warning Fixes
* Fixed vehicles being unable to be returned to a different garage.
* Fixed vehicles being unable to be transferred when they were stored in a different garage and needed to be returned first.
* Fixed players being able to give temporary keys for vehicles they do not own.
:::
## v6.0.1
## ::: warning Fixes
* Fixed liveries not being retrieved in the regular job garage editor.
* Fixed issues with vehicle release times in impounds.
* Fixed issues when setting the minimum job grade required for regular job vehicles.
* Fixed issues with the garage raid system.
* Fixed vehicle preview images not displaying in the keys UI.
* Fixed issues when giving keys for saved vehicles.
:::
## v6.0.0
## ::: tip Added
* STABLE V6 RELEASE
:::
## v6.0.20.beta
```bash [Files Changed]
fxmanifest.lua
client/features/blips.lua
```
## ::: warning Fixes
* Fixed impound blips not stacking when Config.StackBlips is enabled.
:::
## v6.0.19.beta
## ::: warning Fixes
* Fixed incorrect colours in the inside garage UI.
* Fixed errors occurring when exiting an inside garage.
* Fixed impounds not displaying a blip or being accessible to the public, incorrectly restricting them to authorised jobs only.
* Fixed webhook errors when unimpounding a vehicle.
* Fixed an impound opening error caused by mileage formatting.
* Fixed persistent vehicles not saving after a resource or server restart.
:::
## v6.0.18.beta
## ::: tip Added
* Re-added mileage tracking to the garage. This uses the same mileage system as `cd_mechanic`. If `cd_mechanic` is running, the garage mileage system will automatically stop.
* Added default garage locations, which are automatically inserted when no garage locations are configured. If an old configuration is migrated, the default garage locations are automatically removed.
* Added a plate input option for `/vehicle-plate`.
* Added a ped heading input for garage locations that use peds.
:::
## ::: info Changes
* Regular job vehicle plates are now randomly generated each time the garage is opened.
* Vehicle mileage is now saved to the default framework database columns when storing a vehicle.
* Garages are now sorted alphabetically by default in the UI.
:::
## ::: warning Fixes
* Plate duplicate checks now work correctly with full-length plate inputs.
* Garage location headings now correctly match the in-game heading.
* Improved the configuration and JavaScript loading timeout system. If loading takes longer than expected, the script will continue waiting and display a warning instead of breaking and returning an error code.
:::
## v6.0.17.beta
## ::: warning Fixes
* Fixed regular job garage plate creation to auto-fill empty spaces and check that the new plate does not already exist.
* Fixed garage blips not being removed when disabled.
* Fixed vehicle spawn headings not being set correctly. This fix was made in `cd_bridge v1.0.37`.
:::
## v6.0.16.beta
## ::: info Changes
* Updated the vehicle model data error text to explain which file the missing vehicle data should be added to.
* Updated the vehicle transfer blacklist to accept the vehicle spawn name as well as the model hash.
:::
## ::: warning Fixes
* Fixed the job list sometimes not loading when creating a job garage.
* Fixed garage ped headings not being set correctly.
* Fixed physical keys being given when spawning a vehicle while the keys are already in the ignition.
* Fixed the missing impound locale.
* Updated society owned job vehicle transfers so the society pays the transfer fee instead of the player.
* Fixed public garages showing in the transfer garage list for job garages.
* Fixed plate creation for regular job garages. You can now enter one or more characters in the plate field, and the script will automatically fill the rest until it reaches 8 characters.
:::
## v6.0.15.beta
## ::: warning Fixes
* Fixed vehicle keys not being given when using the add key event with the physical keys config option enabled.
:::
## v6.0.13.beta
## ::: tip Added
* Added an advanced theme editor that shows all CSS properties.
* Added a copy button to the config UI.
:::
## ::: info Changes
* Updated config migration to try and get the vehicle label from vehicle model data when available, such as QBCore's shared vehicle file.
:::
## ::: warning Fixes
* Fixed garage slots not hiding properly when the setting is disabled.
* Fixed the engine not turning back on after being turned off in a hotwired vehicle.
* Fixed vehicles being deleted when storing failed.
* Increased the config timeout timer to prevent the config from timing out during longer script load times.
:::
## v6.0.12.beta
## ::: info Changes
* Garage slots can now be purchased directly from the garage UI. Players can also view their current garage slot count and limit from the UI.
* Added a garage search option to the transfer menu.
* Added a garage search option to the config menu.
* Migration now also converts society-owned job vehicles to the new database structure.
:::
## ::: warning Fixes
* Job vehicle plates are now fully randomized during migration, instead of using the plate prefix from the old config.
* Fixed inside garage errors and exit handling.
* Fixed other players being visible inside the garage.
* Fixed duplicate plates being allowed when adding regular job vehicles in the configurator.
:::
## v6.0.11.beta
## ::: info Changes
* Updated society job garage return fees so the fee is taken from the job society account when a vehicle is returned.
:::
## ::: warning Fixes
* Fixed society job garages not working correctly.
* Fixed `cd_garage:SetJobOwnedVehicle` not working because it was not updated to the new society garage database saving method.
:::
## v6.0.10.beta
## ::: warning Fixes
* Added support for pasting a `jg-advancedgarages` config into the migration tool to fully migrate garage locations into v6.
* Fixed a major issue that caused data to load incorrectly, leading to most server start-up errors and config UI save errors.
* Updated impound permissions to use two separate options: `ImpoundVehiclePerms` and `UnimpoundVehiclePerms`. You can now choose which jobs can impound vehicles and which jobs can retrieve vehicles from impound.
* Improved default `garage_id` handling for `owned_vehicles` / `player_vehicles`. The default value is now set when the first garage is added, when no default is currently set, and on script start if the database default does not match any current garage.
* Added an automatic theme database fix. If no theme is active, one will now be set automatically.
:::
## v6.0.9.beta
## ::: warning Fixes
* Fixed migration issues with very old configs caused by the `L` function error.
* Fixed impound garage job settings.
* Updated config migration so the default `garage_id` value in the vehicles database is set from the first garage in the old config.
* Removed the `car_` prefix from public garage IDs when migrating configs.
:::
## v6.0.8.beta
## ::: warning Fixes
* Minor hotfix
:::
## v6.0.7.beta
## ::: warning Fixes
* Minor hotfix
:::
## v6.0.6.beta
## ::: info Changes
* Improved start-up error handling to make script loading errors easier to identify and debug.
:::
## v6.0.5.beta
## ::: info Changes
* Set a new correct default `garage_id` in the `owned_vehicles` / `player_vehicles` database table when using the migration feature, so vehicles no longer keep the old version's garage ID.
* Adjusted theme colors.
:::
## ::: warning Fixes
* Fixed the active theme not loading correctly.
* Fixed a server-side `GiveVehicleKeys` and `RemoveVehicleKeys` nil error when vehicle keys are disabled.
* Added automatic insertion of default themes into the database.
* Stopped unnecessary mass server-side errors when the config fails to load. The real config error will now be easier to find.
* Fixed a rare vehicle data repair issue where broken props could bypass the auto-fix checks and cause the repair process to error.
* Fixed impounds not opening when using Text UI or Interact Image.
* Fixed vehicles erroring when retrieving them from impound after being impounded during the same script restart.
:::
## v6.0.4.beta
## ::: tip Added
* Added a new `StackBlips` option to the in-game config, which stacks garage blips together to avoid reaching the blip limit.
* Added a loading screen for the config UI.
* Added a minimise button to the config UI.
* Added an option to hide vehicle mileage.
* Added more detailed error logs for map loading.
:::
## ::: warning Fixes
* Fixed garage setup not setting the heading correctly when using `Get Coords`.
* Fixed teleporting to migrated garage locations not using the exact coordinates.
* Fixed auto SQL inserts not running correctly.
* Normalised heading input for spawn locations.
* Updated `Get Coords` to include the heading for spawn locations.
* Hide vehicle transfer option when disabled in config.
* Fixed the map not unloading correctly.
* Fixed theme loading.
:::
## v6.0.3.beta
## ::: tip Added
* Added a new **Default** option when creating or editing public garage locations. This marks the garage where newly purchased or database-added vehicles will be sent.
:::
## ::: warning Fixes
* Stopped repeated error messages when the config fails to load.
* Fixed an error when auto-inserting the default garage config.
* Fixed the `RemovePhysicalKey` nil error when vehicle keys or physical keys are disabled.
* Fixed `cd_garage_keys` not being automatically inserted into the database.
:::
## v6.0.2.beta
## ::: warning Fixes
* Fixed the keys UI closing when pressing buttons.
* Fixed config loading when using locales other than `EN`.
* Added various other minor fixes.
* Fixed client-side exports not being registered correctly.
* Auto SQL fixes now check the database first, so they only run when changes are actually needed.
* Added a check to make sure `cd_garage_privategarage` exists before trying to migrate data from it.
* Fixed a typo where private garage text incorrectly said public garages.
:::
## v6.0.1.beta
## ::: info Changes
* Updated the version check to clearly warn when a beta version is being used.
:::
## ::: warning Fixes
* Fixed the `"theme"` NUI F8 error.
* Fixed the `"map"` and `"v is not iterable"` NUI F8 errors.
* Fixed the garage config UI freezing after losing NUI focus and not closing correctly.
* Fixed migration errors caused by large blocks of commented-out text in v5 config files.
* Fixed vehicle images in the UI showing the wrong vehicle.
* Fixed a server-side error when calculating impound prices.
:::
## v5.1.17
## ::: tip Added
* Added a config option to enable dispatch alerts when a vehicle is hotwired.
:::
## ::: info Changes
* Made changes to the code to support `cd_mechanic`.
* Removed `adv_stats` from the database, we will now use the framework default tables such as `mileage` / `drivingdistance`.
:::
## ::: warning Fixes
* Fixed an issue where all players would receive vehicle keys when a fake plate was added or removed.
* Fixed an issue where the DrawText UI would reopen after leaving a garage area.
* Fixed an issue where vehicles with fake plates could not be returned to the garage, which also caused vehicle spawn attempts to abort client-side.
:::
## v5.1.16
```bash [Files Changed]
fxmanifest.lua
server/main/callbacks.lua
server/main/error_handling.lua
server/other/fake_plate.lua
```
## ::: tip Added
* Added DE locales.
:::
## ::: info Changes
* The garage now uses the bridge to generate random vehicle plates.
* Improved and refined the debug system.
:::
## ::: warning Fixes
* Fixed an issue where the plate could be nil in the `cd_garage:VehiclePlateChanged` server event.
* Fixed an issue in the fake plates code where the `RemoveItem` function could receive a nil amount.
* Fixed an issue where fake plates were only visible to the player applying them and not to others nearby.
:::
---
---
url: /paid-scripts/cd_mechanic.md
description: >-
Advanced FiveM mechanic job script with full vehicle customization, advanced
upgrades, parts degradation, crafting, business inventory, service system, and
public LS Customs.
---
# Mechanic
[**Buy Here**](https://codesign.pro/mechanic)
**FiveM Forums Post**
[**YouTube Walkthrough Video**](https://www.youtube.com/watch?v=LbuML0r0qmY)
## 📘 Start Here
* [**Installation Guide**](installation-guide.md)\
Step-by-step setup and configuration.
* [**Troubleshooting Guide**](troubleshooting-guide.md)\
Common issues and error codes.
* [Features & Usage](features-and-usage.md)\
All optional features that can be enabled in config explained.
***
### 🔧 Developer API
* [**Chat Commands**](developer-api/chat-commands.md)\
Player & staff commands with usage examples.
* [**Events**](developer-api/events.md)\
Client and server events with Lua examples.
* [**Exports**](developer-api/exports.md)\
Optional functions for integrating with other scripts.
* [**Keys**](developer-api/keys.md)\
Default keybinds.
* [Items](developer-api/items.md)\
Default items and item-based interactions.
***
### 🧠 Need Help?
* **Support:** Join our Discord –
---
---
url: /paid-scripts/cd_mechanic/installation-guide.md
description: >-
Step-by-step installation guide for cd_mechanic. Covers cd_bridge dependency,
download from CFX Portal, dependencies setup, auto SQL, item configuration,
and business setup.
---
# Installation Guide
{% youtube LbuML0r0qmY %}
## 1. Codesign Bridge
:::danger ** This script requires `cd_bridge` to be installed and running before it can function**
`cd_bridge` is plug-and-play and requires no setup. It automatically handles:
* Framework integration
* Database setup
* Script compatibility
* Error Handling
Once started, it will detect and connect to all supported scripts automatically.
[**See the \[Full Bridge Setup Guide\]**](https://docs.codesign.pro/paid-scripts/bridge/installation-guide)
:::
## 2. Download Script
#### Download the Script from the FiveM Portal Website
1. [**Download cd\_mechanic**](https://portal.cfx.re/assets/granted-assets?search=cd_mechanic)
2. Unzip the downloaded file.
3. In your server's `resources` folder, create a folder named `[codesign]` if it does not already exist.
4. Place `cd_mechanic` (and all other Codesign scripts) inside the `[codesign]` folder.
![]()
Example of a resources folder with a `[codesign]` directory.
## 3. Install Dependencies
#### **Required & Optional Dependencies**
* Dependencies are either included in **`[cd_mechanic/dependencies]`** or have a text file with a download link (GitHub/Cfx Portal).
* Place them in your server's **`[codesign]`** folder
* Do not place them inside the `cd_mechanic` folder
* Required dependencies start automatically
## 4. Database Setup (SQL)
#### No manual SQL setup required.
The script automatically inserts all required database tables.
```lua
Config.AutoInsertSQL = true
```
Make sure this is enabled in `configs/config.lua`.
## 5. Items
#### Items to add to your inventory or framework
Use the link below to find copy-paste item tables for your inventory or framework.
[#item-setup](developer-api/items.md#item-setup "mention")
## 6. Configure Script
### `config.lua` Settings
* Start by configuring `cd_mechanic/configs/config.lua` first
* This file contains the core settings required for basic script functionality
* Most feature-specific settings are located in separate config files
### `config_mod_prices.lua` Settings
After configuring `config.lua`, the next step is `cd_mechanic/configs/config_mod_prices.lua`.
This file contains the main pricing and economy configuration used by both player-run mechanic businesses and public LS Customs locations.
* **Parts Per Thousand**\
Configure how many `basic_vehicleparts` are required based on repair and upgrade value.
* **Standard Mod Prices**\
Configure the base pricing for standard vehicle upgrades as a percentage of vehicle value.
**Important Notes**
* These settings directly affect pricing and vehicle balancing on your server
* It is recommended to review all values before using the script in production
* Default values may not match your server economy or gameplay style
### `config_businesses.lua` Settings
After configuring `config.lua` and `config_mod_prices.lua`, the next step is `cd_mechanic/configs/config_business.lua`.
This is where you can begin configuring the main systems and features used by player-run mechanic businesses.
* **Business Upgrades**\
Configure purchasable business upgrades, tools, and workshop equipment.
* **Crafting**\
Configure the built-in crafting system and additional crafting recipes.
* **Mechanic Shop**\
Configure items that mechanics can purchase through the mechanic shop.
* **Items**\
Configure mechanic-related items such as vehicle parts, repair kits, lighting controllers, OBD scanners, stancers, hydraulics, dyno slips, and NOS items.
* **Other Settings**\
Configure additional business-related behaviour such as work order handling, object syncing, and log expiry.
**Important Notes**
* These settings directly affect pricing, progression, and vehicle balancing on your server
* It is recommended to review all values before using the script in production
* Default values may not match your server economy or gameplay style
### `config_advanced_upgrades.lua` Settings
This file is used for player-run mechanic businesses only and controls the advanced upgrade system, allowing mechanics to install custom performance parts that apply handling and performance changes to vehicles.
* **Advanced Upgrade Categories**\
Configure advanced upgrade categories such as brakes, drivetrain conversions, engine swaps, transmissions, and tyres, including pricing, handling modifiers, required tools, crafting, and mechanic shop settings.
### `config_parts_degradation.lua` Settings
This file controls the parts degradation system, which is a major part of the script and is used by player-run mechanic businesses.
Parts can wear down from normal mileage, vehicle crashes, NOS usage, and aggressive tuning through the tuner tablet.
* **Parts Degradation**\
Configure serviceable vehicle parts, health loss, negative handling effects, repair costs and major failure behaviour.
* **Service Vehicle Repair**\
Configure engine and body repair costs for mechanic service orders.
* **Vehicle Crash Degradation**\
Configure how vehicle crashes damage serviceable parts and apply tuning penalties based on crash severity.
## 7. Business Setup & Usage
### **Create a Mechanic Business**
You must have admin permissions to create a business.
* Go to the location where you want the business to be set.
* Use `/mechanictablet`, open the **Admin App**, and create a business.
Businesses are linked to a job. Once assigned, all players with that job will have access.
After the admin creates the business, the business owner can finish setting it up.
**See the \[Admin Setup Guide]**
### Business Owner Setup
After a business is created, the owner must complete setup using the tablet.
**Required Setup**
1. **Open the Business App**\
Use the tablet to access your business.
2. **Purchase Upgrades**\
Go to the **Upgrades** tab and buy the required upgrades.
3. **Set Upgrade Locations**\
Place each purchased upgrade in the **Shop Layout** tab.
**Optional Setup**
* **Billing Presets**\
Set prices for common services
* **Commissions**\
Set earnings per job grade
* **Manage Staff**\
Hire and manage employees
**See the \[Business Setup Guide]**
### Create LS Customs (Public)
You must have admin permissions.
* Go to the location where you want LS Customs to be set.
* Use `/mechanictablet`, open the **Admin App**, and create a public LS Customs.
**See the \[LS Customs Setup Guide]**
### Using Mechanic Shops & LS Customs
* Go to a mechanic business or LS Customs location
* Press the interaction key (default: **E**) to open the customs menu
*Access methods can be changed in `config.lua`.*
**See the \[Usage Guide]**
## 8. Set Up Discord Logging
### **Configure Discord Logging Webhooks**
The script can send important action logs to Discord using webhooks. These webhook settings can be edited in **`cd_mechanic/configs/server_webhooks.lua`**.
* **Admin Business Actions**\
Logs when an admin creates, edits, or deletes a mechanic business.
* **Admin Customs Actions**\
Logs when an admin creates, edits, or deletes a public LS Customs.
* **Boss business Purchase**\
Logs when a business boss purchases upgrades, including what was bought, the quantity, and the total cost.
* **Mechanic Shop Purchase**\
Logs when mechanic employees purchase items from the mechanic shop.
---
---
url: /paid-scripts/cd_mechanic/troubleshooting-guide.md
description: >-
Troubleshooting guide for cd_mechanic with error codes, common issues, folder
name checks, and escrowed file warnings for FiveM server owners.
---
# Troubleshooting Guide
We recommend checking our [**Self Debugging Guide**](/helpful-guides/self-debugging#troubleshooting) before contacting support.
🔔 **Folder Name**\
Make sure the folder is named `cd_mechanic`.
🔔 **Escrowed Files**\
Do not edit escrowed files in any way.
If you can’t find a solution below, please open a support ticket in our [Discord](https://discord.gg/codesign).
## Error Codes
### Server
**0000** - N/A
### Client
**0000** - N/A
## Common Issues
N/A
---
---
url: /paid-scripts/cd_mechanic/features-and-usage.md
description: >-
Complete features overview for cd_mechanic including advanced upgrades,
business upgrades, crafting, mechanic inventory, mileage tracking, parts
degradation, service system, and public LS Customs.
---
# Features & Usage
***
{% youtube LbuML0r0qmY %}
## Main Features
### Advanced Upgrades
***Tip:** You can search for `Config.AdvancedUpgrades` in `configs/config_prices.lua` to quickly locate all related settings.*
> **What are advanced upgrades?**
>
> *Advanced upgrades are special mechanic-installed performance parts that go beyond normal customs upgrades.*
>
> *Unlike standard upgrades, these use physical items and tools, and must be fitted by a mechanic. They are designed for bigger performance changes, such as improving braking, grip, drivetrain type, engine power, or transmission response.*
>
> *Once installed, an advanced upgrade changes the vehicle’s handling values and stays with that vehicle until it is removed or replaced.*
**Installation Process (Player)**
1. Open the customs UI at a mechanic location
2. Select and purchase an advanced upgrade
3. A service order is created for a mechanic
4. Wait for a mechanic to accept and complete the job
5. Once installed, the vehicle receives the upgrade and handling changes
**Installation Process (Mechanic)**
1. Use the mechanic tablet to open the Work Orders app and accept the order
2. This advanced upgrade item needs to be in your business inventory, if you don’t have one, you can craft it
3. You may need a work tool like an engine lift, transmission lift, or impact driver in your inventory to start the upgrade
4. Follow the instructions to complete the upgrade
### Business Upgrades
***Tip:** You can search for `Config.BusinessUpgrades` in `configs/config.lua` to quickly locate all related settings.*
> *Purchase upgrades in Business App > Upgrades on the tablet.*\
> *Some upgrades are required to use certain features, such as crafting locations and tools like the impact driver, which must be in your inventory to perform specific upgrades.*
**Key Points & Features**
* Locations and car lifts must be placed using the **Shop Layout** tab
* Tools degrade over time and will need to be replaced
* All upgrades are purchased using business society funds
**Locations & Features**
* **Crafting** – Unlocks a crafting location
* **Inventory** – Unlocks an inventory location
* **Crafting Upgrade** – Increases crafting capacity
**Equipment**
* **Car Lift** – Required for advanced upgrades
**Tools**
* **Impact Driver** – Required for basic upgrades
* **Spray Gun** – Required for respraying vehicles
* **Engine Lift** – Required for advanced upgrades
* **Transmission Lift** – Required for advanced upgrades
* **Car Jack** – Required for roadside tyre repairs
### Crafting
> *The crafting system allows mechanics to create vehicle parts, tools, and usable items required for upgrades or sale. It is fully configurable and integrates with the mechanic business inventory, ensuring all materials and crafted items are managed within the system.*
**Key Points & Features**
* Can be disabled to allow use of your own crafting system
* Each craftable item can be individually enabled or disabled in the config
* Required crafting materials are configurable in `config.lua` and `config_prices.lua`
* Can be used to craft vehicle parts, mechanic tools, and usable items for sale
* All materials must be stored in the mechanic business inventory before crafting
* Once crafting has started, you do not need to remain nearby; as a result, crafting times are longer.
* Crafted items are automatically added back into the mechanic business inventory
### Mechanic Business Inventory
> **What Is the Mechanic Business Inventory?**
>
> *The mechanic business inventory is a custom-built storage system designed specifically for mechanic-related items. It operates independently from your main inventory or framework system and is required for storing all crafting materials and vehicle parts used in upgrades.*
**Key Points & Features**
* Must be purchased via the Business Upgrades app before use
* Requires placement after purchase (see Business Upgrades section)
* You can purchase and place multiple inventory locations
* Separate from your personal inventory and server/framework inventory systems
* Only accepts mechanic-related items (e.g., parts, tools, crafting materials)
* Non-mechanic items cannot be stored in this inventory
* Crafted items are automatically added to the business inventory
* Materials and parts must be stored in this inventory to perform upgrades
* Used for both basic and advanced vehicle upgrades
### Mileage
* Mileage is saved per vehicle in `owned_vehicles`/`player_vehicles`.
* Parts degrade based on mileage, reducing health and causing negative performance effects.
### Parts Degradation
***Tip:** You can search for `Config.PartsDegradation` in `configs/config_prices.lua` to quickly locate all related settings.*
> **What is Parts Degradation?**
>
> *Parts Degradation gradually reduces the health of serviceable vehicle components, applying negative tuning effects and potentially causing catastrophic failures when a part is fully worn.*
* Parts degradation can be fully configured in `config_prices.lua`
* Parts degrade over time from mileage, vehicle damage, and aggressive tuning
* As parts wear, their health decreases and negative tuning effects are applied
* Severely worn parts significantly reduce performance and reliability
* At 0 health, parts can cause major failures while driving
* Parts can be repaired using the **Service App** on the mechanic tablet
### Service
> *The service app repairs degraded serviceable parts, restoring their health and removing negative tuning effects, while also repairing engine and body health.*
**How It Works**
1. Mechanic opens the service app on mechanic tablet.
2. Mechanic selects the parts to repair based on the customer’s request
3. The script calculates:
1. The **cost to the customer**
2. The **parts required** from the mechanic
4. The player is charged and the money is held securely in escrow until the job is complete
5. A **work order** is created and required parts are taken from the mechanic’s inventory
6. Once the job is completed:
1. The money is paid to the business (society account)
2. If the job is cancelled:
1. Parts are returned to the mechanic
2. The player is refunded
### Public LS Customs
> *Instant vehicle upgrades with no mechanic or player interaction required, with costs depending on the configured price multiplier.*
**Key Points & Features**
* Created in-game through the Admin App
* Each location can be individually configured after creation
* Supports custom price multipliers per location
* Allows admins to set higher prices compared to player-run mechanic businesses
* All location data and settings are saved in the database
## Secondary Features
### Car Lift
* Must be purchased via **Business App > Upgrades**
* Requires placement using **Business App > Shop Layout**
* Can be interacted with by approaching and pressing **E**
### Chameleon Paint
> **What is Chameleon Paint on Vehicles?**
>
> A special paint finish that changes colour depending on lighting and viewing angle.
>
> **Why is framework compatibility required for Chameleon Paint?**
>
> Most default frameworks do not support saving or applying chameleon paint colours by default. This compatibility setup is required if you want vehicles to properly save, load, and display chameleon paint colours.
Find the **`GetVehicleProperties`** function in your framework files (location may vary depending on your framework version), as shown in the image below.
ESX [`es_extended/client/functions`](https://github.com/esx-framework/esx_core/blob/c0260923bbc4e53b027906ff7eec5b3af9321571/[core]/es_extended/client/functions.lua#L807) *around line **`807`***
QBCore [`qbcore/client/functions`](https://github.com/qbcore-framework/qb-core/blob/1cee09a394e313f3eb738035ab4f1abf6f6401e0/client/functions.lua#L405) *around line **`405`***
QBox [ox\_lib/resource/vehicleProperties/client](https://github.com/overextended/ox_lib/blob/a6eb846e7943a28666383c96bd902480a7f41509/resource/vehicleProperties/client.lua#L140) *around line **`140`***

The image above is an ESX example; QBCore and QBox will look slightly different.
Add the following line to the returned properties table. It does not matter exactly where it is placed, as long as it is inside the `return {}` table:
```lua
cd_mechanic = exports.cd_mechanic:GetVehiclePropertiesAddon(vehicle),
```
Find the **`SetVehicleProperties`** function in your framework files (location may vary depending on your framework version), as shown in the image below.
ESX [`es_extended/client/functions`](https://github.com/esx-framework/esx_core/blob/c0260923bbc4e53b027906ff7eec5b3af9321571/[core]/es_extended/client/functions.lua#L961) *around line **`961`***
QBCore [`qbcore/client/functions`](https://github.com/qbcore-framework/qb-core/blob/1cee09a394e313f3eb738035ab4f1abf6f6401e0/client/functions.lua#L560) *around line **`560`***
QBox [ox\_lib/resource/vehicleProperties/client](https://github.com/overextended/ox_lib/blob/a6eb846e7943a28666383c96bd902480a7f41509/resource/vehicleProperties/client.lua#L302) *around line **`302`***
![]()
The image above is an ESX example; QBCore and QBox will look slightly different.
Add the following code at the very bottom of the `SetVehicleProperties` function. **This must be placed at the bottom of the function** to ensure `cd_mechanic` vehicle data is applied after all framework vehicle properties:
```lua
if props.cd_mechanic then
exports.cd_mechanic:SetVehiclePropertiesAddon(vehicle, props.cd_mechanic)
end
```
### Headlights & Neons
***Tip:** You can search for `Config.HeadlightsNeons` in `configs/config.lua` to quickly locate all related settings.*
> *The headlights and neons system allows players to customize vehicle lighting using the Lighting Controller, enabling color and style adjustments with full synchronization and persistent data storage.*
#### **Key Points & Features**
* Default item setup can be found in the [#player-usable-items](developer-api/items.md#player-usable-items "mention")
* Uses the Lighting Controller usable item to open the UI
* Neons require purchase before use; headlights are available by default.
* All lighting data is saved in the database and persists until changed or removed
* Fully synchronized across all players
### OBD Scanner
***Tip:** You can search for `Config.ObdScanner` in `configs/config.lua` to quickly locate all related settings.*
> **What is the OBD Scanner?**
>
> *The OBD Scanner is a diagnostic tool that allows players to check a vehicle for critical issues, helping identify severely worn or failing serviceable parts.*
#### **Key Points & Features**
* Default item setup can be found in the [#player-usable-items](developer-api/items.md#player-usable-items "mention")
* Crafted by mechanics and can be sold to the public
* Use the OBD Scanner while seated inside a vehicle
* Neons require purchase before use; headlights are available by default.
* All lighting data is saved in the database and persists until changed or removed
* Fully synchronized across all players
### Stancer
***Tip:** You can search for `Config.Stancer` in `configs/config.lua` to quickly locate all related settings.*
> **What is a stancer?**\
> *A stancer is a tuning tool that allows you to adjust a vehicle’s suspension stance, including wheel offset, camber, and ride height. It is primarily used for visual customization, giving vehicles a more aggressive or lowered appearance.*
**Key Points & Features**
* Default item setup can be found in the [#player-usable-items](developer-api/items.md#player-usable-items "mention")
* Uses the Stancer usable item to open the UI
* All stance data is saved in the database and persists until changed or removed
* Fully synchronized across all players
---
---
url: /paid-scripts/cd_mechanic/developer-api/events.md
description: >-
Client and server events reference for cd_mechanic. Includes open tablet, open
customs, view slips, open inventory, crafting, cancel upgrade, repair kit, OBD
scanner, and NOS installation events.
---
# Events
:::info Note
These events are optional and can be used in your scripts or custom systems.
:::
## Client
### **Client-Side Events**
* Defined with **`RegisterNetEvent`** or **`AddEventHandler`** **in client files**.
* Triggered using **`TriggerEvent`** (if from client) or **`TriggerClientEvent`** (if from server).
* Runs only on **one player’s game client** (the player’s PC).
### Open Tablet
Opens the mechanic tablet.
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:OpenTablet')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:OpenTablet', source)
```
:::
### Open Customs
Opens mechanic and public customs.
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:OpenCustomsUI')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:OpenCustomsUI', source)
```
:::
### View Slips
View accepted work orders and start work on vehicles.
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:WorkOrder:ShowSlips')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:WorkOrder:ShowSlips', source)
```
:::
***
### Open Inventory
Opens the mechanic inventory (Codesign).
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:Inventory:Open')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:Inventory:Open', source)
```
:::
***
### Open Crafting
Open mechanic crafting.
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:Crafting:Open')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:Crafting:Open', source)
```
:::
### Cancel Vehicle Upgrade
Cancels the vehicle upgrade process and resets the job slip so it can be started again.
```lua
TriggerClientEvent('cd_mechanic:Crafting:Open', source)
```
### Cancel Vehicle Upgrade
Cancels the vehicle upgrade process and resets the job slip so it can be started again.
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:WorkOrder:CancelSlip')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:WorkOrder:CancelSlip', source)
```
:::
### Use Repair Kit
Uses a repair kit to restore the vehicle to a configurable health level. This event bypasses the item checks and item removal.
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:UseRepairKit')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:UseRepairKit', source)
```
:::
### Open OBD Scanner
Opens the OBD scanner to check for critical vehicle errors. This event bypasses the item checks.
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:ObdScanner:UseItem')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:ObdScanner:UseItem', source)
```
:::
### Install NOS
Installs a NOS system on the vehicle. This event bypasses the item checks and item removal.
```lua [Parameters]
--- @param vehicle number The vehicle entity.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
TriggerEvent('cd_mechanic:Nos:InstallNos', vehicle)
```
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:Nos:InstallNos', vehicle)
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:Nos:InstallNos', source, vehicle)
```
:::
### Refill NOS
Refills the NOS system back to 100.0 on the vehicle. This event bypasses the item checks and item removal.
```lua [Parameters]
--- @param vehicle number The vehicle entity.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
TriggerEvent('cd_mechanic:Nos:RefillCanister', vehicle)
```
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:Nos:RefillCanister', vehicle)
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:Nos:RefillCanister', source, vehicle)
```
:::
### Open RGB Controller
Opens the RGB lighting controller. This event bypasses the item checks.
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:HeadlightsNeons:UseRgbController')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:HeadlightsNeons:UseRgbController', source)
```
:::
### Use Car Jack
Use the car jack on the nearest vehicle. This event bypasses the item checks and item removal.
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:CarJack:UseItem')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:CarJack:UseItem', source)
```
:::
***
### Open Car Lift Controls
Opens the controls to operate the car lift.
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:Carlift:OpenControls')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:Carlift:OpenControls', source)
```
:::
### Set Stancer
Set the stancer data of a vehicle.
```lua [Parameters]
--- @param vehicle number The vehicle entity.
--- @param stancerData table The stancer data to set.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local stancerData = {
height = 0.0,
wheels = {
['0'] = {offset = -0.75, rotation = 0.0},
['1'] = {offset = 0.75, rotation = 0.0},
['2'] = {offset = -0.75, rotation = 0.0},
['3'] = {offset = 0.75, rotation = 0.0}
}
}
TriggerEvent('cd_mechanic:Stancer:Set', vehicle, stancerData)
```
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_mechanic:Stancer:Set', vehicle, stancerData)
```
```lua [server-side to client-side]
TriggerClientEvent('cd_mechanic:Stancer:Set', source, vehicle, stancerData)
```
:::
## Server
### **Server-Side Events**
* Defined with **`RegisterServerEvent`** or **`AddEventHandler`** **in server files**.
* Triggered using **`TriggerEvent`** (if from server) or **`TriggerServerEvent`** (if from client).
* Runs on the **server**, not on any individual player’s game client.
---
---
url: /paid-scripts/cd_mechanic/developer-api/exports.md
description: >-
Exports reference for cd_mechanic including GetCustomVehicleClass,
GetVehiclePerformanceStats, GetConfig, GetVehicleMileage, and
GetPartsDegradation for client and server use.
---
# Exports
## ::: info Note
These exports are optional and available for use in your scripts or integrations.
:::
## Client
### Get Custom Vehicle Class
Returns the custom racing style vehicle class of a vehicle.
```lua [Parameters]
--- @param vehicle number Vehicle entity.
--- @return table # { class = string, rating = number }
-- Class ranges:
-- D (0 - 299)
-- C (300 - 399)
-- B (400 - 499)
-- A (500 - 599)
-- S1 (600 - 699)
-- S2 (700 - 799)
-- X (800+)
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local data = exports.cd_mechanic:GetCustomVehicleClass(vehicle)
print('Vehicle Class:', data.class, 'Vehicle Rating:', data.rating)
-- Example output:
-- Vehicle Class: S2, Vehicle Rating: 750
```
```lua
local class, rating = exports.cd_mechanic:GetCustomVehicleClass(vehicle)
```
***
### Get Vehicle Performance Stats
Returns advanced performance stats for a vehicle.
```lua [Parameters]
--- @param vehicle number Vehicle entity.
--- @return table # Vehicle performance stats.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local vehicleStats = exports.cd_mechanic:GetVehiclePerformanceStats(vehicle)
print(json.encode(vehicleStats, { indent = true }))
```
::: details Example Output
```lua
local vehicleStats = {
base_percentages = {
speed = 52.4,
acceleration = 61.8,
braking = 43.2,
traction = 58.9
},
upgrade_increases = {
speed = 8.5,
acceleration = 6.2,
braking = 3.1,
traction = 4.0
},
tuning_increases = {
speed = 2.4,
acceleration = 1.8,
braking = 0.0,
traction = 1.2
},
final_percentages = {
speed = 63.3,
acceleration = 69.8,
braking = 46.3,
traction = 64.1
},
horsepower = 612.5,
torque_nm = 780.2,
torque_ftlbs = 575.4,
weight = 1650.0
}
```
:::
```lua
local vehicleStats = exports.cd_mechanic:GetVehiclePerformanceStats(vehicle)
```
## Shared
### Get Config
Returns the complete config.lua.
```lua [Parameters]
--- @return table # The complete config.lua.
--- @example
local mechanicConfig = exports.cd_mechanic:GetConfig()
print(json.encode(mechanicConfig, { indent = true }))
```
```lua
local mechanicConfig = exports.cd_mechanic:GetConfig()
```
***
### Get Vehicle Mileage
Returns the mileage of a vehicle.
```lua [Parameters]
--- @param vehicle number|string Vehicle entity or plate text.
--- @return number # This vehicles mileage or 0.0.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local plate = GetVehicleNumberPlateText(vehicle)
-- You can pass either a vehicle entity or a plate.
local mileage = exports.cd_mechanic:GetVehicleMileage(vehicle or plate)
print(mileage)
-- Example output:
-- 1534.67
```
```lua
local mileage = exports.cd_mechanic:GetVehicleMileage(vehicle or plate)
```
***
### Get Parts Degradation
Returns the degradation data for all this vehicle parts.
```lua [Parameters]
--- @param vehicle number|string Vehicle entity or plate text.
--- @return table # A table containing all vehicle parts and their health values.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local plate = GetVehicleNumberPlateText(vehicle)
-- You can pass either a vehicle entity or a plate.
local degradation = exports.cd_mechanic:GetPartsDegradation(vehicle or plate)
print(degradation)
```
::: details Example Output
```lua
local degradation = {
clutch = {
health = 99.22,
tuning = {
negative_effect = -0.08,
handling_modifier = "fClutchChangeRateScaleUpShift"
}
},
tires = {
health = 99.08,
tuning = {
negative_effect = -0.14,
handling_modifier = "fTractionCurveMax"
}
},
brake_fluid = {
health = 99.61,
tuning = {
negative_effect = -0.02,
handling_modifier = "fBrakeForce"
}
},
spark_plugs = {
health = 99.48,
tuning = {
negative_effect = -0.03,
handling_modifier = "fInitialDriveForce"
}
},
radiator = {
health = 99.61,
tuning = {
negative_effect = -0.05,
handling_modifier = "fEngineDamageMult"
}
},
transmission = {
health = 99.61,
tuning = {
negative_effect = -0.03,
handling_modifier = "fClutchChangeRateScaleDownShift"
}
},
brake_pads = {
health = 98.95,
tuning = {
negative_effect = -0.08,
handling_modifier = "fBrakeForce"
}
},
suspension = {
health = 99.61,
tuning = {
negative_effect = -0.03,
handling_modifier = "fSuspensionForce"
}
},
steering = {
health = 99.74,
tuning = {
negative_effect = -0.02,
handling_modifier = "fSteeringLock"
}
},
engine_oil = {
health = 99.74,
tuning = {
negative_effect = -0.03,
handling_modifier = "fEngineDamageMult"
}
},
fuel_system = {
health = 99.61,
tuning = {
negative_effect = -0.03,
handling_modifier = "fDriveInertia"
}
},
air_filter = {
health = 99.35,
tuning = {
negative_effect = -0.03,
handling_modifier = "fInitialDriveForce"
}
}
}
```
:::
```lua
local degradation = exports.cd_mechanic:GetPartsDegradation(vehicle or plate)
```
### **Get Dyno History (Single Vehicle)**
Returns dyno history for a specific vehicle.
```lua [Parameters]
--- @param plate string Vehicle plate text.
--- @return table # Dyno history data.
--- @example
local plate = GetVehicleNumberPlateText(vehicle)
local dyno = exports.cd_mechanic:GetDynoHistory(plate)
print(json.encode(dyno, { indent = true }))
-- Example output:
-- {
-- vehicle_name = "Sultan RS",
-- created = 1775692410
-- dyno_data = {
-- has_turbo = false,
-- tq_nm = 364,
-- hp = 332,
-- vehicle_class = 6
-- }
-- }
```
```lua
local dyno = exports.cd_mechanic:GetDynoHistory(plate)
```
***
### **Get Dyno History** (All Vehicles)
Returns dyno history for all vehicles.
```lua [Parameters]
--- @return table # Dyno history data.
--- @example
local dyno = exports.cd_mechanic:GetDynoHistory()
print(json.encode(dyno, { indent = true }))
```
::: details Example Output
```lua
{
[1] = {
plate =
vehicle_name = "Sultan RS",
created = 1775692410,
dyno_data = {
has_turbo = false,
tq_nm = 364,
hp = 332,
vehicle_class = 6
}
},
[2] = {
vehicle_name = "Elegy Retro",
created = 1775692500,
dyno_data = {
has_turbo = true,
tq_nm = 812,
hp = 741,
vehicle_class = 7
}
}
}
```
:::
```lua
local dyno = exports.cd_mechanic:GetDynoHistory()
```
***
### Get Vehicle Engine Sound
Returns advanced performance stats for a vehicle.
```lua [Parameters]
--- @param vehicle number|string Vehicle entity or plate text.
--- @return table # Vehicle performance stats.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local plate = GetVehicleNumberPlateText(vehicle)
-- You can pass either a vehicle entity or a plate.
local engineSound = exports.cd_mechanic:GetEngineSound(vehicle or plate)
print(engineSound)
-- Example output:
-- 'ADDER'
```
```lua
local engineSound = exports.cd_mechanic:GetEngineSound(vehicle or plate)
```
### Get Stancer Data
Returns the stancer configuration data for a vehicle.
```lua [Parameters]
--- @param vehicle number|string Vehicle entity or plate text.
--- @return table # A table containing the vehicle's stancer settings.
--- @example
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local plate = GetVehicleNumberPlateText(vehicle)
-- You can pass either a vehicle entity or a plate.
local stancer = exports.cd_mechanic:GetStancerData(vehicle or plate)
print(json.encode(stancer, { indent = true }))
```
::: details Example Ouput
```lua
{
height = 0.0,
wheels = {
['0'] = {offset = -0.75, rotation = 0.0},
['1'] = {offset = 0.75, rotation = 0.0},
['2'] = {offset = -0.75, rotation = 0.0},
['3'] = {offset = 0.75, rotation = 0.0}
}
}
```
:::
```lua
local stancer = exports.cd_mechanic:GetStancerData(vehicle or plate)
```
---
---
url: /paid-scripts/cd_mechanic/developer-api/chat-commands.md
description: >-
Chat commands reference for cd_mechanic including /mechanictablet and /slips
for managing the mechanic tablet and work orders.
---
# Chat Commands
:::info Note
These chat commands can be renamed or disabled in the **`Keys and Commands`** section of the `[configs/config.lua]`.
:::
### /mechanictablet
Opens the mechanic tablet.
```bash
/mechanictablet
```
***
### /slips
View accepted work orders and start work on vehicles.
```bash
/slips
```
***
---
---
url: /paid-scripts/cd_mechanic/developer-api/items.md
description: >-
Items reference for cd_mechanic including player usable items, mechanic tools,
upgrade parts, crafting materials, and SQL/item setup for ESX, QBCore, and
QBox inventories.
---
# Items
## ::: info Note
These are the default items. Edit `cd_mechanic/configs/config_business.lua` to customise them.
:::
## Items & Usage
### Player Usable Items
*Items that players can use for vehicle features and diagnostics.*
| Item Name | Usable | Description |
|------------------------|--------|------------------------------------------------|
| `dyno_slip` | true | Displays dyno test results |
| `hydraulic_controller` | true | Controls hydraulic suspension |
| `lighting_controller` | true | Controls vehicle RGB lighting |
| `mechanic_tablet` | true | Opens mechanic tablet |
| `nitros_install_kit` | true | Used to install a nitrous system on a vehicle. |
| `nos_refil_canister` | true | Refills vehicle nitrous systems |
| `obd_scanner` | true | Scans vehicle health and diagnostics |
| `stancing_kit` | true | Adjusts vehicle stance settings |
### Tools (Mechanic Work Items)
*Items used by mechanics to perform upgrades and repairs.*
| Item Name | Usable | Description |
|---------------------|--------|------------------------------------------|
| `car_jack` | true | Used to lift vehicles for tyre repairs |
| `engine_lift` | true | Used for advanced engine swaps |
| `impact_driver` | false | Required for most basic vehicle upgrades |
| `repair_kit` | true | Repairs a vehicle's engine health |
| `respray_kit` | false | Required for respraying vehicles |
| `transmission_lift` | true | Used for advanced transmission upgrades |
***
### Upgrade & Repair Parts
*Parts used to repair vehicles and apply upgrades.*
| Item Name | Usable | Description |
|------------------------|--------|---------------------------------------------------|
| `advanced_vehiclepart` | false | Higher quality part used for advanced upgrades |
| `awd_drivetrain` | false | Converts the vehicle to all-wheel drive |
| `basic_vehiclepart` | false | Standard part used for repairs and basic upgrades |
| `ceramic_brakes` | false | Brake upgrade for maximum braking |
| `fwd_drivetrain` | false | Converts the vehicle to front-wheel drive |
| `offroad_tyres` | false | Better offroad handling |
| `peformance_brakes` | false | Brake upgrade for improved braking |
| `race_transmission` | false | Transmission upgrade for maximum performance |
| `rwd_drivetrain` | false | Converts the vehicle to rear-wheel drive |
| `sport_transmission` | false | Transmission upgrade for improved performance |
| `semi_slick_tyres` | false | Tyre upgrade for improved grip |
| `slick_tyres` | false | Tyre upgrade for maximum grip |
| `v6_engine` | false | V6 engine swap |
| `v8_engine` | false | V8 engine swap |
| `v12_engine` | false | V12 engine swap |
***
### Crafting Materials
*Only one basic crafting material is included by default. You can use your own crafting or raw materials to suit your server.*
| Item Name | Usable | Description |
|-----------|--------|----------------------------------------|
| `iron` | false | Basic material used for crafting items |
## Item Setup
### Adding Inventory Items
*Copy and paste the item format that matches your inventory system below. Each section is pre-configured and ready to use, simply add it to your inventory/framework and adjust values if needed.*
::: details esx / esx\_inventory
```sql
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('dyno_slip', 'Dyno Slip', 1, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('hydraulic_controller', 'Hydraulic Controller', 1000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('lighting_controller', 'Lighting Controller', 500, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('mechanic_tablet', 'Mechanic Tablet', 1000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('nitrous_bottle', 'Nitrous Bottle', 2000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('nitrous_install_kit', 'Nitrous Install Kit', 2000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('obd_scanner', 'OBD Scanner', 1000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('stancing_kit', 'Stancing Kit', 500, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('car_jack', 'Car Jack', 3000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('engine_lift', 'Engine Lift', 5000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('impact_driver', 'Impact Driver', 1500, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('repair_kit', 'Repair Kit', 1000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('respray_kit', 'Respray Kit', 1500, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('transmission_lift', 'Transmission Lift', 4000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('awd_drivetrain', 'AWD Drivetrain', 2000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('advanced_vehiclepart', 'Advanced Vehicle Part', 1000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('basic_vehiclepart', 'Basic Vehicle Part', 1000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('ceramic_brakes', 'Ceramic Brakes', 2000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('fwd_drivetrain', 'FWD Drivetrain', 2000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('offroad_tyres', 'Offroad Tyres', 2000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('performance_brakes', 'Performance Brakes', 2000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('race_transmission', 'Race Transmission', 3000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('rwd_drivetrain', 'RWD Drivetrain', 2000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('semi_slick_tyres', 'Semi Slick Tyres', 1500, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('slick_tyres', 'Slick Tyres', 1500, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('sport_transmission', 'Sport Transmission', 3000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('v6_engine', 'V6 Engine', 4000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('v8_engine', 'V8 Engine', 5000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('v12_engine', 'V12 Engine', 6000, 0, 1);
INSERT IGNORE INTO `items` (name, label, weight, rare, can_remove) VALUES ('iron', 'Iron', 500, 0, 1);
```
:::
::: details qbcore / qb-inventory / codem-inventory / ps-inventory / qs-inventory (esx & qbox) / tgiann-inventory
```lua
-- Player Usable Items
['dyno_slip'] = {
name = 'dyno_slip',
label = 'Dyno Slip',
weight = 1,
type = 'item',
image = 'dyno_slip.png',
unique = true,
useable = true,
shouldClose = true,
description = 'To view the results of this vehicles dyno test.'
},
['hydraulic_controller'] = {
name = 'hydraulic_controller',
label = 'Hydraulic Controller',
weight = 1000,
type = 'item',
image = 'hydraulic_controller.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Controls vehicle hydraulics.',
},
['lighting_controller'] = {
name = 'lighting_controller',
label = 'Lighting Controller',
weight = 500,
type = 'item',
image = 'lighting_controller.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Controls RGB lighting for vehicles.'
},
['mechanic_tablet'] = {
name = 'mechanic_tablet',
label = 'Mechanic Tablet',
weight = 1000,
type = 'item',
image = 'mechanic_tablet.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Used to access mechanic features and apps.'
},
['nitrous_bottle'] = {
name = 'nitrous_bottle',
label = 'Nitrous Bottle',
weight = 2000,
type = 'item',
image = 'nitrous_bottle.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Used to refill nitrous systems.'
},
['nitrous_install_kit'] = {
name = 'nitrous_install_kit',
label = 'Nitrous Install Kit',
weight = 2000,
type = 'item',
image = 'nitrous_install_kit.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Used to install nitrous systems on vehicles.'
},
['obd_scanner'] = {
name = 'obd_scanner',
label = 'OBD Scanner',
weight = 1000,
type = 'item',
image = 'obd_scanner.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Diagnostic tool for vehicles.'
},
['stancing_kit'] = {
name = 'stancing_kit',
label = 'Stancing Kit',
weight = 500,
type = 'item',
image = 'stancing_kit.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Controls vehicle stance settings.'
},
-- Tools (Mechanic Work Items)
['car_jack'] = {
name = 'car_jack',
label = 'Car Jack',
weight = 3000,
type = 'item',
image = 'car_jack.png',
unique = true,
useable = true,
shouldClose = true,
description = 'Used to lift vehicles.'
},
['engine_lift'] = {
name = 'engine_lift',
label = 'Engine Lift',
weight = 5000,
type = 'item',
image = 'engine_lift.png',
unique = true,
useable = true,
shouldClose = true,
description = 'Heavy-duty lift for engines.'
},
['impact_driver'] = {
name = 'impact_driver',
label = 'Impact Driver',
weight = 1500,
type = 'item',
image = 'impact_driver.png',
unique = true,
useable = false,
shouldClose = true,
description = 'Power tool for fast bolt removal.'
},
['repair_kit'] = {
name = 'repair_kit',
label = 'Repair Kit',
weight = 1000,
type = 'item',
image = 'repair_kit.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Repairs a vehicle to get you back on the road.'
},
['respray_kit'] = {
name = 'respray_kit',
label = 'Respray Kit',
weight = 1500,
type = 'item',
image = 'respray_kit.png',
unique = true,
useable = true,
shouldClose = true,
description = 'Used for painting vehicles.'
},
['transmission_lift'] = {
name = 'transmission_lift',
label = 'Transmission Lift',
weight = 4000,
type = 'item',
image = 'transmission_lift.png',
unique = true,
useable = true,
shouldClose = true,
description = 'Used to lift transmissions safely.'
},
-- Upgrade & Repair Parts
['advanced_vehiclepart'] = {
name = 'advanced_vehiclepart',
label = 'Advanced Vehicle Part',
weight = 1000,
type = 'item',
image = 'advanced_vehiclepart.png',
unique = false,
useable = false,
shouldClose = true,
description = 'A high-quality advanced vehicle component.'
},
['awd_drivetrain'] = {
name = 'awd_drivetrain',
label = 'AWD Drivetrain',
weight = 2000,
type = 'item',
image = 'awd_drivetrain.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Converts a vehicle to all-wheel drive.'
},
['basic_vehiclepart'] = {
name = 'basic_vehiclepart',
label = 'Basic Vehicle Part',
weight = 1000,
type = 'item',
image = 'basic_vehiclepart.png',
unique = false,
useable = false,
shouldClose = true,
description = 'A standard vehicle component.'
},
['ceramic_brakes'] = {
name = 'ceramic_brakes',
label = 'Ceramic Brakes',
weight = 2000,
type = 'item',
image = 'ceramic_brakes.png',
unique = false,
useable = false,
shouldClose = true,
description = 'High-performance ceramic brake upgrade.'
},
['fwd_drivetrain'] = {
name = 'fwd_drivetrain',
label = 'FWD Drivetrain',
weight = 2000,
type = 'item',
image = 'fwd_drivetrain.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Converts a vehicle to front-wheel drive.'
},
['offroad_tyres'] = {
name = 'offroad_tyres',
label = 'Offroad Tyres',
weight = 2000,
type = 'item',
image = 'offroad_tyres.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Better offroad handling.'
},
['performance_brakes'] = {
name = 'performance_brakes',
label = 'Performance Brakes',
weight = 2000,
type = 'item',
image = 'performance_brakes.png',
unique = false,
useable = false,
shouldClose = true,
description = 'Performance brake upgrade.'
},
['race_transmission'] = {
name = 'race_transmission',
label = 'Race Transmission',
weight = 3000,
type = 'item',
image = 'race_transmission.png',
unique = false,
useable = false,
shouldClose = true,
description = 'High-performance racing transmission.'
},
['rwd_drivetrain'] = {
name = 'rwd_drivetrain',
label = 'RWD Drivetrain',
weight = 2000,
type = 'item',
image = 'rwd_drivetrain.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Converts a vehicle to rear-wheel drive.'
},
['semi_slick_tyres'] = {
name = 'semi_slick_tyres',
label = 'Semi Slick Tyres',
weight = 1500,
type = 'item',
image = 'semi_slick_tyres.png',
unique = false,
useable = false,
shouldClose = true,
description = 'Performance semi-slick tyre upgrade.'
},
['slick_tyres'] = {
name = 'slick_tyres',
label = 'Slick Tyres',
weight = 1500,
type = 'item',
image = 'slick_tyres.png',
unique = false,
useable = false,
shouldClose = true,
description = 'High-performance slick tyre upgrade.'
},
['sport_transmission'] = {
name = 'sport_transmission',
label = 'Sport Transmission',
weight = 3000,
type = 'item',
image = 'sport_transmission.png',
unique = false,
useable = false,
shouldClose = true,
description = 'Improved vehicle transmission.'
},
['v6_engine'] = {
name = 'v6_engine',
label = 'V6 Engine',
weight = 4000,
type = 'item',
image = 'v6_engine.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Upgrades a vehicle to a V6 engine.',
},
['v8_engine'] = {
name = 'v8_engine',
label = 'V8 Engine',
weight = 5000,
type = 'item',
image = 'v8_engine.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Upgrades a vehicle to a V8 engine.',
},
['v12_engine'] = {
name = 'v12_engine',
label = 'V12 Engine',
weight = 6000,
type = 'item',
image = 'v12_engine.png',
unique = false,
useable = true,
shouldClose = true,
description = 'Upgrades a vehicle to a V12 engine.',
},
-- Crafting Materials
['iron'] = {
name = 'iron',
label = 'Iron',
weight = 500,
type = 'item',
image = 'iron.png',
unique = false,
useable = false,
shouldClose = true,
description = 'Basic crafting material used for various recipes.'
},
```
:::
::: details ak47\_inventory / ak47\_qb\_inventory
```lua
-- Player Usable Items
["dyno_slip"] = {
name = "dyno_slip",
label = "Dyno Slip",
weight = 1,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["hydraulic_controller"] = {
name = "hydraulic_controller",
label = "Hydraulic Controller",
weight = 1000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["lighting_controller"] = {
name = "lighting_controller",
label = "Lighting Controller",
weight = 500,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["mechanic_tablet"] = {
name = "mechanic_tablet",
label = "Mechanic Tablet",
weight = 1000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["nitrous_bottle"] = {
name = "nitrous_bottle",
label = "Nitrous Bottle",
weight = 2000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["nitrous_install_kit"] = {
name = "nitrous_install_kit",
label = "Nitrous Install Kit",
weight = 2000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["obd_scanner"] = {
name = "obd_scanner",
label = "OBD Scanner",
weight = 1000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["stancing_kit"] = {
name = "stancing_kit",
label = "Stancing Kit",
weight = 500,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
-- Tools (Mechanic Work Items)
["car_jack"] = {
name = "car_jack",
label = "Car Jack",
weight = 3000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 1,
},
["engine_lift"] = {
name = "engine_lift",
label = "Engine Lift",
weight = 5000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 1,
},
["impact_driver"] = {
name = "impact_driver",
label = "Impact Driver",
weight = 1500,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 1,
},
["repair_kit"] = {
name = "repair_kit",
label = "Repair Kit",
weight = 1000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["respray_kit"] = {
name = "respray_kit",
label = "Respray Kit",
weight = 1500,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 1,
},
["transmission_lift"] = {
name = "transmission_lift",
label = "Transmission Lift",
weight = 4000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 1,
},
-- Upgrade & Repair Parts
["advanced_vehiclepart"] = {
name = "advanced_vehiclepart",
label = "Advanced Vehicle Part",
weight = 1000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 50,
},
["awd_drivetrain"] = {
name = "awd_drivetrain",
label = "AWD Drivetrain",
weight = 2000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["basic_vehiclepart"] = {
name = "basic_vehiclepart",
label = "Basic Vehicle Part",
weight = 1000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 50,
},
["ceramic_brakes"] = {
name = "ceramic_brakes",
label = "Ceramic Brakes",
weight = 2000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["fwd_drivetrain"] = {
name = "fwd_drivetrain",
label = "FWD Drivetrain",
weight = 2000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["offroad_tyres"] = {
name = "offroad_tyres",
label = "Offroad Tyres",
weight = 2000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["performance_brakes"] = {
name = "performance_brakes",
label = "Performance Brakes",
weight = 2000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["race_transmission"] = {
name = "race_transmission",
label = "Race Transmission",
weight = 3000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["rwd_drivetrain"] = {
name = "rwd_drivetrain",
label = "RWD Drivetrain",
weight = 2000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["semi_slick_tyres"] = {
name = "semi_slick_tyres",
label = "Semi Slick Tyres",
weight = 1500,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["slick_tyres"] = {
name = "slick_tyres",
label = "Slick Tyres",
weight = 1500,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["sport_transmission"] = {
name = "sport_transmission",
label = "Sport Transmission",
weight = 3000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 10,
},
["v6_engine"] = {
name = "v6_engine",
label = "V6 Engine",
weight = 4000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 5,
},
["v8_engine"] = {
name = "v8_engine",
label = "V8 Engine",
weight = 5000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 5,
},
["v12_engine"] = {
name = "v12_engine",
label = "V12 Engine",
weight = 6000,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 5,
},
-- Crafting Materials
["iron"] = {
name = "iron",
label = "Iron",
weight = 500,
type = "item",
decay = false,
close = true,
limit = 100,
stacksize = 100,
},
```
:::
::: details ox\_inventory
```lua
-- Player Usable Items
['dyno_slip'] = {
label = 'Dyno Slip',
stack = false,
weight = 1,
},
['hydraulic_controller'] = {
label = 'Hydraulic Controller',
stack = true,
weight = 1000,
},
['lighting_controller'] = {
label = 'Lighting Controller',
stack = true,
weight = 500,
},
['mechanic_tablet'] = {
label = 'Mechanic Tablet',
stack = true,
weight = 1000,
},
['nitrous_bottle'] = {
label = 'Nitrous Bottle',
stack = true,
weight = 2000,
},
['nitrous_install_kit'] = {
label = 'Nitrous Install Kit',
stack = true,
weight = 2000,
},
['obd_scanner'] = {
label = 'OBD Scanner',
stack = true,
weight = 1000,
},
['stancing_kit'] = {
label = 'Stancing Kit',
stack = true,
weight = 500,
},
-- Tools (Mechanic Work Items)
['car_jack'] = {
label = 'Car Jack',
stack = false,
weight = 3000,
},
['engine_lift'] = {
label = 'Engine Lift',
stack = false,
weight = 5000,
},
['impact_driver'] = {
label = 'Impact Driver',
stack = false,
weight = 1500,
},
['repair_kit'] = {
label = 'Repair Kit',
stack = true,
weight = 1000,
},
['respray_kit'] = {
label = 'Respray Kit',
stack = false,
weight = 1500,
},
['transmission_lift'] = {
label = 'Transmission Lift',
stack = false,
weight = 4000,
},
-- Upgrade & Repair Parts
['advanced_vehiclepart'] = {
label = 'Advanced Vehicle Part',
stack = true,
weight = 1000,
},
['awd_drivetrain'] = {
label = 'AWD Drivetrain',
stack = true,
weight = 2000,
},
['basic_vehiclepart'] = {
label = 'Basic Vehicle Part',
stack = true,
weight = 1000,
},
['ceramic_brakes'] = {
label = 'Ceramic Brakes',
stack = true,
weight = 2000,
},
['fwd_drivetrain'] = {
label = 'FWD Drivetrain',
stack = true,
weight = 2000,
},
['offroad_tyres'] = {
label = 'Offroad Tyres',
stack = true,
weight = 2000,
},
['performance_brakes'] = {
label = 'Performance Brakes',
stack = true,
weight = 2000,
},
['race_transmission'] = {
label = 'Race Transmission',
stack = true,
weight = 3000,
},
['rwd_drivetrain'] = {
label = 'RWD Drivetrain',
stack = true,
weight = 2000,
},
['semi_slick_tyres'] = {
label = 'Semi Slick Tyres',
stack = true,
weight = 1500,
},
['slick_tyres'] = {
label = 'Slick Tyres',
stack = true,
weight = 1500,
},
['sport_transmission'] = {
label = 'Sport Transmission',
stack = true,
weight = 3000,
},
['v6_engine'] = {
label = 'V6 Engine',
stack = true,
weight = 4000,
},
['v8_engine'] = {
label = 'V8 Engine',
stack = true,
weight = 5000,
},
['v12_engine'] = {
label = 'V12 Engine',
stack = true,
weight = 6000,
},
-- Crafting Materials
['iron'] = {
label = 'Iron',
stack = true,
weight = 500,
},
```
---
---
url: /paid-scripts/cd_mechanic/developer-api/keys.md
description: >-
Default keybinds for cd_mechanic including FiveM Key Mapping and GTA native
keybinds for NOS activation, NOS purge, and opening the mechanic tablet and
customs UI.
---
# Keys
## ::: info Note
* You can modify or disable these keys in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section of the `[configs/config.lua]`.
* Ensure you understand how [Key Mapping](https://docs.codesign.pro/coding-information/register-key-mapping) works.
:::
## FiveM Key Mapping
> Uses FiveM's built-in keybind system. Players can change keys in settings.
### Open Tablet
Opens the mechanic tablet.
*Not configured by default. Available via chat command. Set a key in config.lua if needed.*
### Open Customs
E Opens mechanic and public customs.
## Default GTA Keybinds
> Uses fixed key presses (e.g. E, G). Cannot be changed by players.
### **NOS**
LEFT SHIFT - Activate NOS in a vehicle.
### **NOS** Purge
G - Activates the NOS purge effect.
---
---
url: /paid-scripts/cd_mechanic/resource-integration.md
description: >-
Supported resource compatibility for cd_mechanic including frameworks,
databases, banking, duty, HUD, inventory, notifications, and society
integrations via cd_bridge.
---
# Resource Integration
## Compatibility Key
| Status | Description |
| --- | --- |
| **Built-In (script)** | Fully integrated into the script and auto-detected, no modifications or configuration needed. |
| **Built-In (creator)** | Fully integrated by the resource creator, no modifications required. |
| **Built-In (cd\_bridge)** | Fully integrated through cd\_bridge and auto-detected, no extra changes needed in the supported resource. |
| **Minor Changes Required** | Small, simple edits such as adding or copying a single line of code. |
| **Moderate Changes Required** | Involves replacing existing logic or functions with the versions provided by Codesign. |
| **Major Changes Required** | Extensive modifications across multiple files or large code sections. |
## Supported Utility Compatibility
Additional resource types that can work through our bridge, such as notifications and similar utility scripts.
| Script Type | Compatibility Type | View Supported Scripts |
| ---------------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| Framework | **Built-In (cd\_bridge)** | [#framework](/paid-scripts/bridge/resource-integration.md#framework "mention") |
| Database Wrapper | **Built-In (cd\_bridge)** | [#database-wrapper](/paid-scripts/bridge/resource-integration.md#database-wrapper "mention") |
| Banking | **Built-In (cd\_bridge)** | [#banking](/paid-scripts/bridge/resource-integration.md#banking "mention") |
| Duty | **Built-In (cd\_bridge)** | [#duty](/paid-scripts/bridge/resource-integration.md#duty "mention") |
| Hud | **Built-In (cd\_bridge)** | [#hud](/paid-scripts/bridge/resource-integration.md#hud "mention") |
| Inventory | **Built-In (cd\_bridge)** | [#inventory](/paid-scripts/bridge/resource-integration.md#inventory "mention") |
| Notifications | **Built-In (cd\_bridge)** | [#notification](/paid-scripts/bridge/resource-integration.md#notification "mention") |
| Society | **Built-In (cd\_bridge)** | [#society](/paid-scripts/bridge/resource-integration.md#society "mention") |
---
---
url: /paid-scripts/cd_mechanic/migration-guide.md
description: >-
Migration guide for moving from esx_mechanicjob, jg_mechanic, or
qb-mechanicjob to cd_mechanic. Shows which vehicle data can be preserved
including upgrades, paint, health, and inventory.
---
# Migration Guide
**Migration Type Key**
| State | Description |
| --- | --- |
| Built-in Migration | Automatically supported with no SQL changes, code changes, or manual setup required. |
| Minor Migration Required | Requires a simple command, SQL query, or small code change. All required queries or code are provided. Usually completed in minutes. |
| Moderate Migration Required | Requires provided SQL queries and some code changes across a few files. Usually completed in 5–15 minutes. |
| Major Migration Required | Requires multiple SQL queries and larger code changes across several files. Usually takes 1+ hours. |
## Supported Mechanic Migrations
See which mechanic scripts can be migrated to `cd_mechanic` while keeping existing vehicle progress and saved data where possible.
| Script Name | Migration Type | Notes |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| [esx\_mechanicjob](https://github.com/esx-framework/ESX-Legacy-Addons/tree/main/[esx_addons]/esx_mechanicjob) | **Built-In Migration** | |
| jg\_mechanic | **Minor Migration Required** | *A single chat command is used to run the database migration.* |
| [qb-mechanicjob](https://github.com/qbcore-framework/qb-mechanicjob) | **Built-In Migration** | |
***
## Migration Data Comparison
This table shows what important data can usually be kept when moving to our mechanic system.
| Key | Meaning |
| --- | --- |
| ✅ **Migrated / Reused** | Existing data can be migrated or reused |
| ❌ **Reconfigure** | Existing data cannot be migrated or reused, but can be reconfigured again |
| ⚠️ **Not Used** | Your old mechanic script does not have this feature |
---
---
url: /paid-scripts/cd_mechanic/changelog.md
description: >-
Latest updates, changes, and improvements for cd_mechanic. Tracks version
history, new features, bug fixes, and compatibility updates.
---
# Changelog
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
## ::: danger Important Notice (cd\_bridge dependency)
`cd_mechanic` requires `cd_bridge` to work.\
This improves compatibility and makes future updates easier.
:::
## v1.0.16
```bash [Files Changed]
fxmanifest.lua
client/main/client.lua
client/customs/customs_upgrades.lua
```
## ::: info Changes
* When a vehicle's listed price is 0, the fallback vehicle price is now used instead.
* Improved the UI loading debug and warning messages to confirm when the UI has successfully loaded.
:::
## v1.0.15
```bash [Files Changed]
fxmanifest.lua
client/main/tablet/admin.lua
server/main/tablet/admin.lua
locales/locales.js
locales/ui/*
HTML (full folder)
```
## ::: tip Added
* Added a starting money field to the business creation menu.
:::
## v1.0.14
```bash [Files Changed]
fxmanifest.lua
client/main/client.lua
client/other/mileage.lua
```
## ::: warning Fixes
* Final fix for jobs not appearing when the server starts.
:::
## v1.0.13
```bash [Files Changed]
fxmanifest.lua
client/main/client.lua
```
## ::: warning Fixes
* Fixed jobs list sometimes not loading on script start.
:::
## v1.0.12
```bash [Files Changed]
fxmanifest.lua
client/tablet/billing.lua
```
## ::: warning Fixes
* Fixed closest players being undefined in the billing UI.
:::
## v1.0.11
```bash [Files Changed]
fxmanifest.lua
server/tablet/work_order.lua
client/main/functions.lua
client/customs/customs.lua
```
## ::: warning Fixes
* Fixed an issue where the customer’s job was being added to the work order instead of the business job, preventing mechanics from receiving the work order unless they had the same job.
* Fixed turbo preview not resetting correctly when resetting upgrades or closing the customs UI.
* Fixed money not being returned to the player when cancelling a work order.
* Fixed cancelled work orders not refunding offline players. If the player is offline, the money is now returned directly to their bank balance through the database.
:::
## v1.0.0
## ::: tip Testing
* Alpha Testing : Complete
* Beta Testing: Complete
:::
---
---
url: /paid-scripts/dispatch3d.md
description: >-
FiveM 3D dispatch system with custom vehicle models, real-time player
tracking, and full integration with cd_bridge. Includes installation guide,
developer API, and troubleshooting.
---
# Dispatch 3D
[**Buy Here**](https://codesign.pro/dispatch)
[**FiveM Forums Post**](https://forum.cfx.re/t/codesign-dispatch-3d/5338445)
{% youtube k5SU6qqvvtc %}
## 📘 Start Here
* [**Installation Guide**](installation-guide.md)\
Step-by-step setup and configuration.
* [**Configuration**](../garage/features.md)\
All optional features that can be enabled in config explained.
* [**Compatibility**](resource-integration/)\
What’s built-in vs needs changes.
### 🔧 Developer Reference
* [**Chat Commands**](https://docs.codesign.pro/paid-scripts/dispatch3d/developer-api/chat-commands)\
Player & staff commands with usage examples.
* [**Events**](https://docs.codesign.pro/paid-scripts/dispatch3d/developer-api/events)\
Triggerable events (client/server) with Lua examples.
* [**Exports**](https://docs.codesign.pro/paid-scripts/dispatch3d/developer-api/exports)\
Optional functions to integrate cd\_dispatch3d with other scripts.
* [**Keys & Controls**](https://docs.codesign.pro/paid-scripts/dispatch3d/developer-api/keys)\
Default keybinds and interaction methods.
### 🧠 Need Help?
* [**Troubleshooting Guide**](https://docs.codesign.pro/paid-scripts/dispatch3d/troubleshooting-guide)\
Common issues and error codes.
* **Support:** Join our Discord –
### 💡 Developer Notes
* Keep integrations simple: use provided **Exports** and **Events**.
* All code samples are **Lua**, beginner-friendly, and copy/paste ready.
* Prefer **auto-detect** config options where available.
---
---
url: /paid-scripts/dispatch3d/installation-guide.md
description: >-
Step-by-step installation guide for cd_dispatch3d. Covers cd_bridge
dependency, download from CFX Portal, model setup, and configuration.
---
# Installation Guide
## 1. Codesign Bridge
## :::danger **This script requires `cd_bridge` to be installed and running before it can function**
**`cd_bridge`** is plug-and-play and requires no setup. It automatically handles:
* Framework integration
* Database setup
* Script compatibility
* Error Handling
Once started, it will detect and connect to all supported scripts automatically.
[**See the \[Full Bridge Setup Guide\]**](https://docs.codesign.pro/paid-scripts/bridge/installation-guide)
:::
## 2. Download Script
#### Download the Script from the FiveM Portal Website
1. [**Download cd\_dispatch3d**](https://portal.cfx.re/assets/granted-assets?search=cd_dispatch3d)
2. Unzip the downloaded file
3. In your server's `resources` directory, create a folder named `[codesign]` if it does not already exist
4. Place `cd_dispatch3d` (and all other Codesign scripts) inside the `[codesign]` folder
![]()
Example resources folder with a `[codesign]` directory
## 3. Database Setup (SQL)
### No manual SQL setup required.
The script automatically inserts all required database tables.
```lua
Config.AutoInsertSQL = true
```
Make sure this is enabled in `cd_dispatch3d/configs/config.lua`.
## 4. Configure Script
### Review the `config.lua` Settings
Open `cd_dispatch3d/configs/config.lua` and check the available settings.
* Update the options that are needed for your server.
* Read the comments next to each option, as they explain what each setting does.
## 5. Configure Key Binds
### Configure Before Starting the Resource
**Before Starting the Resource**
* Before launching this resource on your main or live server, we strongly recommend configuring your key binds first.
* This resource uses [FiveM's Key Mapping](https://docs.codesign.pro/helpful-guides/register-key-mapping) system.
**Where Can I Configure My Key Binds?**
* You can configure all key binds directly in **`cd_dispatch3d/configs/config.lua`**.
**Why Is This Important?**
* Once a player joins your server with this resource running, you can no longer force key bind changes through the config file.
* Players must adjust their key binds manually through the in-game pause menu settings.
* Any changes you make will still apply to new players who join afterward.
* This system is more optimized and gives players the flexibility to customize their key binds for both keyboard and controller use.
* You can also review the [Default key Binds](developer-api/keys.md) binds provided with this resource.
![]()
Keybind settings located in the pause menu
## 6. Replace Old Dispatch Alerts
## :::info Notice
Not all dispatch alerts need to be replaced.
`cd_dispatch3d` now supports the following **without any changes**:
* `cd_dispatch` (classic)
* `ps-dispatch`
* `lb-tablet`
* `redutzu-mdt`
* Default ESX police alerts
* Default QBCore police alerts
Only replace alerts if you are using a **custom or unsupported** police alert system.
:::
### Find the old alert
* Red Old dispatch alert
* Green Old alert replaced with `cd_dispatch3d`
> Not every resource will look the same, but the implementation concept remains identical.

### Having trouble finding the old alert?
#### Trigger the Alert Where the Action Starts!
Dispatch alerts should be triggered **where the event begins**, for example:
* When the robbery starts
* When a crime is committed
**Bad Practice**\
Triggering alerts inside an event that already broadcasts to all police:
* Causes duplicate notifications
* Creates duplicate blips
* Results in dispatch spam
**Good Practice**\
Trigger the alert:
* At the source of the action
* Before any police broadcast or blip creation
* Let `cd_dispatch3d` handle visibility and syncing

Once you've found the old dispatch alert to replace, continue with Step 7.
## 7. Add New Dispatch Alerts
### Compatible Integrations by Codesign
On our [**Resource Integration**](https://docs.codesign.pro/paid-scripts/dispatch3d/resource-integration) page, you can find a full list of **pre-integrated and compatible scripts** that work seamlessly with **cd\_dispatch3d** and **MDT integrations**.
[**View the full list of compatible scripts**](https://docs.codesign.pro/paid-scripts/dispatch3d/resource-integration)
::: code-group
```lua [client-side (recommended)]
local data = exports['cd_dispatch3d']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
job_table = { 'police', 'sheriff' },
coords = data.coords,
title = '10-15 - Store Robbery',
message = 'A ' ..data.sex.. ' robbing a store at ' ..data.street,
flash = false,
sound = 1,
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = '911 - Store Robbery',
time = 5,
radius = 0,
}
})
```
```lua [server-side]
TriggerEvent('cd_dispatch:AddNotification', {
job_table = { 'police', 'sheriff' },
coords = vector3(0, 0, 0),
title = '10-15 - Store Robbery',
message = 'A person robbing a store',
flash = 0,
sound = 1,
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = '911 - Store Robbery',
time = 5,
radius = 0,
}
})
```
:::
### Player Info Export Reference
The following export is used in the example above:
This data structure can be customized in: integrations/client/client\_exports.lua
```lua
local data = exports['cd_dispatch3d']:GetPlayerInfo()
data.ped -- Player ped ID (e.g., 123456789)
data.coords -- Player coordinates (vector3)
data.street_1 -- Street name (e.g., "Palomino Ave")
data.street_2 -- Area name (e.g., "Legion Square")
data.street -- Full location (e.g., "Palomino Ave, Legion Square")
data.sex -- Ped sex (e.g., "Male")
```
### Dispatch Alert Variable Reference
| Variable Name | Required | Example | Description |
|------------------|----------|-----------------------|--------------------------------------------------------------------------------------------------------------------------------|
| **job\_table** | true | {'police', 'sheriff'} | List of jobs that will receive the dispatch alert. |
| **coords** | true | vec3(0.0, 0.0, 0.0) | World coordinates where the alert occurred. |
| **title** | true | '10-19 Robbery' | Title displayed in the dispatch UI, usually 10 codes. |
| **message** | true | 'Robbery in progress' | Main description shown to responders. |
| **flash** | false | true | Whether the alert flashes on the UI. (true/false) |
| **sound** | false | 1 | Dispatch alert sound.Editable in BlipSound() (client/other/functions.lua).1 = single alert, 2 = double alert, 3 = panic alert. |
| **blip** | false | | Map blip configuration (see below). |
| **blip.sprite** | false | 431 | [GTA blip sprite ID - More](https://docs.fivem.net/docs/game-references/blips/) here. |
| **blip.scale** | false | 1.2 | Blip size on the map: 0.1-2.0. |
| **blip.colour** | false | 3 | [Blip color ID - More here at](https://docs.fivem.net/docs/game-references/blips/) bottom. |
| **blip.flashes** | false | true | Whether the blip flashes. (true/false) |
| **blip.time** | false | 5 | Time until blip fades and deletes (minutes) |
| **blip.radius** | false | 0 | Randomize coords; use a radius blip.0 disables it, **50-100** recommended. |
---
---
url: /paid-scripts/dispatch3d/troubleshooting-guide.md
description: >-
Troubleshooting guide for cd_dispatch3d with common issues, error codes, and
solutions for the 3D dispatch system.
---
# Troubleshooting Guide
## Error Codes
## ::: info Note
If you encounter an error code not listed below, please open a support ticket in the [Codesign Discord](https://discord.gg/codesign) for assistance.
:::
### Server
* **7132** - `"cd_dispatch:AddNotification"` was triggered from the server-side to-client-side, this was the old deprecated method of adding notifications from the server-side and will cause errors in this new dispatch. Find the resource triggering this event and refer to [Dispatch 3D](https://docs.codesign.pro/paid-scripts/dispatch3d#step-7-for-existing-cd_dispatch-users-only) to fix this.
### Client
/
## Common Issues
Please check out our [**Self Debugging Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
🔔 **Folder Name** Make sure the name of the folder is `cd_dispatch3d`.
🔔 **Encrypted Files** Do not edit the encrypted files in any way.
::: details Players are not receiving calls?
**Example:** If all of a sudden players are not longer receiving dispatch calls.
**Reason:** This most likely means 1 or more players have enabled dispatcher mode, so only the dispatchers are receiving new calls.
**Solution:** The dispatchers either need to do their job and assign calls or disable dispatcher mode.
:::
::: details I'm shooting my gun but not getting alerts?
**Example:** If you are shooting your weapon but not getting dispatch alerts.
**Reason:** By default the police job is whitelisted from triggering all default alerts such as gun shots.
**Solution:** Enable Config.Debug in the config of cd\_dispatch to test this yourself.
:::
---
---
url: /paid-scripts/dispatch3d/features.md
description: >-
Custom vehicle models for cd_dispatch3d. Guide for adding custom GLB vehicle
and ped models, configuring job-specific models, and adjusting scale,
position, and rotation.
---
# Features
## Custom vehicle models
### **Step 1 - Introduction**
In the `cd_dispatch3d/configs/config_ui.js` file you will find a list of jobs with their associated models.
:::details A single entry in the list looks like this:
```javascript
police: // Job name. Change this to the name of your job. This is used in the code and should be unique.
{
car:{ // Car model configuration. Do not change the name "car" as it is used in the code.
file_name: "police.glb", // File name of the vehicle/ped model inside the models/placeable folder.
scale: 2, // Scale of the model. 1 is default scale. Adjust as needed. Can use decimals (E.g. 0.01 or 0.1 and so on)
position_adjustment: { // Position adjustment for the model. Adjust as needed. Shifts the model in the X, Y and Z axis.
x: 0,
y: 0,
z: 0,
},
rotation_adjustment: { // Rotation adjustment for the model in DEGREES. Adjust as needed. Correct rotation enables heading tracking.
x: 0,
y: 0,
z: 0,
}
},
foot: {
file_name: "s_m_y_cop_01.glb",
scale: 3,
position_adjustment: {
x: 0,
y: 0,
z: 0,
},
rotation_adjustment: {
x: 0,
y: 0,
z: 0,
}
},
helicopter : {
file_name: "polmav.glb",
scale: 2,
position_adjustment: {
x: 0,
y: 0,
z: 0,
},
rotation_adjustment: {
x: 0,
y: 0,
z: 0,
}
},
boat : {
file_name: "predator.glb",
scale: 2,
position_adjustment: {
x: 0,
y: 0,
z: 0,
},
rotation_adjustment: {
x: 0,
y: 0,
z: 0,
}
},
motorcycle: {
file_name: "policeb.glb",
scale: 2,
position_adjustment: {
x: 0,
y: 0,
z: 0,
},
rotation_adjustment: {
x: 0,
y: 0,
z: 0,
}
}
},
```
:::
The model files are located under `cd_dispatch3d/models/placeable/`
::: info Note
The models we provide by default are GTA 5's default low quality models.
In case you are looking to implement your own models make sure they are not high poly count since it will make an impact on lower spec machines.
:::
The job can have the next vehicle / transport types
* car
* foot
* helicopter
* boat
* motorcycle
You can either provide your own, use already existing models, or if you omit any from the list the script will use default models.
### **Step 2 - Models**
**Getting your models**
Our best recommendation is getting the models from the game itself in their low quality version. These models are already optimized for the game, will work the best, as well as respect FiveM's terms of service.
Here are some interesting links which can have explanations on extracting game models:
* Codewalker -
* Sollumz -
* Blender -
*\*Alternatively you can grab models from websites like [Sketchfab](https://sketchfab.com/), however it might be difficult finding game optimized models with correct licensing.*
::: info Note
Please note that we will not provide support with extracting models, since it is a customization of the resource.
:::
**Installing models**
Prepare your model files and paste them into `cd_dispatch3d/models/placeable/`
:::warning Important
The model files must be in a `.glb` format, otherwise the resource won't recognize the files and will fail to load them.
:::
Keep a note of the file names, since you will need them for the next step.
### **Step 3 - Configuration**
Copy the list from the [introduction step](features.md#introduction) and paste it below one of the items in the `config_ui.js` file.
Make sure you include the `,` symbol so the script doesn't break. \
If you are using a code editor such as VSCode it should alert you in case you miss this.
Let's assume our new job is going to be called **'bcso':**
In the code you pasted, rename 'police' to 'bcso'
Change each of the transport mode file names to the names of models you have added to the `placeable/` folder
:::details Example
```javascript
bcso: // Job name. Change this to the name of your job. This is used in the code and should be unique.
{
car:{ // Car model configuration. Do not change the name "car" as it is used in the code.
file_name: "sheriff.glb", // File name of the vehicle/ped model inside the models/placeable folder.
scale: 2, // Scale of the model. 1 is default scale. Adjust as needed. Can use decimals (E.g. 0.01 or 0.1 and so on)
position_adjustment: { // Position adjustment for the model. Adjust as needed. Shifts the model in the X, Y and Z axis.
x: 0,
y: 0,
z: 0,
},
rotation_adjustment: { // Rotation adjustment for the model in DEGREES. Adjust as needed. Correct rotation enables heading tracking.
x: 0,
y: 0,
z: 0,
}
},
foot: {
file_name: "s_m_y_sheriff_01.glb",
scale: 3,
position_adjustment: {
x: 0,
y: 0,
z: 0,
},
rotation_adjustment: {
x: 0,
y: 0,
z: 0,
}
},
helicopter : {
file_name: "polmav.glb",
scale: 2,
position_adjustment: {
x: 0,
y: 0,
z: 0,
},
rotation_adjustment: {
x: 0,
y: 0,
z: 0,
}
},
boat : {
file_name: "predator.glb",
scale: 2,
position_adjustment: {
x: 0,
y: 0,
z: 0,
},
rotation_adjustment: {
x: 0,
y: 0,
z: 0,
}
},
motorcycle: {
file_name: "policeb2.glb",
scale: 2,
position_adjustment: {
x: 0,
y: 0,
z: 0,
},
rotation_adjustment: {
x: 0,
y: 0,
z: 0,
}
}
},
```
:::
### Step 4 - Running
After completing the previous 2 steps, it is time to test our work!
In case your server is already running:
Type `refresh` in server console, followed by `ensure cd_dispatch3d` \
This should make sure the server loads all the necessary files.
In case your server is not started simply start the server.
To test our implementation switch your job to the one you just added, open the large UI and take a look at your character!
:::danger Important
In case the map displays a model you don't recognize, it probably is the default model we provide.
If the script breaks completely, something definitely went wrong with the steps.
It is best to try following the steps again and repeating the implementation.
:::
Congratulations on implementing your custom models!
## Dispatcher
**How Does the Dispatcher System Work?**
> The **dispatcher system** lets dispatchers receive incoming calls and assign them to specific players.\
> Only players with the **predefined jobs and grades** listed in **`Config.Perms.Dispatcher`** can use this feature.\
> When a player has **dispatcher mode** enabled, **non-dispatchers** will not receive any calls until a dispatcher assigns them one.
**How to Enable Dispatcher Mode**
Open the **Dispatch UI**, click the **settings icon** (top-right corner), and select **Toggle Dispatcher Mode.**\
If the option is greyed out or not clickable, you don't have the required **job** or **job grade**.
[**Video Guide**](https://gyazo.com/ef1355c7f2f4bd9e59d1b6998a230c56)
**How to Assign Units/Groups to a Notification**
Right-click a notification on the **Notification Panel** (left side of your screen).\
If assigned successfully, the selected unit(s) will appear under **Units Responding** for that notification.
[**Video Guide**](https://gyazo.com/4831213416cdbe28ccbe55c6621c5c99)
**How to Speak on the Radio**
While the **large UI** is open, click the **Voice ON** button (top-right corner).\
When enabled, the button will turn **white**.\
Then, press your **radio push-to-talk** key to speak on the radio.
[**Video Guide**](https://gyazo.com/fcb5dc09a370702a02749faf19b88934)
**How to Join, Leave, or Set Radio Channels**
While the **large UI** is open, right-click a unit in the **Unit List** (top-right corner).
* Click **Join Radio Channel** to connect.
* Click **Leave Radio Channel** to disconnect.
[**Video Guide**](https://gyazo.com/b13a7c7b401c19db79594829620ccbdd)
### **Dispatch Settings**
**What Do the Settings Do and How Does This Work?**
> The **Settings** menu allows each player to customise their dispatch preferences to match their individual role-play needs.\
> [*Watch the short video below to learn how to open the settings.*](https://gyazo.com/6d757a08436a923da68df01dc00ab86a)
#### Status
Your **status** shows other players what you're currently doing such as *Available*, *Unavailable*, *Processing*, *Training*, or *Undercover*.\
This status appears on the **Units List** as a **colour indicator** (e.g., Green = Available, Red = Unavailable, Blue = Training).\
You can configure these statuses and colours in **config\_ui.js**.

**Players' Status Displayed on the Units List**
#### **Dispatcher Mode**
Enables **Dispatcher Mode**, allowing a player to act as a dispatcher.\
This option is only available if the player has the required **permissions** set in **config.lua**.

**Dispatcher Permissions Configuration (config.lua)**
### Job Call Commands
**How Do Job Call Commands Work?**
> When a **civilian** uses a job call command (e.g., **/911**), a notification is sent to the relevant job such as the police.\
> You can configure multiple jobs to use this system.
>
> After receiving a call, players in that job can **respond using the `/reply`** chat command.\
> Calls can also be made **anonymous** by enabling the **anonymous option** when creating a notification.\
> Anonymous calls hide the caller's **name** and **phone number**, and display **radius blips** for an approximate location instead.
### Player Blips
**How Do the Blips Work?**
> The built-in **player blips** feature allows all players with the jobs listed in **`Config.AllowedJobs`** to see each other on both the **pause menu map** and the **mini-map**.
>
> These blips display enhanced information pulled directly from the **dispatch UI**, including the player's **character name**, **callsign**, **radio channel**, and **vehicle type**.\
> Blips will also **flash** automatically when a player's **emergency lights** are activated.
### Police Alerts
**How Do Police Alerts Work?**
> This dispatch system includes **11 built-in police alerts**, each with its own **random call chance** and **individual cooldowns**, covering scenarios such as **gunshots, speed cameras, car crashes**, and more.
## :::info Testing Note
When **`Config.Debug`** is enabled:
* Police call chance is forced to **100%**
* Whitelisted jobs are **ignored**
* Alert debug information is shown\
*(This is for testing only and should be disabled in live servers.)*
:::
#### Witness Ped System
Nearby NPCs can act as witnesses and call the police if:
* They are within a configurable distance
* They have **line of sight** to the player
You can also configure:
* Multiple witnesses calling police
* A time window to **harm or eliminate witnesses** before they report
* **Blacklisted ped models**
* **No-snitching zones** where witnesses will never report crimes
#### Included Police Alerts
* **Car Crash**\
Triggers when you crash into another vehicle at or above a set minimum speed and come to a sudden stop.
* **Carjacking**\
Police are called when you forcibly remove an NPC from their vehicle.
* **Explosion**\
Detects explosions and alerts police.
* **Gunpoint Carjacking**\
Pointing a gun at an NPC driver causes them to stop and flee, triggering an alert.
* **Gunshots**
* Nearby witnesses report the **weapon type** (pistol, rifle, shotgun, etc.).
* If no direct line of sight, nearby NPCs may still report **heard gunshots** (single shots, rapid fire, loud weapons).
* Supports weapon and zone whitelisting.
* **Melee Fight**\
Triggered when you engage in a fist fight or melee combat with an NPC using fists, blunt weapons, or bladed weapons.
* **Reckless Driving**\
Triggered when NPCs witness dangerous or high-speed driving.
* **Speed Trap**\
Speed cameras trigger alerts when speed limits are exceeded and can issue fines.
* **Vehicle Alarm**\
Alerts police when a vehicle alarm is triggered due to break-ins or damage.
* **Vehicle Assault**\
Triggered when running over an NPC with a vehicle.
* **Weapon Drawn**\
Police are alerted when walking around with a visible weapon.
### Radio Channels
**How Do Radio Channels Work?**
> Radio channels allow players to **see which channels others are using** and **quickly join or leave channels** directly through the **large dispatch UI**.
>
> You'll need to use a compatible **VOIP and radio resource**.\
> By default, cd\_dispatch3d includes compatibility with **TokoVOIP**, **Mumble**, and **pma-voice**.
**Where Are the Radio Channels Displayed?**
Radio channels are shown in **two places**:
* On the **Dispatch UI**
* On the **pause menu and mini-map blips**

**Radio Channel Displayed on the Dispatch UI**

Radio Channel Displayed on the Pause Menu Map
To update this information, an event must be triggered from your **radio resource** whenever a player (who has access to dispatch) **joins, leaves, or changes** a radio channel.\
The player's **new radio channel** must be sent as the **first argument**.


[**View Radio Channel Event Event**](https://docs.codesign.pro/paid-scripts/dispatch3d/developer-api/events#server)
---
---
url: /paid-scripts/dispatch3d/developer-api/events.md
description: >-
Events reference for cd_dispatch3d including client and server events for
integrating 3D dispatch alerts with other scripts.
---
# Events
## ::: info Note
These events are entirely optional and can be triggered as needed to integrate cd\_dispatch3d with your own scripts or custom systems.
:::
## Client
## ::: tip **Client-Side Events**
* Defined with **`RegisterNetEvent`** or **`AddEventHandler`** **in client files**.
* Triggered using **`TriggerEvent`** (if from client) or **`TriggerClientEvent`** (if from server).
* Run only on **one player’s game client** (the player’s PC).
:::
### Panic Button
Activates your panic alert.
```lua [client-side to client-side]
TriggerEvent('cd_dispatch:PanicButtonEvent')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_dispatch:PanicButtonEvent', source)
```
### Toggle Quick View UI
Toggles the visibility of the quick view dispatch UI.
```lua [client-side to client-side]
TriggerEvent('cd_dispatch:KEY_smallui')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_dispatch:KEY_smallui', source)
```
### Hide Quick View UI
Hides the quick view dispatch UI.
```lua [client-side to client-side]
TriggerEvent('cd_dispatch:KEY_smallui_hide')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_dispatch:KEY_smallui_hide', source)
```
### Show Quick View UI
Shows the quick view dispatch UI.
```lua [client-side to client-side]
TriggerEvent('cd_dispatch:KEY_smallui_show')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_dispatch:KEY_smallui_show', source)
```
### Open Main Dispatch UI
Opens the main dispatch interface.
```lua [client-side to client-side]
TriggerEvent('cd_dispatch:KEY_largeui')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_dispatch:KEY_largeui', source)
```
### Responding
Marks the player as responding to a notification.
```lua [client-side to client-side]
TriggerEvent('cd_dispatch:KEY_responding')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_dispatch:GpsTrackerDisable', source)
```
### Disable GPS Tracker
Disables a player’s access to the dispatch system.
```lua [client-side to client-side]
TriggerEvent('cd_dispatch:GpsTrackerDisable')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_dispatch:GpsTrackerDisable', source)
```
### Enable GPS Tracker
Restores a player’s access to the dispatch system after being disabled.
```lua [client-side to client-side]
TriggerEvent('cd_dispatch:GpsTrackerEnable')
```
```lua [server-side to client-side]
TriggerClientEvent('cd_dispatch:GpsTrackerEnable', source)
```
## Server
## ::: tip **Server-Side Events**
* Defined with **`RegisterServerEvent`** or **`AddEventHandler`** **in server files**.
* Triggered using **`TriggerEvent`** (if from server) or **`TriggerServerEvent`** (if from client).
* Run on the **server**, not on any individual player’s game client.
:::
### Radio Channel Event
Used to update a player’s radio channel on the dispatch system.\
This event should be triggered from your **radio resource** whenever a player **joins, leaves, or changes** a radio channel.
```lua [@parameters]
--- @param radioChannel string or number The player’s current radio channel.
--- @example
--- local radioChannel = 1
--- TriggerServerEvent('cd_dispatch:GetRadioChannel', radioChannel)
```
```lua [client-side to server-side]
TriggerServerEvent('cd_dispatch:GetRadioChannel', radioChannel)
```
```lua [server-side to server-side]
TriggerEvent('cd_dispatch:GetRadioChannel', radioChannel, source)
```
---
---
url: /paid-scripts/dispatch3d/developer-api/exports.md
description: >-
Exports reference for cd_dispatch3d including functions for triggering alerts,
managing 3D markers, and integrating with other resources.
---
# Exports
## ::: info Note
These exports are entirely optional and can be used as needed within your own scripts or integrations.
:::
## Client
### **Get Player Info**
Returns useful information about a player that can be used to create new dispatch notifications.
```lua [@parameters]
--- @return table data A table containing the player’s data.
--- @example
--- local data = exports['cd_dispatch']:GetPlayerInfo()
---
--- print(json.encode(data))
```
::: details Example Output
```lua
{
heading = "West Bound",
speed = 0.0,
coords = vec3(436.384003, -1018.631042, 28.369473),
vehicle_colour = "black",
ped = 13314,
street_2 = "Mission Row",
vehicle_plate = "44WSX569",
street = "Vespucci Blvd, Mission Row",
sex = "person",
street_1 = "Vespucci Blvd",
vehicle_label = "Adder",
vehicle = 799490,
}
```
:::
```lua
local data = exports['cd_dispatch3d']:GetPlayerInfo()
```
### **Get** All Dispatch Notifications
Returns all active dispatch notifications.
```lua [@parameters]
--- @return table notifications A table containing all current dispatch notifications.
--- @example
--- local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()
--- print(json.encode(notifications))
```
::: details Example Output
```lua
{
['KHSC-D1S9-58FS-27TT'] = {
flash = false,
title = "Law Enforcement Ping",
epoch = 1785180647,
job_table = {
[1] = "police",
[2] = "ambulance",
},
coords = {
x = 434.09353637695,
y = -1019.5675048828,
z = 28.400123596191,
},
radius_blip = 17432632,
message = "[NO CALLSIGN] ramp clash has sent you a ping to their location at Vespucci Blvd, Mission Row",
distance = 0,
responding_state = false,
unique_id = "KHSC-D1S9-58FS-27TT",
blip = 17367095,
responding = 0,
},
}
```
:::
```lua
local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()
```
### Get Player’s Dispatch Data
Returns a player’s dispatch-related character data (e.g., callsign, character name, and status).
```lua
--- @return table playerData A table containing the player’s dispatch data.
--- @example
--- local playerData = exports['cd_dispatch']:GetPlayersDispatchData()
---
--- print(json.encode(playerData))
```
::: details Example Output
```lua
{
ui_display_keys = {
smalluileft = "Arrow Left",
smalluiright = "Arrow Right",
responding = "G",
},
planner_perms = false,
callsign = "NO CALLSIGN",
dispatcher_perms = false,
source = 1,
char_name = "ramp clash",
}
```
:::
```lua
local playerData = exports['cd_dispatch']:GetPlayersDispatchData()
```
### Get Config
Returns all configuration data from the dispatch’s config.lua file.
```lua [@parameters]
--- @return table configData A table containing the dispatch configuration.
--- @example
--- local config = exports['cd_dispatch']:GetConfig()
--- print(json.encode(config))
```
::: details Example Output
```lua
{
Ping = {
key = "",
ENABLE = true,
command = "dispatchping",
cooldown = 10,
},
DispatchCallExpiryTime = 60,
EnableTestCommand = true,
JobCallCommands = {
Civilian_Commands = {
[1] = {
job_label = "Police",
command = "911",
job_table = {
[1] = "police",
},
},
[2] = {
job_label = "Ambulance",
command = "911ems",
job_table = {
[1] = "ambulance",
},
},
[3] = {
job_label = "Mechanic",
command = "mechanic",
job_table = {
[1] = "mechanic",
},
},
},
ENABLE = true,
JobReply_Command = "reply",
},
AutoUpdatePlayerCoordinates = {
time = 5,
ENABLE = true,
},
large_ui = {
ENABLE = true,
command = "dispatchlarge",
key = "l",
},
FollowPlayer = {
time = 500,
ENABLE = true,
},
Perms = {
Planner = {
police = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
},
Dispatcher = {
mechanic = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
ambulance = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
police = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
fire = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
sheriff = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
},
},
small_ui_left = {
ENABLE = true,
command = "scrollleft",
key = "left",
},
PauseMenuBlips = {
minimize_longdistance_blips = true,
blip_sprites = {
car = 56,
static = 1,
helicopter = 43,
motorcycle = 226,
boat = 427,
foot = 1,
},
blip_type = "auto",
bundle_blips = false,
radiochannel_on_blips = true,
flashing_blips = true,
blip_colours = {
mechanic = {
[1] = 2,
[2] = 0,
},
ambulance = {
[1] = 1,
[2] = 0,
},
police = {
[1] = 3,
[2] = 1,
},
fire = {
[1] = 1,
[2] = 0,
},
sheriff = {
[1] = 3,
[2] = 1,
},
},
data_update_timer = 3,
ENABLE = true,
},
AfkTimer = {
time = 5,
ENABLE = true,
},
PoliceAlerts = {
MeleeFight = {
random_chance = 75,
ENABLE = true,
cooldown = 30,
},
police_jobs = {
[1] = "police",
},
VehicleAlarm = {
random_chance = 50,
ENABLE = true,
cooldown = 30,
},
Explosion = {
random_chance = 75,
WhitelistedZones = {
[1] = {
coords = "vec3(0.000000, 0.000000, 0.000000)",
radius = 20,
},
},
max_distance_from_player = 200.0,
cooldown = 30,
ENABLE = true,
},
WeaponDrawn = {
random_chance = 50,
ENABLE = true,
WhitelistedWeapons = {
[1] = -1569615261,
[2] = -1951375401,
[3] = 101631238,
[4] = 883325847,
[5] = -1168940174,
[6] = 911657153,
[7] = 1233104067,
[8] = 1198879012,
[9] = 1737195953,
[10] = -1810795771,
[11] = 1141786504,
},
cooldown = 30,
},
VehicleAssault = {
cooldown = 30,
ENABLE = true,
random_chance = 75,
min_speed_mph = 20,
},
GunShots = {
random_chance = 75,
WhitelistedWeapons = {
[1] = 1233104067,
[2] = 1198879012,
[3] = 101631238,
[4] = 883325847,
[5] = 911657153,
[6] = -1466123874,
[7] = 126349499,
[8] = -135142818,
},
cooldown = 30,
BurstShots = {
min_shots_in_burst = 3,
burst_gap_ms = 700,
burst_settle_ms = 2000,
},
WhitelistedZones = {
[1] = {
coords = "vec3(13.980000, -1098.050049, 29.799999)",
radius = 20,
},
[2] = {
coords = "vec3(821.090027, -2163.459961, 78.669998)",
radius = 20,
},
},
ENABLE = true,
},
CarJacking = {
random_chance = 75,
ENABLE = true,
cooldown = 30,
},
ENABLE = true,
add_bolos = true,
RecklessDriving = {
min_speed = 30,
ENABLE = true,
random_chance = 75,
cooldown = 30,
},
whitelisted_jobs = {
[1] = "police",
},
CarCrash = {
cooldown = 30,
ENABLE = true,
random_chance = 75,
minimum_crash_speed = 50,
},
GunPointCarJacking = {
random_chance = 100,
ENABLE = true,
max_distance = 20,
cooldown = 45,
},
WitnessPeds = {
NoSnitchingZones = {
[1] = {
coords = "vec3(30.010000, -1847.599976, 24.510000)",
radius = 150,
},
[2] = {
coords = "vec3(-187.220001, -1627.699951, 33.610001)",
radius = 100,
},
[3] = {
coords = "vec3(333.380005, -2037.739990, 21.070000)",
radius = 80,
},
},
ENABLE = true,
radius = 50,
BlacklistedPedModels = {
[1] = 999748158,
},
time_to_kill_caller = 10,
max_callers = 1,
},
SpeedTrap = {
ENABLE = true,
enable_blip = true,
cooldown = 30,
check_owner_for_fine = true,
speed_unit = "mph",
Locations = {
[1] = {
coords = "vec3(1051.420044, 331.109985, 84.000000)",
speed_limit = 150,
fine_amount = 500,
radius = 9,
},
[2] = {
coords = "vec3(544.429993, -373.239990, 33.139999)",
speed_limit = 150,
fine_amount = 5000,
radius = 9,
},
[3] = {
coords = "vec3(-2612.100098, 2940.810059, 16.670000)",
speed_limit = 150,
fine_amount = 1000,
radius = 15,
},
[4] = {
coords = "vec3(287.940002, -517.440002, 42.889999)",
speed_limit = 100,
fine_amount = 500,
radius = 15,
},
[5] = {
coords = "vec3(2792.729980, 4407.680176, 48.439999)",
speed_limit = 150,
fine_amount = 1000,
radius = 24,
},
[6] = {
coords = "vec3(577.109985, -1028.319946, 37.070000)",
speed_limit = 100,
fine_amount = 1000,
radius = 15,
},
[7] = {
coords = "vec3(114.830002, -797.890015, 30.969999)",
speed_limit = 100,
fine_amount = 2000,
radius = 15,
},
[8] = {
coords = "vec3(74.330002, -163.300003, 54.669998)",
speed_limit = 100,
fine_amount = 4000,
radius = 15,
},
[9] = {
coords = "vec3(28.190001, -971.049988, 28.959999)",
speed_limit = 100,
fine_amount = 1000,
radius = 15,
},
},
Society = {
job = "police",
ENABLE = true,
},
},
},
UpdateDistanceToCall = {
time = 2,
ENABLE = true,
},
small_ui = {
ENABLE = true,
command = "dispatchsmall",
key = "u",
},
PanicButton = {
ENABLE = true,
command = "panic",
cooldown = 10,
key = "",
job_table = {
[1] = "police",
[2] = "ambulance",
},
play_sound_in_distance = true,
},
respond = {
ENABLE = true,
command = "respond",
key = "g",
},
AntiCheat = {
ENABLE = true,
AllowedJobsOnly = {
ENABLE = true,
},
EventSpam = {
fast = {
events = 5,
time = 3,
},
ENABLE = true,
slow = {
events = 5,
time = 20,
},
},
discord_tag_everyone = true,
BannedWords = {
banned_words = {
[1] = "http",
[2] = "discord",
[3] = ".gg",
[4] = "fuck",
[5] = "fucker",
[6] = "fucking",
[7] = "shit",
[8] = "shitty",
[9] = "bullshit",
[10] = "cunt",
[11] = "bitch",
[12] = "bastard",
[13] = "asshole",
[14] = "arsehole",
[15] = "motherfucker",
[16] = "whore",
[17] = "slut",
[18] = "hoe",
[19] = "skank",
[20] = "retard",
[21] = "prick",
[22] = "twat",
[23] = "wanker",
[24] = "dipshit",
[25] = "shithead",
[26] = "fuckhead",
[27] = "asshat",
[28] = "fuk",
[29] = "fck",
[30] = "fuq",
[31] = "sh1t",
[32] = "b1tch",
[33] = "c*nt",
[34] = "f*ck",
[35] = "biatch",
[36] = "azzhole",
[37] = "a$$hole",
},
ENABLE = true,
},
DuplicateMessages = {
threshold = {
events = 3,
time = 10,
},
ENABLE = true,
},
},
NotifyStatusChange = true,
AutoInsertSQL = true,
AllowedJobs = {
[1] = {
[1] = "police",
[2] = "ambulance",
},
[2] = {
[1] = "mechanic",
},
},
Dispatcher = {
ENABLE = true,
notify_activity = true,
VoipResource = "toko",
},
GpsTracker = {
item_name = "CHANGE_ME",
ENABLE = false,
item_check_timer = 10,
AllowedJobs = {
[1] = "police",
[2] = "ambulance",
},
},
WaypointTracking = {
auto_cancel_distance = 30,
update_timer = 1,
},
Debug = true,
HeatMap = {
limit_calls = 100,
ENABLE = true,
},
small_ui_right = {
ENABLE = true,
command = "scrollright",
key = "right",
},
}
```
:::
```lua
local config = exports['cd_dispatch']:GetConfig()
```
## Server
### Get All Dispatch Notifications
Returns all active dispatch notifications.
```lua [@parameters]
--- @return table notifications A table containing all current dispatch notifications.
--- @example
--- local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()
--- print(json.encode(notifications))
```
::: details Example Output
```lua
{
[1] = {
flash = true,
title = "911 - PANIC BUTTON",
epoch = 1785179511,
job_table = {
[1] = "police",
[2] = "ambulance",
},
responding = 0,
sound = 4,
message = "[NO CALLSIGN] ramp clash needs urgent assistance at Vespucci Blvd, Mission Row",
coords = {
x = 436.37091064453,
y = -1018.6312866211,
z = 28.798891067505,
},
blip = {
time = 5,
text = "911 - PANIC BUTTON",
radius = 0,
scale = 1.5,
colour = 3,
sprite = 58,
flashes = true,
},
unique_id = "EXEQ-GN8A-PWGJ-7JP1",
},
}
```
:::
```lua
local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()
```
### Get Player’s Dispatch Data
Returns a player’s dispatch character data, such as callsign, character name, and status.
```lua [@parameters]
--- @param source number The player’s server ID.
--- @return table playerData A table containing the player’s dispatch data.
--- @example
--- local source= source
--- local playerData = exports['cd_dispatch']:GetPlayersDispatchData(source)
--- print(json.encode(playerData))
```
::: details Example Output
```lua
{
on_duty = true,
status = {
name = "Available",
color = "#539D1B",
},
vehicle = "foot",
radio_channel = 0,
callsign = "NO CALLSIGN",
source = 1,
coords = {
h = 99.21,
y = -1018.64,
z = 28.79,
x = 436.36,
},
job = "police",
char_name = "ramp clash",
}
```
:::
```lua
local playerData = exports['cd_dispatch']:GetPlayersDispatchData(source)
```
### Get Config
Returns all configuration data from the dispatch’s config.lua file.
```lua [@parameters]
--- @return table configData A table containing the dispatch configuration.
--- @example
--- local config = exports['cd_dispatch']:GetConfig()
--- print(json.encode(config))
```
::: details Example Output
```lua
{
Ping = {
key = "",
ENABLE = true,
command = "dispatchping",
cooldown = 10,
},
DispatchCallExpiryTime = 60,
EnableTestCommand = true,
JobCallCommands = {
Civilian_Commands = {
[1] = {
job_label = "Police",
command = "911",
job_table = {
[1] = "police",
},
},
[2] = {
job_label = "Ambulance",
command = "911ems",
job_table = {
[1] = "ambulance",
},
},
[3] = {
job_label = "Mechanic",
command = "mechanic",
job_table = {
[1] = "mechanic",
},
},
},
ENABLE = true,
JobReply_Command = "reply",
},
AutoUpdatePlayerCoordinates = {
time = 5,
ENABLE = true,
},
large_ui = {
ENABLE = true,
command = "dispatchlarge",
key = "l",
},
FollowPlayer = {
time = 500,
ENABLE = true,
},
Perms = {
Planner = {
police = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
},
Dispatcher = {
mechanic = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
ambulance = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
police = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
fire = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
sheriff = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
},
},
small_ui_left = {
ENABLE = true,
command = "scrollleft",
key = "left",
},
PauseMenuBlips = {
minimize_longdistance_blips = true,
blip_sprites = {
car = 56,
static = 1,
helicopter = 43,
motorcycle = 226,
boat = 427,
foot = 1,
},
blip_type = "auto",
bundle_blips = false,
radiochannel_on_blips = true,
flashing_blips = true,
blip_colours = {
mechanic = {
[1] = 2,
[2] = 0,
},
ambulance = {
[1] = 1,
[2] = 0,
},
police = {
[1] = 3,
[2] = 1,
},
fire = {
[1] = 1,
[2] = 0,
},
sheriff = {
[1] = 3,
[2] = 1,
},
},
data_update_timer = 3,
ENABLE = true,
},
AfkTimer = {
time = 5,
ENABLE = true,
},
PoliceAlerts = {
MeleeFight = {
random_chance = 75,
ENABLE = true,
cooldown = 30,
},
police_jobs = {
[1] = "police",
},
VehicleAlarm = {
random_chance = 50,
ENABLE = true,
cooldown = 30,
},
Explosion = {
random_chance = 75,
WhitelistedZones = {
[1] = {
coords = "vec3(0.000000, 0.000000, 0.000000)",
radius = 20,
},
},
max_distance_from_player = 200.0,
cooldown = 30,
ENABLE = true,
},
WeaponDrawn = {
random_chance = 50,
ENABLE = true,
WhitelistedWeapons = {
[1] = -1569615261,
[2] = -1951375401,
[3] = 101631238,
[4] = 883325847,
[5] = -1168940174,
[6] = 911657153,
[7] = 1233104067,
[8] = 1198879012,
[9] = 1737195953,
[10] = -1810795771,
[11] = 1141786504,
},
cooldown = 30,
},
VehicleAssault = {
cooldown = 30,
ENABLE = true,
random_chance = 75,
min_speed_mph = 20,
},
GunShots = {
random_chance = 75,
WhitelistedWeapons = {
[1] = 1233104067,
[2] = 1198879012,
[3] = 101631238,
[4] = 883325847,
[5] = 911657153,
[6] = -1466123874,
[7] = 126349499,
[8] = -135142818,
},
cooldown = 30,
BurstShots = {
min_shots_in_burst = 3,
burst_gap_ms = 700,
burst_settle_ms = 2000,
},
WhitelistedZones = {
[1] = {
coords = "vec3(13.980000, -1098.050049, 29.799999)",
radius = 20,
},
[2] = {
coords = "vec3(821.090027, -2163.459961, 78.669998)",
radius = 20,
},
},
ENABLE = true,
},
CarJacking = {
random_chance = 75,
ENABLE = true,
cooldown = 30,
},
ENABLE = true,
add_bolos = true,
RecklessDriving = {
min_speed = 30,
ENABLE = true,
random_chance = 75,
cooldown = 30,
},
whitelisted_jobs = {
[1] = "police",
},
CarCrash = {
cooldown = 30,
ENABLE = true,
random_chance = 75,
minimum_crash_speed = 50,
},
GunPointCarJacking = {
random_chance = 100,
ENABLE = true,
max_distance = 20,
cooldown = 45,
},
WitnessPeds = {
NoSnitchingZones = {
[1] = {
coords = "vec3(30.010000, -1847.599976, 24.510000)",
radius = 150,
},
[2] = {
coords = "vec3(-187.220001, -1627.699951, 33.610001)",
radius = 100,
},
[3] = {
coords = "vec3(333.380005, -2037.739990, 21.070000)",
radius = 80,
},
},
ENABLE = true,
radius = 50,
BlacklistedPedModels = {
[1] = 999748158,
},
time_to_kill_caller = 10,
max_callers = 1,
},
SpeedTrap = {
ENABLE = true,
enable_blip = true,
cooldown = 30,
check_owner_for_fine = true,
speed_unit = "mph",
Locations = {
[1] = {
coords = "vec3(1051.420044, 331.109985, 84.000000)",
speed_limit = 150,
fine_amount = 500,
radius = 9,
},
[2] = {
coords = "vec3(544.429993, -373.239990, 33.139999)",
speed_limit = 150,
fine_amount = 5000,
radius = 9,
},
[3] = {
coords = "vec3(-2612.100098, 2940.810059, 16.670000)",
speed_limit = 150,
fine_amount = 1000,
radius = 15,
},
[4] = {
coords = "vec3(287.940002, -517.440002, 42.889999)",
speed_limit = 100,
fine_amount = 500,
radius = 15,
},
[5] = {
coords = "vec3(2792.729980, 4407.680176, 48.439999)",
speed_limit = 150,
fine_amount = 1000,
radius = 24,
},
[6] = {
coords = "vec3(577.109985, -1028.319946, 37.070000)",
speed_limit = 100,
fine_amount = 1000,
radius = 15,
},
[7] = {
coords = "vec3(114.830002, -797.890015, 30.969999)",
speed_limit = 100,
fine_amount = 2000,
radius = 15,
},
[8] = {
coords = "vec3(74.330002, -163.300003, 54.669998)",
speed_limit = 100,
fine_amount = 4000,
radius = 15,
},
[9] = {
coords = "vec3(28.190001, -971.049988, 28.959999)",
speed_limit = 100,
fine_amount = 1000,
radius = 15,
},
},
Society = {
job = "police",
ENABLE = true,
},
},
},
UpdateDistanceToCall = {
time = 2,
ENABLE = true,
},
small_ui = {
ENABLE = true,
command = "dispatchsmall",
key = "u",
},
PanicButton = {
ENABLE = true,
command = "panic",
cooldown = 10,
key = "",
job_table = {
[1] = "police",
[2] = "ambulance",
},
play_sound_in_distance = true,
},
respond = {
ENABLE = true,
command = "respond",
key = "g",
},
AntiCheat = {
ENABLE = true,
AllowedJobsOnly = {
ENABLE = true,
},
EventSpam = {
fast = {
events = 5,
time = 3,
},
ENABLE = true,
slow = {
events = 5,
time = 20,
},
},
discord_tag_everyone = true,
BannedWords = {
banned_words = {
[1] = "http",
[2] = "discord",
[3] = ".gg",
[4] = "fuck",
[5] = "fucker",
[6] = "fucking",
[7] = "shit",
[8] = "shitty",
[9] = "bullshit",
[10] = "cunt",
[11] = "bitch",
[12] = "bastard",
[13] = "asshole",
[14] = "arsehole",
[15] = "motherfucker",
[16] = "whore",
[17] = "slut",
[18] = "hoe",
[19] = "skank",
[20] = "retard",
[21] = "prick",
[22] = "twat",
[23] = "wanker",
[24] = "dipshit",
[25] = "shithead",
[26] = "fuckhead",
[27] = "asshat",
[28] = "fuk",
[29] = "fck",
[30] = "fuq",
[31] = "sh1t",
[32] = "b1tch",
[33] = "c*nt",
[34] = "f*ck",
[35] = "biatch",
[36] = "azzhole",
[37] = "a$$hole",
},
ENABLE = true,
},
DuplicateMessages = {
threshold = {
events = 3,
time = 10,
},
ENABLE = true,
},
},
NotifyStatusChange = true,
AutoInsertSQL = true,
AllowedJobs = {
[1] = {
[1] = "police",
[2] = "ambulance",
},
[2] = {
[1] = "mechanic",
},
},
Dispatcher = {
ENABLE = true,
notify_activity = true,
VoipResource = "toko",
},
GpsTracker = {
item_name = "CHANGE_ME",
ENABLE = false,
item_check_timer = 10,
AllowedJobs = {
[1] = "police",
[2] = "ambulance",
},
},
WaypointTracking = {
auto_cancel_distance = 30,
update_timer = 1,
},
Debug = true,
HeatMap = {
limit_calls = 100,
ENABLE = true,
},
small_ui_right = {
ENABLE = true,
command = "scrollright",
key = "right",
},
}
```
:::
```lua
local config = exports['cd_dispatch']:GetConfig()
```
---
---
url: /paid-scripts/dispatch3d/developer-api/chat-commands.md
description: >-
Chat commands reference for cd_dispatch3d including player and staff commands
for managing 3D dispatch features.
---
# Chat Commands
## ::: info Note
These chat commands can be renamed or disabled in the **`Keys and Commands`** section of the `[configs/config.lua]`.
:::
***
### /debug\_dispatch
(Debug Command) Displays debug information.
```bash
/debug_dispatch
```
***
### /dispatchlarge
Opens the large dispatch UI.
```bash
/dispatchlarge
```
***
### /dispatchping
Pings your location to other players with dispatch access.
```bash
/dispatchping
```
***
### /dispatchsmall
Toggles the quick-view dispatch UI.
```bash
/dispatchsmall
```
***
### /dispatchtest
(Test Command) Triggers a police notification for testing.
```bash
/dispatchtest
```
***
### /panic
Activates your panic button.
```bash
/panic
```
***
### /reply
Replies to job calls such as **/911** and similar.
```bash
/reply
```
***
### /respond
Responds to a notification.
```bash
/respond
```
---
---
url: /paid-scripts/dispatch3d/developer-api/keys.md
description: >-
Default keybinds for cd_dispatch3d including interaction keys and controls for
the 3D dispatch system.
---
# Keys
## ::: info Note
* You can modify or disable these keys in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section of the `[configs/config.lua]`.
* Ensure you understand how [Key Mapping](https://docs.codesign.pro/coding-information/register-key-mapping) works.
:::
## Quick View UI
U - Toggle the quick view dispatch UI.
## Respond
G - Respond to a notification.
## Scroll Notifications
↠/ → - Scroll through notifications on the quick view UI.
## Large Dispatch UI
L - Open the large dispatch UI.
## (Not Configured) - Dispatch Ping
Ping your location to other players with dispatch access.
## (Not Configured) - Panic Button
Activate your panic button.
---
---
url: /paid-scripts/dispatch3d/resource-integration.md
description: >-
Compatibility reference for cd_dispatch3d showing supported dispatch
resources, frameworks, and copy-paste integration snippets.
---
# Resource Integration
::: details Copy Paste Integration From Client Side
```lua [Automatically detects whether cd_dispatch3d or cd_dispatch is running and triggers the correct dispatch alert accordingly.]
local data = exports['cd_dispatch3d']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
job_table = {'police'},
coords = data.coords,
title = '10-15 - Store Robbery',
message = ('A %s robbing a store at %s'):format(data.sex, data.street),
flash = false,
sound = 1,
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = '911 - Store Robbery',
time = 5,
radius = 0,
}
})
```
:::
::: details Copy Paste Integration From Server Side
```lua
TriggerEvent('cd_dispatch:AddNotification', {
job_table = {'police', },
coords = coords,
title = '10-15 - Drugs',
message = message,
flash = 0,
sound = 1,
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = '911 - Drugs',
time = 5,
radius = 0,
}
})
```
:::
| Status | Description |
| --- | --- |
| **Built-In (script)** | Fully integrated into the script and auto-detected, no modifications or configuration needed. |
| **Built-In (creator)** | Fully integrated by the resource creator, no modifications required. |
| **Built-In (cd\_bridge)** | Fully integrated through cd\_bridge and auto-detected, no extra changes needed in the supported resource. |
| **Minor Changes Required** | Small, simple edits such as adding or copying a single line of code. |
| **Moderate Changes Required** | Involves replacing existing logic or functions with the versions provided by Codesign. |
| **Major Changes Required** | Extensive modifications across multiple files or large code sections. |
## Supported Utility Compatibility
Additional resource types that can work through our bridge, such as notifications and similar utility scripts.
| Script Type | Compatibility Type | View Supported Scripts |
| ---------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| Framework | **Built-In (cd\_bridge)** | [#framework](../../bridge/resource-integration.md#framework "mention") |
| Database Wrapper | **Built-In (cd\_bridge)** | [#database-wrapper](../../bridge/resource-integration.md#database-wrapper "mention") |
| Duty | **Built-In (cd\_bridge)** | [#duty](../../bridge/resource-integration.md#duty "mention") |
| Hud | **Built-In (cd\_bridge)** | [#hud](../../bridge/resource-integration.md#hud "mention") |
| Notifications | **Built-In (cd\_bridge)** | [#notification](../../bridge/resource-integration.md#notification "mention") |
| Society | **Built-In (cd\_bridge)** | [#society](../../bridge/resource-integration.md#society "mention") |
***
## Supported Alert Integrations
Resources grouped by creator with built-in support for sending alerts to our dispatch system.
### ESX
| Script Name | Compatibility Type | Notes |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | ----------------------------- |
| [esx\_ambulancejob](https://github.com/esx-framework/ESX-Legacy-Addons/blob/973ae5390b61e3e6e6e2f507fe8d13cb8d2370af/[esx_addons]/esx_ambulancejob/client/main.lua#L194) | **Built-In (cd\_dispatch3d)** | *cd\_dispatch3d/integrations* |
***
### QBCore
| Script Name | Compatibility Type | Notes |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | ----------------------------- |
| [qb-drugs](https://github.com/qbcore-framework/qb-drugs/blob/7568f7eb396254b9132b39674634949660fa030e/client/cornerselling.lua#L30) | **Built-In (cd\_dispatch3d)** | *cd\_dispatch3d/integrations* |
| [qb-policejob (anpr)](https://github.com/qbcore-framework/qb-policejob/blob/c9a2ae70015c6eb3d18d38e46ce085d2b8d89d37/client/anpr.lua#L36) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-ambulancejob (1)](https://github.com/qbcore-framework/qb-ambulancejob/blob/2ff1e377446d238bd1494e019b03c55ab2f4c964/client/dead.lua#L54) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-ambulancejob (2)](https://github.com/qbcore-framework/qb-ambulancejob/blob/2ff1e377446d238bd1494e019b03c55ab2f4c964/client/dead.lua#L189) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-ambulancejob (3)](https://github.com/qbcore-framework/qb-ambulancejob/blob/fc17631680ffe423a0710f76dc19ecb3482c0a51/client/laststand.lua#L70) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-bankrobbery (fleeca)](https://github.com/qbcore-framework/qb-bankrobbery/blob/ee8f8a1b06dd771bf23b1fcd2d54dab0a07613a5/client/fleeca.lua#L273) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-bankrobbery (pacific 1)](https://github.com/qbcore-framework/qb-bankrobbery/blob/ee8f8a1b06dd771bf23b1fcd2d54dab0a07613a5/client/pacific.lua#L51) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-bankrobbery (pacific 2)](https://github.com/qbcore-framework/qb-bankrobbery/blob/ee8f8a1b06dd771bf23b1fcd2d54dab0a07613a5/client/pacific.lua#L93) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-bankrobbery (paleto)](https://github.com/qbcore-framework/qb-bankrobbery/blob/ee8f8a1b06dd771bf23b1fcd2d54dab0a07613a5/client/paleto.lua#L42) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-storerobbery (1)](https://github.com/qbcore-framework/qb-storerobbery/blob/d75de7624ff30ccb109dcd2b9c7901e887055b4e/client/main.lua#L90) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-storerobbery (2)](https://github.com/qbcore-framework/qb-storerobbery/blob/d75de7624ff30ccb109dcd2b9c7901e887055b4e/client/main.lua#L151) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-storerobbery (3)](https://github.com/qbcore-framework/qb-storerobbery/blob/d75de7624ff30ccb109dcd2b9c7901e887055b4e/client/main.lua#L168) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-truckrobbery](https://github.com/qbcore-framework/qb-truckrobbery/blob/4c4e2584cf517ec55858d89217877e097be749c6/client/main.lua#L156) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-jewelery](https://github.com/qbcore-framework/qb-jewelery/blob/b9089a14df852ddaca14773561362f4aa8c77d56/client/main.lua#L80) | **Built-In (cd\_dispatch3d)** | 〃 |
| [qb-houserobbery](https://github.com/qbcore-framework/qb-houserobbery/blob/19ba35dac2047d1a6941f82d466033ea5b9891d3/client/main.lua#L90) | **Built-In (cd\_dispatch3d)** | 〃 |
***
### Jaksam
| Script Name | Compatibility Type | Notes |
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------ | ----------------------------- |
| [Jaksam doors\_creator](https://fivem.jaksam-scripts.com/package/4960053) | **Built-In (cd\_dispatch3d)** | *cd\_dispatch3d/integrations* |
| [Jaksam drugs\_creator](https://fivem.jaksam-scripts.com/package/5369988) | **Built-In (cd\_dispatch3d)** | 〃 |
| [Jaksam mission\_creator](https://fivem.jaksam-scripts.com/package/6240151) | **Built-In (cd\_dispatch3d)** | 〃 |
| [Jaksam robbery\_creator](https://fivem.jaksam-scripts.com/package/5369985) | **Built-In (cd\_dispatch3d)** | 〃 |
| [Jaksam\_vehicle\_keys](https://fivem.jaksam-scripts.com/package/5369990) | **Built-In (cd\_dispatch3d)** | 〃 |
| [Jaksam\_races\_creator](https://fivem.jaksam-scripts.com/package/5511252) | **Built-In (cd\_dispatch3d)** | 〃 |
| [Jaksam\_farming\_creator](https://fivem.jaksam-scripts.com/package/5391625) | **Built-In (cd\_dispatch3d)** | 〃 |
***
### KuzQuality
| Script Name | Compatibility Type | Notes |
| ------------------------------------------------------------------------------ | ----------------------------------------------------------- | ----- |
| [Meth Cooking](https://kuzquality.com/package/meth-cooking) | **Built-In (creator)** | |
| [Meth Cooking - Amphetamines DLC](https://kuzquality.com/package/amphetamines) | **Built-In (creator)** | |
| [Smash 'n Grab](https://kuzquality.com/package/smash-n-grab) | **Built-In (creator)** | |
| [Smugglers Plane Heist](https://kuzquality.com/package/smugglers-plane-heist) | **Built-In (creator)** | |
***
### Lation Scripts
| Script Name | Compatibility Type | Notes |
| ------------------------------------------------------------------ | ----------------------------------------------------------- | ----- |
| [lation\_coke](https://lationscripts.com/product/coke-processing) | **Built-In (creator)** | |
| [lation\_laundering](https://lationscripts.com/product/money-wash) | **Built-In (creator)** | |
| [lation\_meth](https://lationscripts.com/product/meth-crafting) | **Built-In (creator)** | |
| [lation\_selling](https://lationscripts.com/product/drug-selling) | **Built-In (creator)** | |
***
### Loaf Scripts
| Script Name | Compatibility Type | Notes |
| -------------------------------------------------------------------- | ----------------------------------------------------------- | ----- |
| [loaf\_bankrobbery](https://store.loaf-scripts.com/package/4470485) | **Built-In (creator)** | |
| [loaf\_jewelheist](https://store.loaf-scripts.com/package/4956479) | **Built-In (creator)** | |
| [loaf\_storerobbery](https://store.loaf-scripts.com/package/4510865) | **Built-In (creator)** | |
***
### Lunar
| Script Name | Compatibility Type | Notes |
| ----------------------------------------------------------------------- | ----------------------------------------------------------- | ----- |
| [lunar\_drugscreator](https://lunar-scripts.tebex.io/package/6750866) | **Built-In (creator)** | |
| [lunar\_heistcontracts](https://lunar-scripts.tebex.io/package/6346140) | **Built-In (creator)** | |
***
### MenanAk47
| Script Name | Compatibility Type | Notes |
| -------------------------------------------------------------------- | ----------------------------------------------------------- | ----- |
| [ak47\_ambulancejob](https://menanak47.tebex.io/package/5884442) | **Built-In (creator)** | |
| [ak47\_qb\_ambulancejob](https://menanak47.tebex.io/package/5893947) | **Built-In (creator)** | |
| [ak47\_carboosting](https://menanak47.tebex.io/package/6271022) | **Built-In (creator)** | |
| [ak47\_qb\_carboosting](https://menanak47.tebex.io/package/6271024) | **Built-In (creator)** | |
| [ak47\_gangs](https://menanak47.tebex.io/package/6027838) | **Built-In (creator)** | |
| [ak47\_qb\_gangs](https://menanak47.tebex.io/package/6029252) | **Built-In (creator)** | |
| [ak47\_territories](https://menanak47.tebex.io/package/6810765) | **Built-In (creator)** | |
| [ak47\_qb\_territories](https://menanak47.tebex.io/package/6810766) | **Built-In (creator)** |
***
### Project X
| Script Name | Compatibility Type | Notes |
| ------------------------------------------------------- | ----------------------------------------------------------- | ----- |
| [All 34 Scripts](https://www.projectx.gg/category/2813127) | **Built-In (creator)** | |
***
### Pug
| Script Name | Compatibility Type | Notes |
| ------------------------------------------------------------------- | ------------------------------------------------------------------ | --------------------------- |
| [pug-robberycreator](https://pug-webstore.tebex.io/package/6493520) | **Built-In (creator)** | |
| [pug-paintball](https://pug-webstore.tebex.io/package/5513575) | **Built-In (cd\_dispatch3d)** | cd\_dispatch3d/integrations |
| [pug-battleroyale](https://pug-webstore.tebex.io/package/5787026) | **Built-In (cd\_dispatch3d)** | cd\_dispatch3d/integrations |
***
### Rainmad
| Script Name | Compatibility Type | Notes |
| --------------------------------------------------------------- | ----------------------------------------------------------- | ----- |
| [All 21 Heist Scripts](https://store.rainmad.com/category/escrow) | **Built-In (creator)** | |
| [All 5 Robbery Scripts](https://store.rainmad.com/category/escrow) | **Built-In (creator)** | |
| [All 6 Drugs Scripts](https://store.rainmad.com/category/escrow) | **Built-In (creator)** | |
***
### RTX
| Script Name | Compatibility Type | Notes |
| ---------------------------------------------------------- | ----------------------------------------------------------- | ----- |
| [rtx\_drugs\_system](https://rtx.tebex.io/package/6967674) | **Built-In (creator)** | |
| [rtx\_housing](https://rtx.tebex.io/package/7181359) | **Built-In (creator)** | |
***
### Samuel's Development
| Script Name | Compatibility Type | Notes |
| ---------------------------------------------------------- | ----------------------------------------------------------- | ----- |
| [sd-bobcat](https://fivem.samueldev.shop/product/6255341) | **Built-In (creator)** | |
| [sd-cokemission](https://fivem.samueldev.shop/product/6255346) | **Built-In (creator)** | |
| [sd-oilrig](https://fivem.samueldev.shop/product/6255340) | **Built-In (creator)** | |
| [sd-oxyrun](https://fivem.samueldev.shop/product/6255345) | **Built-In (creator)** | |
| [sd-pacificbank](https://fivem.samueldev.shop/product/6255343) | **Built-In (creator)** | |
| [sd-pettycrime](https://fivem.samueldev.shop/product/7462774) | **Built-In (creator)** | |
| [sd-selling](https://fivem.samueldev.shop/product/6295308) | **Built-In (creator)** | |
| [sd-traphouse](https://fivem.samueldev.shop/product/6426088) | **Built-In (creator)** | |
| [sd-warehouse](https://fivem.samueldev.shop/product/6255347) | **Built-In (creator)** | |
| [sd-yacht](https://fivem.samueldev.shop/product/6255342) | **Built-In (creator)** | |
***
### TK Scripts
| Script Name | Compatibility Type | Notes |
| ------------------------------------------------------------------ | ----------------------------------------------------------- | ----- |
| [tk\_boosting](https://tkscripts.com/product/boosting) | **Built-In (creator)** | |
| [tk\_drugs](https://tkscripts.com/product/drugs) | **Built-In (creator)** | |
| [tk\_druglabs](https://tkscripts.com/product/druglabs) | **Built-In (creator)** | |
| [tk\_garagerobbery](https://tkscripts.com/product/garagerobbery) | **Built-In (creator)** | |
| [tk\_houserobbery](https://tkscripts.com/product/houserobbery) | **Built-In (creator)** | |
| [tk\_npcrobbery](https://tkscripts.com/product/npcrobbery) | **Built-In (creator)** | |
| [tk\_jewelryrobbery](https://tkscripts.com/product/jewelryrobbery) | **Built-In (creator)** | |
| [tk\_selldrugs](https://tkscripts.com/product/selldrugs) | **Built-In (creator)** | |
| [tk\_shoprobbery](https://tkscripts.com/product/shoprobbery) | **Built-In (creator)** | |
***
---
---
url: /paid-scripts/dispatch3d/resource-integration/preconfigured-alerts.md
description: >-
Preconfigured client-side dispatch events for cd_dispatch3d that send alerts
with predefined settings, requiring no additional setup.
---
# Preconfigured Alerts
## ::: info Note
These events do **not** contain any logic themselves. Triggering one simply fires a **preconfigured dispatch alert** that has already been set up in the dispatch configuration. All jobs, messages, blips, sounds, and behaviour are handled automatically by `cd_dispatch3d`.
:::
## Robberies & Theft
### Store Robbery
Triggered when a store robbery starts.
```lua
TriggerEvent('cd_dispatch:PreSet:StoreRobbery')
```
### Bank Robbery
Triggered when a bank robbery is in progress.
```lua
TriggerEvent('cd_dispatch:PreSet:BankRobbery')
```
### Jewelry Robbery
Triggered during a jewelry store robbery.
```lua
TriggerEvent('cd_dispatch:PreSet:JewelryRobbery')
```
### House Burglary
Triggered when a house burglary is detected.
```lua
TriggerEvent('cd_dispatch:PreSet:HouseBurglary')
```
### Carjacking
Triggered when a vehicle is forcibly taken.
```lua
TriggerEvent('cd_dispatch:PreSet:Carjacking')
```
### Stolen Vehicle
Triggered when a stolen vehicle is reported.
```lua
TriggerEvent('cd_dispatch:PreSet:StolenVehicle')
```
***
## Violent Crime
### Shots Fired
Triggered when gunshots are reported.
```lua
TriggerEvent('cd_dispatch:PreSet:ShotsFired')
```
### Person With a Gun
Triggered when an armed person is reported.
```lua
TriggerEvent('cd_dispatch:PreSet:PersonWithGun')
```
### Stabbing
Triggered when a stabbing incident occurs.
```lua
TriggerEvent('cd_dispatch:PreSet:Stabbing')
```
### Fight in Progress
Triggered when a physical fight is reported.
```lua
TriggerEvent('cd_dispatch:PreSet:FightInProgress')
```
### Kidnapping
Triggered when a kidnapping is reported.
```lua
TriggerEvent('cd_dispatch:PreSet:Kidnapping')
```
***
## Police & Law Enforcement
### Officer Down
Triggered when an officer is incapacitated.
```lua
TriggerEvent('cd_dispatch:PreSet:OfficerDown')
```
### Panic Button
Triggered when an officer activates their panic button.
```lua
TriggerEvent('cd_dispatch:PreSet:PanicButton')
```
### Backup Request
Triggered when officers request immediate backup.
```lua
TriggerEvent('cd_dispatch:PreSet:BackupRequest')
```
### Pursuit
Triggered when a vehicle or foot pursuit begins.
```lua
TriggerEvent('cd_dispatch:PreSet:Pursuit')
```
### Prison Break
Triggered when a prison escape occurs.
```lua
TriggerEvent('cd_dispatch:PreSet:PrisonBreak')
```
***
## Traffic & Vehicles
### Suspicious Vehicle
Triggered for a suspicious vehicle report.
```lua
TriggerEvent('cd_dispatch:PreSet:SuspiciousVehicle')
```
### Reckless Driver
Triggered when reckless driving is observed.
```lua
TriggerEvent('cd_dispatch:PreSet:RecklessDriver')
```
### Traffic Collision
Triggered when a traffic accident occurs.
```lua
TriggerEvent('cd_dispatch:PreSet:TrafficCollision')
```
### Street Racing
Triggered when illegal street racing is detected.
```lua
TriggerEvent('cd_dispatch:PreSet:StreetRacing')
```
***
## Alarms & Suspicious Activity
### ATM Alarm
Triggered when an ATM alarm is activated.
```lua
TriggerEvent('cd_dispatch:PreSet:ATMAlarm')
```
### Business Alarm
Triggered when a business alarm is activated.
```lua
TriggerEvent('cd_dispatch:PreSet:BusinessAlarm')
```
### Drug Activity
Triggered when suspected drug activity is reported.
```lua
TriggerEvent('cd_dispatch:PreSet:DrugActivity')
```
### Suspicious Person
Triggered when a suspicious person is reported.
```lua
TriggerEvent('cd_dispatch:PreSet:SuspiciousPerson')
```
### Noise Complaint
Triggered for a noise disturbance report.
```lua
TriggerEvent('cd_dispatch:PreSet:NoiseComplaint')
```
***
## Fire, Medical & Emergencies
### Structure Fire
Triggered when a building fire is reported.
```lua
TriggerEvent('cd_dispatch:PreSet:StructureFire')
```
### Vehicle Fire
Triggered when a vehicle fire is reported.
```lua
TriggerEvent('cd_dispatch:PreSet:VehicleFire')
```
### Explosion
Triggered when an explosion is reported.
```lua
TriggerEvent('cd_dispatch:PreSet:Explosion')
```
### Medical Emergency
Triggered for a medical emergency call.
```lua
TriggerEvent('cd_dispatch:PreSet:MedicalEmergency')
```
### Overdose
Triggered when a drug overdose is reported.
```lua
TriggerEvent('cd_dispatch:PreSet:Overdose')
```
### Dead Body
Triggered when a deceased person is found.
```lua
TriggerEvent('cd_dispatch:PreSet:DeadBody')
```
### Animal Attack
Triggered when an animal attack is reported.
```lua
TriggerEvent('cd_dispatch:PreSet:AnimalAttack')
```
---
---
url: /paid-scripts/dispatch3d/mdt-compatibility.md
description: >-
MDT compatibility reference for cd_dispatch3d showing which MDT resources can
display dispatch alerts.
---
# MDT Compatibility
| Status | Description |
| --- | --- |
| **Built-In (script)** | Fully integrated into the script and auto-detected, no modifications or configuration needed. |
| **Built-In (creator)** | Fully integrated by the resource creator, no modifications required. |
| **Built-In (cd\_bridge)** | Fully integrated through cd\_bridge and auto-detected, no extra changes needed in the supported resource. |
| **Minor Changes Required** | Small, simple edits such as adding or copying a single line of code. |
| **Moderate Changes Required** | Involves replacing existing logic or functions with the versions provided by Codesign. |
| **Major Changes Required** | Extensive modifications across multiple files or large code sections. |
## Supported MDT Compatibility
Supported MDT resources can display alerts from Dispatch3D.
| Script Name | Compatibility Type | Notes |
| ---------------------------------------------------- | ------------------------------------------------------------------ | ------------------------------------------------ |
| [p\_mdt](https://pscripts-store.com/product/6632004) | **Built-In (creator)** | |
| [plt\_mdt](https://pluto-dev.com/package/7297357) | **Built-In (cd\_dispatch3d)** | |
| [ps-mdt](https://github.com/Project-Sloth/ps-mdt) | **Moderate Changes Required** | [#ps-mdt](mdt-compatibility.md#ps-mdt "mention") |
| [tk\_mdt](https://tkscripts.com/) | **Built-In (creator)** | |
## MDT Compatibility Guides
Step-by-step guides for making supported MDT resources display alerts from our dispatch system.
## :::info Notice
The **exact line** where these changes are made may differ after updates, but the **code itself remains the same**.
:::
### ps-mdt
View the code on GitHub: [ps-mdt/server/main.lua](https://github.com/Project-Sloth/ps-mdt/blob/bb17c91354f9851053694695863f224aaa24b669/server/main.lua#L125)
REPLACE the code exactly as seen in the screenshot below.
```lua:line-numbers=125 [ps-mdt/server/main.lua — line 125]
local dispatchResources = {
{ name = 'ps-dispatch', export = 'GetDispatchCalls' },
{ name = 'cd_dispatch3d', export = 'GetDispatchCalls_PS' },
{ name = 'cd_dispatch', export = 'GetDispatchCalls_PS' },
}
for _, res in ipairs(dispatchResources) do
if GetResourceState(res.name) == 'started' then
return exports[res.name][res.export]()
end
end
```
![]()
Before and After
View the code on GitHub: [ps-mdt/server/main.lua](https://github.com/Project-Sloth/ps-mdt/blob/bb17c91354f9851053694695863f224aaa24b669/server/main.lua#L256)
REPLACE the code exactly as seen in the screenshot below.
```lua:line-numbers=256 [ps-mdt/server/main.lua — line 256]
local dispatchResources = {
{ name = 'ps-dispatch', export = 'GetDispatchCalls' },
{ name = 'cd_dispatch3d', export = 'GetDispatchCalls_PS' },
{ name = 'cd_dispatch', export = 'GetDispatchCalls_PS' },
}
for _, res in ipairs(dispatchResources) do
if GetResourceState(res.name) == 'started' then
calls = exports[res.name][res.export]()
break
end
end
```
![]()
Before and After
View the code on GitHub: [ps-mdt/server/main.lua](https://github.com/Project-Sloth/ps-mdt/blob/bb17c91354f9851053694695863f224aaa24b669/server/main.lua#L321)
REPLACE the code exactly as seen in the screenshot below.
```lua:line-numbers=321 [ps-mdt/server/main.lua — line 321]
local dispatchResources = {
{ name = 'ps-dispatch', export = 'GetDispatchCalls' },
{ name = 'cd_dispatch3d', export = 'GetDispatchCalls_PS' },
{ name = 'cd_dispatch', export = 'GetDispatchCalls_PS' },
}
for _, res in ipairs(dispatchResources) do
if GetResourceState(res.name) == 'started' then
cb(exports[res.name][res.export]())
break
end
end
```
![]()
Before and After
View the code on GitHub: [ps-mdt/client/main.lua](https://github.com/Project-Sloth/ps-mdt/blob/bb17c91354f9851053694695863f224aaa24b669/client/main.lua#L17)
REPLACE the code exactly as seen in the screenshot below.
```lua:line-numbers=17 [ps-mdt/client/main.lua — line 17]
CreateThread(function()
local dispatchResources = {
{ name = 'ps-dispatch' },
{ name = 'cd_dispatch3d' },
{ name = 'cd_dispatch' },
}
for _, res in ipairs(dispatchResources) do
if GetResourceState(res.name) == 'started' then
TriggerServerEvent("ps-mdt:dispatchStatus", true)
break
end
end
end)
```
![]()
Before and After
---
---
url: /paid-scripts/dispatch3d/migration-guide.md
description: >-
Migration guide for moving from other dispatch systems to cd_dispatch3d.
Covers supported migrations and data preservation.
---
# Migration Guide
**Migration Type Key**
| State | Description |
| --- | --- |
| Built-in Migration | Automatically supported with no SQL changes, code changes, or manual setup required. |
| Minor Migration Required | Requires a simple command, SQL query, or small code change. All required queries or code are provided. Usually completed in minutes. |
| Moderate Migration Required | Requires provided SQL queries and some code changes across a few files. Usually completed in 5–15 minutes. |
| Major Migration Required | Requires multiple SQL queries and larger code changes across several files. Usually takes 1+ hours. |
## Supported Dispatch Migrations
See which dispatch scripts can be migrated to `cd_dispatch3d` without needing to replace all existing alert exports or notification code.
## :::info Automatic Migration Note
**No code changes are required when migrating from the listed scripts. Existing police alert exports and events are handled automatically by `cd_dispatch3d`, so you do not need to replace old alerts across your server.**
:::
| Script Name | Migration Type | Notes |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ---------------------------------------------- |
| [cd\_dispatch](https://codesign.pro/product/4206357) | **Built-In Migration** | |
| ESX | **Built-In Migration** | Default framework police alerts are supported. |
| [lb-tablet](https://lbscripts.com/package/tablet) | **Built-In Migration** | |
| [ps-dispatch](https://github.com/Project-Sloth/ps-dispatch) | **Built-In Migration** | |
| QBCore | **Built-In Migration** | Default framework police alerts are supported. |
| [rcore-dispatch](https://store.rcore.cz/package/5789351) | **Built-In Migration** | |
| [redutzu-mdt](https://redutzu.com/product/mdt) | **Built-In Migration** | |
---
---
url: /paid-scripts/dispatch3d/changelog.md
description: >-
Latest updates, changes, and improvements for cd_dispatch3d. Tracks version
history, new features, and bug fixes for the 3D dispatch system.
---
# Changelog
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
## ::: danger Important Notice (cd\_bridge dependency)
Since v1.1.0, `cd_dispatch3d` requires `cd_bridge` to work.\
This improves compatibility and makes future updates easier.
:::
## v1.2.10
```bash [Files Changed]
fxmainfest.lua
client/other/police_alerts/weapon_drawn.lua
```
## ::: warning Fixes
* Fixed the clipboard animation incorrectly triggering the police weapon-drawn alert.
:::
## v1.2.9
```bash [Files Changed]
fxmainfest.lua
server/main/server.lua
client/main/client.lua
client/other/functions.lua
```
## ::: warning Fixes
* Fixed NUI focus not triggering when using /911 (mouse not appearing on screen).
* Fixed an issue where toggling voice on the UI prevented mouse movement.
:::
## v1.2.8
```bash [Files Changed]
fxmainfest.lua
server/main/server.lua
server/main/anti_cheat.lua
server/main/callbacks.lua
server/other/gps_tracker.lua
configs/config.lua (only required if affected by the fix below)
```
## ::: warning Fixes
* Fixed an issue with built-in police alerts not working correctly, where the anti-cheat was triggered if jobs in `Config.PoliceAlerts.police_jobs` were not defined in `Config.AllowedJobs`, causing legitimate alerts to be blocked. **If this issue affected you, update your config.lua. If not, no changes are required to the config.lua.**
* Fixed the GPS tracker not working correctly.
* Fixed an issue where the anti-cheat was not banning players correctly (it was accidentally disabled during testing).
:::
## v1.2.7
```bash [Files Changed]
fxmanifest.lua
server/main/server.lua
server/main/debug.lua
integrations/server/migration/qbcore_to_cd.lua
client/main/client.lua
client/other/panic_buttons.lua
client/other/ping.lua
ADDED FILE
integrations/server/mdt-compatibility/cd_dispatch_to_plt_mdt.lua
```
## ::: tip Added
* Added compatibility with **plt\_mdt**, allowing cd\_dispatch3d alerts to be displayed on plt\_mdt.
* Added support for the default QBCore officer down alert.
* Improved debug code.
:::
## v1.2.6
```bash [Files Changed]
fxmanifest.lua
integrations/client/allowlist_gunshots.lua
client/other/player_blips.lua
server/other/player_blips.lua
```
**Changelog:**
## ::: warning Fixes
* Fixed issue where flashing blips were not working correctly and improved player blip performance.
* Fixed issue where alerts were triggered in `pug-paintball` despite being allowlisted.
:::
## v1.2.5
```bash [Files Changed]
fxmanifest.lua
server/main/anti_cheat.lua
server/main/debug.lua
server/other/dispatcher.lua
```
**Changelog:**
::: info Changes
* Further improved anti cheat.
:::
## ::: warning Fixes
* Fixed an error when using dispatcher.
:::
## v1.2.4
**Changelog:**
## ::: info Changes
* Further advancements to the anti cheat to counter modders - cant say too much.
* Auto ban modders on QBCore and Qbox.
:::
## v1.2.3
```bash [Files Changed]
fxmanifest.lua
server/other/police_alerts.lua
integrations/server/migration/lb-tablet_to_cd.lua
integrations/server/migration/redutzu-mdt_to_cd.lua
configs/config.lua: Update whole config.lua, or add the snippet below to Config.PoliceAlerts.SpeedTrap.
Society = {
ENABLE = true, --Do you want to add the fine amount to a society account?
job = 'police', --The society job to add the money to if "ENABLE" is true.
},
```
**Changelog:**
## ::: tip Added
* Added config option to send speeding fine payments to a society account.
:::
## ::: warning Fixes
* Added auto-fix for whitelisted weapons defined as strings instead of hashes.
* Fixed issue where the panic button sound did not play when another player triggered it.
:::
## v1.2.2
```bash [Files Changed]
fxmanifest.lua
integrations/server/migration (full folder)
```
**Changelog:**
## ::: warning Fixes
* Fixed compatibility issues with `pd-mdt`.
* Fixed a crash when using `cd_dispatch3d` and `redutzu-mdt`.
:::
***
## v1.2.1
**Changelog:**
## ::: tip Added
* **Dispatch Classic to Dispatch3D:** You can now switch to `cd_dispatch3d` from `cd_dispatch (classic)` without updating existing dispatch alerts.
* **ps-dispatch:** You can now switch from `ps-dispatch` to `cd_dispatch3d` and continue using existing ps-dispatch export alerts without making any changes.
* **lb-tablet:** You can now switch from `lb-tablet` to `cd_dispatch3d` and continue using existing lb-tablet dispatch alerts without making any changes.
* **redutzu-mdt:** You can now switch from `redutzu-mdt` to `cd_dispatch3d` and continue using existing redutzu-mdt dispatch alerts without making any changes.
* **ESX Police Alerts:** Added default ESX police alerts to `cd_dispatch3d` for out-of-the-box compatibility, with no edits required to esx scripts.
* **QBCore Police Alerts:** Added 11 pre-configured QBCore default police alerts, requiring no changes or replacements.
* **Jaksam:** Added more default jaksam police alerts to `cd_dispatch3d` for out-of-the-box compatibility.
### 🚓 Built-In Police Alert System
Added **11 built-in police alerts**, each with:
* Its own **random call chance**
* Individual **cooldowns**
#### ⚠️ Testing Note
When **`Config.Debug`** is enabled:
* Police call chance is forced to **100%**
* Whitelisted jobs are **ignored**
* Alert debug information is shown\
*(This is for testing only and should be disabled in live servers.)*
### 👁️ Witness Ped System
Nearby NPCs can act as witnesses and call the police if:
* They are within a configurable distance
* They have **line of sight** to the player
You can also configure:
* Multiple witnesses calling police
* A time window to **harm or eliminate witnesses** before they report
* **Blacklisted ped models**
* **No-snitching zones** where witnesses will never report crimes
#### 📋 Included Police Alerts
* **Car Crash**\
Triggers when you crash into another vehicle at or above a set minimum speed and come to a sudden stop.
* **Carjacking**\
Police are called when you forcibly remove an NPC from their vehicle.
* **Explosion**\
Detects explosions and alerts police.
* **Gunpoint Carjacking**\
Pointing a gun at an NPC driver causes them to stop and flee, triggering an alert.
* **Gunshots**
* Nearby witnesses report the **weapon type** (pistol, rifle, shotgun, etc.).
* If no direct line of sight, nearby NPCs may still report **heard gunshots** (single shots, rapid fire, loud weapons).
* Supports weapon and zone whitelisting.
* **Melee Fight**\
Triggered when you engage in a fist fight or melee combat with an NPC using fists, blunt weapons, or bladed weapons.
* **Reckless Driving**\
Triggered when NPCs witness dangerous or high-speed driving.
* **Speed Trap**\
Speed cameras trigger alerts when speed limits are exceeded and can issue fines.=
* **Vehicle Alarm**\
Alerts police when a vehicle alarm is triggered due to break-ins or damage.
* **Vehicle Assault**\
Triggered when running over an NPC with a vehicle.
* **Weapon Drawn**\
Police are alerted when walking around with a visible weapon.
:::
***
## v1.1.2
```bash [Files Changed]
fxmanifest.lua
server/main/server.lua
```
**Changelog:**
## ::: danger Important Notice (Bridge Update Required)
This update requires the Bridge to be updated to version **1.0.18**.
:::
## ::: warning Fixes
* Fixed an error when removing all notifications.
:::
## v1.1.1
```bash [Files Changed]
fxmanifest.lua
client/main/client.lua
```
**Changelog:**
## ::: danger Important Notice (Bridge Update Required)
This update requires the Bridge to be updated to version **1.0.16**.
:::
## ::: warning Fixes
* Fixed dispatcher perms and toggle.
:::
## v1.1.0
## ::: info Added
* Bridge integration
:::
## v1.0.14
```bash [Files Changed]
fxmanifest.lua
client/main/functions.lua
client/other/police_alerts.lua
--ADDED
integrations (full folder)
```
**Changelog:**
## ::: tip Added
* [**ps-mdt Compatibility:**](https://docs.codesign.pro/paid-scripts/dispatch3d/resource-integration/integrations#ps-mdt) Added compatibility with ps-mdt, cd\_dispatch3d alerts will display on the mdt.
* **Backwards Compatibility:** Added backwards compatibility for **ps-dispatch, qs-dispatch and rcore-dispatch**, meaning you can switch to cd\_dispatch from any of these other dispatches and you wont have to change all of the old alerts.
* **Pre Set Alerts:** Added 20+ pre setup alerts for all possible types of robberies/crimes.
* Added integration and compatibility for various other resource's.
:::
## ::: warning Fixes
* Fixed bug with /911 when dead not enabling NUI focus.
:::
## v1.0.12
```bash [Files Changed]
fxmanifest.lua
server/main/anti_cheat.lua
```
**Changelog:**
## ::: warning Fixes
* Fixed the dispatch data not loading correctly on start randomly.
:::
## v1.0.11
```bash [Files Changed]
fxmanifest.lua
server/main/anti_cheat.lua
```
**Changelog:**
## ::: tip Added
* Added further checks to prevent lua injectors abusing the `cd_dispatch:AddNotification` event.
:::
## v1.0.0
**Changelog:**
::: tip Added
Release day
:::
---
---
url: /paid-scripts/dispatch.md
description: >-
FiveM dispatch system with customizable alerts, player blips, panic button,
job call commands, dispatcher system, and full integration with ESX and QBCore
frameworks.
---
# Dispatch
[**Buy Here**](https://codesign.pro/product/4206357)
[**FiveM Forums Post**](https://forum.cfx.re/t/release-paid-dispatch-script-by-codesign/2007097)
[**YouTube Showcase Video**](https://youtu.be/AiEDaansdqk)
This resource can be purchased as part of a bundle for a discount [here](https://codesign.pro/package/5162629)
## Installation Guide
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Portal](https://portal.cfx.re/assets/granted-assets).
**2.** Unzip the `cd_dispatch.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_dispatch`. 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_dispatch
```
### Step 1 - Fxmanifest
Depending on your framework and dependencies, you may need to make some changes to the **`[cd_dispatch/fxmanifest.lua]`**. We have made this easier by [commenting ](https://i.imgur.com/bbb0dam.png)on the lines you possibly need to change.
### Step 2 - Configure Resource
You **MUST** read all configurable options inside the **`[cd_dispatch/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [commented out help text](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections at the top of the `config.lua`. Everything else is optional.**
> [**NEW: Auto Framework Detect!**](https://i.imgur.com/zNW8Kpg.png)
>
> We have added a new feature we are calling '**auto\_detect**', which will automatically identify your framework and SQL database resource, and apply the appropriate default settings.
### **Step 3 -** SQL Database
**Insert Automatically?**
If you set **`Config.AutoInsertSQL`** in the `[cd_dispatch/configs/config.lua]` to **true**, the resource will automatically insert the SQL for you. You can set this to false after the SQL has been inserted successfully.
**Insert Manually?**
Alternatively, if you want to insert the SQL queries manually, you can find them [here](https://docs.codesign.pro/paid-scripts/dispatch/configs-locales-and-sql).
### Step 4 - Configure Key Binds
Before starting this resource on your main/live server, we highly advise configuring your key binds because this resource uses [Fivem's Key Mapping](../../helpful-guides/register-key-mapping.md).
**Where can I configure my key binds?**
You can configure key binds in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section near the bottom of the **`[cd_dispatch/configs/config.lua]`**.
> **Why do I need to do this?**
>
> Well long story short;- once a player has joined your server with this resource running you can no longer force change their key binds for this resource through the config.lua, only they can change it in the in-game [pause menu settings](https://imgur.com/GRWKelR). Although it will change for the players who join after you have changed it.
>
> The benefit of this system is that it's much more optimised and players can easily change their key binds on keyboards or controllers. You can also check out the [Default Keybinds](./#default-keybinds) for this resource.
### Step 5 - Add New Dispatch Alerts
> **Why do I need to do this?**
>
> Because you need to replace your old dispatch alerts with the new ones.
## ::: info Compatible Code Snippets Provided by Codesign
On our [Dispatch Resource Integration](https://docs.codesign.pro/paid-scripts/garage/resource-integration) page, we provide photos, customized code snippets, and the exact lines to modify for full compatibility with ESX, QBCore and Paid Resources.
[Click here for ESX.](https://docs.codesign.pro/paid-scripts/dispatch/resource-integration#esx-resources)
[Click here for QBCore.](https://docs.codesign.pro/paid-scripts/dispatch/resource-integration#qbcore-resources)
[Click here for Paid Resources.](https://docs.codesign.pro/paid-scripts/dispatch/resource-integration#paid-resources)
:::
**Example**
* Here is an example of replacing your old dispatch alerts with the new ones. Not every resource will look identical to this, but the general idea is the same.
* [EXAMPLE:](https://i.imgur.com/bRxcgIt.png)
* Red = Here is the old dispatch alert.
* Green = The old dispatch alert has been replaced with the new one.
**Customise the dispatch notification**
* The code snippet below is formatted to give complete customisation for any scenario. Every single detail is documented.
* [#A detailed guide for all variables used in the dispatch "code snippet".](./#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)
* [#A detailed guide for all the data the client-side export returns.](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-the-data-the-client-side-export-returns.)
::::tabs
\=== client-side to server-side (recommended)
**CODE SNIPPET:**
```lua
local data = exports['cd_dispatch']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
job_table = {'police', },
coords = data.coords,
title = '10-15 - Store Robbery',
message = 'A '..data.sex..' robbing a store at '..data.street,
flash = 0,
unique_id = data.unique_id,
sound = 1,
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = '911 - Store Robbery',
time = 5,
radius = 0,
}
})
```
\=== server-side to client-side
**CODE SNIPPET:**
```lua
TriggerClientEvent('cd_dispatch:AddNotification', -1, {
job_table = {'police', },
coords = vector3(0, 0, 0),
title = '10-15 - Store Robbery',
message = 'A person robbing a store',
flash = 0,
unique_id = tostring(math.random(0000000,9999999)),
sound = 1,
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = '911 - Store Robbery',
time = 5,
radius = 0,
}
})
```
::::
### **Additional Information**
**Trigger from the client-side or server-side, but not both**
* Above we provide you with 2 different methods of triggering notifications; 1 from the client-side and 1 from the server-side. You DON'T need to use both to trigger the same dispatch alert. Choose 1 or the other, but we recommend using the client-side method as it's simpler.
**Find where the action starts**
*For this example, I will reference a criminal and a police officer.*
* You need to trigger the event when the criminal is performing the action, not the police officer, because it will send the police officer's location, not the criminal's.
* You don't want to trigger the new dispatch alert in the old dispatch alerts existing register event that gets triggered from the server-side and affects all police officers, as that will cause multiple of the same dispatch alerts to be sent.
* [**EXAMPLE:**](https://i.imgur.com/UulUyD4.png)
* Red = An example of a bad location to place the new dispatch alert because that event is coming from the server-side to the client-side, and all police officers will be receiving the same event, so it will result in spam duplicate notifications. A good indication of a bad location is when you see blips being created, and it does not trigger a server event.
* Green = An example of a good location to place the new dispatch alert because there are no blips being created, and it triggers a server event.
**Summary**
* To summarise the above, find the part of the code where a player starts a robbery, place the new dispatch alert code snippet there, and cd\_dispatch will handle the rest.
:::
#### A detailed guide for all variables used in the dispatch "code snippet".
| Variable Name | Description |
|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **job\_table** | Everyone who has this job will receive this dispatch alert. You can add multiple jobs to the table. |
| **coords** | These are the coordinates of the dispatch alert. |
| **title** | Usually, police 10 codes are used here in the title. |
| **message** | You can customise the message and add any available variables - [More Info](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-the-data-the-client-side-export-returns.). |
| **flash** | To make this dispatch alert flash red and blue on the small and large UI. Used for high-priority calls such as panic buttons etc.**1** = enable UI flash.**0** = disable UI flash. |
| **unique\_id** | DON'T change this. |
| **blip** | This sub-table allows you to customise the blip on the pause menu map/mini-map.If you don't want to have a blip, just delete the whole blip sub-table. Everything referred to as the blip below is related to the pause menu map/mini-map blips. |
| **blip.sprite** | The icon for the blip - [More icons can be found here](https://docs.fivem.net/docs/game-references/blips/). |
| **blip.scale** | The size of the blip: **0.1-2.0**. |
| **blip.colour** | The colour of the blip - [More colours can be found here at the bottom](https://docs.fivem.net/docs/game-references/blips/). |
| **blip.flashes** | To make this dispatch alerts blip flash. Used for high-priority calls such as panic buttons etc.**true** = enable blip flash.**false** = disable blip flash. |
| **blip.time** | (in minutes) The amount of time until the blip gradually fades and deletes. |
| **blip.sound** | The sound when receiving a new dispatch alert. You can change or add more sounds in the BlipSound() function in the configs/client\_customise\_me.lua.**1** = x1 sound alert.**2** = x2 sound alerts.**3** = panic button alert sound. |
| **blip.radius** | This will take the coordinates, randomize them, and add an area blip. The exact location will always be somewhere in the radius blip**0** = disable radius blip.**50-100** = is a good size, but you can go higher. |
#### A detailed guide for all the data the client-side export returns.
> The export used in the code snippet above will return this table. This can be customised in the `[client/main/functions.lua]` file.
::::tabs
\=== Is the player on foot?
```lua
local data = exports['cd_dispatch']:GetPlayerInfo()
data.ped --The player's id: eg., 123456789.
data.coords --The players coordinates: eg., vector3(1.0, 2.0, 3.0).
data.street_1 --The street name: eg., Palomino Ave.
data.street_2 --The streets area name: eg., Legion Square.
data.street --Both the street name & area name: eg., Palomino Ave, Legion Square.
data.sex --The players ped's sex; eg., Male.
```
\=== Is the player in a vehicle?
```lua
local data = exports['cd_dispatch']:GetPlayerInfo()
data.ped --The player's id: eg., 123456789.
data.coords --The players coordinates: eg., vector3(1.0, 2.0, 3.0).
data.street_1 --The street name: eg., Palomino Ave.
data.street_2 --The streets area name: eg., Legion Square.
data.street --Both the street name & area name: eg., Palomino Ave, Legion Square.
data.sex --The players ped's sex; eg., Male.
data.vehicle --The vehicle id: eg., 123456789.
data.vehicle_label --The vehicle name: eg., Audi RS7.
data.vehicle_colour --The vehicles colour: eg., Blue.
data.vehicle_plate --The vehicles license plate: eg., ABCD1234.
data.heading --The vehicle's direction: eg., North.
data.speed --The vehicles speed: eg., 70MPH.
```
::::
## 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]`.
### **Large UI Settings**
> **What do the settings do and how does this work?**
>
> This is where each player can customise settings to suit their own individual role-play needs.
**Status**
* The status shows other players what you are doing, such as available, unavailable, processing, training, undercover etc. It‘s displayed on the [Units List](https://imgur.com/a/DU78oGz), and each status displays a different colour. For example., green = available, red = unavailable and blue = training.
**Auto Delete**
* Each notification will auto-delete after x minutes to clear out old notifications.
**Update Callsign**
* This is how you update your callsign.
**Assigned Vehicle**
* This is used to show other players what type of vehicle you are currently using. It's displayed on the [Units List](https://imgur.com/a/m6pf9LD) and the [pause-menu/mini-map blips](https://imgur.com/a/XKITw6x). Players must change this manually, as it won't change automatically.
**Dispatcher Mode**
* This is where you enable dispatcher mode.
### **Radio Channels**
> **How do radio channels work?**
>
> We use radio channels to allow players to see which radio channels other players are on, and also to allow players to quickly join radio channels through the large UI.
>
> You will of course need to be using some sort of voip and radio resource. By default we have added compatibility with tokovoip, mumble and pmavoice.
**Where are the radio channels displayed?**
The radio channels are displayed in 2 places: on the [large UI](https://imgur.com/mv7zpMX) and the [pause-menu/mini-map blips](https://imgur.com/a/RZ3Z4KX).
This event needs to be triggered from your radio resource, specifically when a player (who has access to use the dispatch) joins/leaves/changes a radio channel, and it needs to send the players new radio channel in the first argument.
[**Example 1**](https://imgur.com/6j7wEYM)
[**Example 2**](https://imgur.com/a/0SjuLVZ)
```lua [client-side to server-side]
-- RADIO_CHANNEL_HERE needs to be a string or a number
TriggerServerEvent('cd_dispatch:GetRadioChannel', RADIO_CHANNEL_HERE)
```
### Duty System
> **How does the duty system work?**
>
> QBCore and ESX Legacy 1.6+ use built in duty system's. We use this by default to require players who have the job to be on duty to use the dispatch.
::: info
**Do you use QBCore or ESX Legacy 1.6+?**
Then you don't need to make any changes. We have already implemented this for you.
:::
Using an external duty resource, you can use the events below to tell the dispatch when a player is on or off duty.
::::tabs
\=== client-side to client-side
```lua
-- Boolean means (true or false).
TriggerEvent('cd_dispatch:OnDutyChecks', BOOLEAN)
```
\=== server-side to client-side
```lua
-- Boolean means (true or false).
TriggerClientEvent('cd_dispatch:OnDutyChecks', source, BOOLEAN)
```
::::
### Blips
> **How do the blips work?**
>
> Our built-in player blips feature allows all players of the job(s) you define in the `Config.Allowedjobs` table to see each other on the in-game pause-menu and mini-map.
>
> The blips show much more information than usual blip resources because it gets data from the dispatch UI; such as the players character name, callsign, radio channel and vehicle type. Blips also flash when a vehicles emergency lights are enabled.
## ::: warning Possible Modifications are Required!
If you use another player blips resource, you must disable it to use the built-in player blips feature; otherwise, they will conflict.
**Known player blip conflicts.**
::::tabs
\=== qb-policejob
Comment out this thread in `qb-policejob/server/main.lua/line 1097`.
```lua:line-numbers=1097
CreateThread(function()
while true do
Wait(5000)
UpdateBlips()
end
end)
```
\=== esx\_policejob
Disable this config option in `esx_policejob/config.lua/line 17`.
```lua:line-numbers=17
Config.EnableJobBlip = false
```
::::
### Callsign
> **How do callsigns work?**
>
> Callsigns can only be changed in the settings on the large UI. Open the large UI, click the settings icon at the top of your screen and change your callsign.
### Dispatcher
> **How does the dispatcher system work?**
>
> Our dispatcher system allows dispatcher(s) to recieve calls and assign them to individual players. Only those with the pre-defined job(s) and job grade (defined in the `Config.Dispatcher` table) can use this feature. While a player has dispatcher mode enabled, non-dispatchers will not recieve calls until a dispatcher assigns them one.
**How to enable dispatcher mode?**
* Open the large UI, click the settings icon at the top of your screen and click Toggle dispatcher mode. You don't have the required job or grade if this option is not clickable.
**How to assign a unit/group to a call?**
* You must drag a unit/group from the Unit List (on the right side of your screen) onto a call in the Notification List (on the left side of your screen). You will see the unit(s) added to the Units Responding on the call if assigned successfully. You must drag the unit/group from the drag icon (8 dots).
**How To assign all units to a call?**
* While the large UI is open, right-click on a call in the Notification List (on the left side of your screen), and click Assign every unit to call.
**How to speak on the radio while in the large UI?**
* While the large UI is open, click the Toggle Voice ON button (at the bottom right corner of your screen). When enabled, this button will change colour to white. To talk on the radio, press your radio's push-to-talk key.
**How to join/leave radio channels while in the large UI?**
* While the large UI is open, right-click on a unit in the Unit List (on the top right side of your screen) and click Join radio channel. Do the same thing to leave a radio channel but click Leave radio channel.
### Job Call Commands
> **How does the job call commands work?**
>
> When a civilian uses any of the job call commands such as `/911`, a notification will be sent to the police. You can configure multiple jobs to use this system. After receiving a job call, players in said job can respond to the civilian using the `/reply` chat command. Calls can also be anonymous if the `anonymous` option is set to true (does not show the caller's name or phone number and uses radius blips).
### Police Alerts
> **How does the police alerts work?**
>
> This dispatch includes 3 basic built-in police alerts: stolen car, gunshots and speed cameras.
## ::: info Whitelisted Jobs
Please note that when testing this, if your job is in the `whitelisted_jobs` table, you won't be able to trigger events.
:::
**Stolen Car Alerts**
* This alert is specifically for when a civilian tries to enter a locked vehicle or drags a ped out of their vehicle and steals it. If you use cd\_radar, bolos will be automatically added for the stolen vehicles.
**Gunshot Alerts**
* Weapons with silencers on won't trigger an alert. If you use cd\_radar, bolos will be automatically added for vehicle gunshots.
**Speed Camera Alerts**
* Some speed cameras are already pre-configured. When a vehicle speeds through one of these speed camera areas, an alert will be sent to the police. You can also optionally send the player a fine automatically. If you use cd\_radar, bolos will be automatically added for speeding vehicles.
## Information
### Default Keybinds
These keys can be modified and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section of the `[configs/config.lua]`.
Please make sure you understand how [Key Mapping](https://docs.codesign.pro/coding-information/register-key-mapping) works.
| Key | Description |
|-----------------------|-----------------------------------------------------------------------|
| **Key** | **Description** |
| **U** | Toggles the small dispatch UI. |
| **G** | Respond to a notification. |
| **Left/Right Arrows** | Scroll through the notifications on the small dispatch UI. |
| **L** | Opens the large dispatch UI. |
| **Up Arrow** | Ping your location to other players who have access to your dispatch. |
| **Down Arrow** | Press your panic button. |
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| | |
|--------------------|-----------------------------------------------------------------------------|
| **Command** | **Description** |
| **/dispatchsmall** | Toggles the small dispatch UI. |
| **/dispatchlarge** | Opens the large dispatch UI. |
| **/respond** | Respond to a notification. |
| **/movemode** | Allows you to move the small UI on your screen. |
| **/panic** | Press your panic button. |
| **/reply** | Reply to job calls such as /911 calls etc. |
| **/dispatchtest** | (Test Command) This is a test command which triggers a police notification. |
| **/dispatchping** | Ping your location to other players who have access to your dispatch. |
### Events
These events are completely optional; you can use them if needed.
**Panic Button**
```lua [client-side to client-side]
-- Activates the panic button.
TriggerEvent('cd_dispatch:PanicButtonEvent')
```
### Exports
These exports are completely optional; you can use them if needed.
::::tabs
\=== client-side exports
**Get Player Info**
Returns useful information about a player which can be used for creating new dispatch notifications, as seen in step 5. (returns a table).
```lua
exports['cd_dispatch']:GetPlayerInfo()
```
**Get Player Notifications**
Returns all of a player's active dispatch notifications. (returns a table).
```lua
exports['cd_dispatch']:GetPlayerNotifications()
```
**Get Players Dispatch Data**
Returns a player's dispatch character data, eg., callsign, character name, status etc. (returns a table).
```lua
exports['cd_dispatch']:GetPlayersDispatchData()
```
**Get Config**
Returns the dispatch's full config.lua. (returns a table).
```lua
exports['cd_dispatch']:GetConfig()
```
\=== server-side exports
**Get Players Dispatch Data**
Returns a player's dispatch character data, eg., callsign, character name, status etc. (returns a table)
```lua
exports['cd_dispatch']:GetPlayersDispatchData(source)
```
**Get Config**
Returns the dispatch's full config.lua. (returns a table).
```lua
exports['cd_dispatch']:GetConfig()
```
::::
## COMMON ISSUES
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder is `cd_dispatch`.
**Encrypted Files** Do not edit the encrypted files in any way.
> **SQL Default Value Error?**
>
> eg., if you see an error similar to this example when inserting an SQL query into your database - `BLOB/TEXT column 'callsign' can't have a default value`.
>
> ```
> You can use VARCHAR(256) instead of LONGTEXT in the SQL query.
> ```
> **SQL Unknown Column Error?**
>
> eg., if you see an SQL error in the server console similar to this example - `ER_BAD_FIELD_ERROR: Unknown colum 'callsign' 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.
> ```
> **Script Loading?**
>
> eg., if you see this notification at least 10-20 seconds after loading in or restarting the script - The resource is still loading. Please try again in a few seconds.
>
> ```
> There will usually be a server side error which will be pretty self explanatory, usually a database error or because your Config.FrameworkTriggers were not configured correctly.
> ```
> **NUI "drawImage" error?**
>
> eg., if you see an error similar to [this](https://imgur.com/a/TTKcNvQ) in the client-side F8 console.
>
> ```
> This means you have chosen a blip colour that is not supported by default in: Config.lua/Config.BlipData/largeui_blip_colour. To fix this change it to one of the supported colours.
> ```
> **Players are not receiving calls?**
>
> eg., if all of a sudden players are not longer receiving dispatch calls.
>
> ```
> This most likely means 1 or more players have enabled dispatcher mode, so only the dispatchers are receiving new calls. Please read more about how our dispatcher system works here.
> ```
**Attempt to index a nil value (global 'lib')**
eg., this server or client error will happen when the script is trying to send a ox\_lib notification.
```
This is because our auto detect feature has detected ox_lib as the notification resource your server is using, but you must first uncomment the ox_lib line in the fxmanifest. Complete Step 1.
```
**Using lb-tablet and getting error code 3777**
eg., you use lb-tablet and keep getting client-side error code 3777.
```
This is because they try to modify our GetPlayerInfo export which breaks it. In lb-tablet/client/custom/functions/dispatchCompatibility.lua - remove this function AddCompatibilityExport("cd_dispatch", "GetPlayerInfo", function().
```
## ERROR CODES
If you see an error code not listed below, please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).
::::tabs
\=== Server
N/A
===
\=== Client
**3777** - You need to update to at least v4.2.2+ to use the new format from [#Step 5](./#step-5-integrate-into-your-resources) using the unique\_id variable.
# **3651** - This error code can be ignored; it does not affect anything; it's just trying to delete a notification that has just been deleted.
::::
## CHANGELOG
> **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_dispatch` folder, download and add in the latest version, reconfigure the configs folder and restart your server.
* **All Files Except config.lua -** This means you should do all of the above (in the All Files section) but additionally **make a backup of the `config.lua`** file and replace the new config.lua file with the one you made a backup of.
* **Specific Files -** This means you can copy and paste the **SPECIFIC** new files over the old ones and restart the server.
::: warning
**Skipping Updates**
If you are attempting to update to the latest version but have skipped previous updates, you should update all files just to be safe. For example., let's say you are currently on v4.0.1, you did not update when v4.0.2 was released, and now v4.0.3 is released, and you want to update; you should always use the All Files update method.
:::
::::tabs
\=== v4.3.12
### 21/4/2026
**Files Changed:**
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```
fxmanifest.lua
server/main/anti_cheat.lua
configs/client_customise_me.luia
```
**Changelog:**
::: warning
**Fixes**
* Fixed an issue with built-in police alerts not working correctly, where the anti-cheat was triggered if jobs in `Config.PoliceAlerts.police_jobs` were not defined in `Config.AllowedJobs`, causing legitimate alerts to be blocked.
* Fixed an issue where the anti-cheat was not banning players correctly (it was accidentally disabled during testing).
:::
\===
\=== v4.3.11
### 18/3/2026
**Files Changed:**
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```
fxmanifest.lua
server/main/anti_cheat.lua
server/main/server.lua
```
**Changelog:**
::: info
**Changes**
* Further improvments to anti cheat.
:::
\===
\=== v4.3.10
### 16/3/2026
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Changelog:**
::: warning
**Fixes**
* Further explot protection
* Auto ban modders on QBCore and Qbox.
:::
\===
\=== v4.3.9
### 12/3/2026
**Files Changed:**
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
````lua
fxmanifest.lua
server/main/server.lua
server/other/chat_commands.lua
**configs/config.lua (added more banned words to config)
****banned_words = {'discord','fuck','fucker','fucking','shit','shitty','bullshit','cunt','bitch','bastard','asshole','arsehole','motherfucker','whore','slut','hoe','skank','retard','prick','twat','wanker','dipshit','shithead','fuckhead','asshat','fuk','fck','fuq','sh1t','b1tch','c*nt','f*ck','biatch','azzhole','a$$hole' } --A table of banned words.
**```
**Changelog:**
::: warning
**Fixes**
* Further explot protection.
:::
===
::::
[^1]: [https://docs.codesign.pro/paid-scripts/dispatch#dispatcher](https://docs.codesign.pro/paid-scripts/dispatch#dispatcher)
[^2]: [https://docs.codesign.pro/paid-scripts/dispatch#step-1-fxmanifest](https://docs.codesign.pro/paid-scripts/dispatch#step-2-fxmanifest)
````
---
---
url: /paid-scripts/dispatch/configs-locales-and-sql.md
description: >-
Configuration, locales, and SQL setup for cd_dispatch. Includes framework
auto-detect, allowed jobs, blip settings, dispatcher system, panic button, and
job call commands.
---
# Configs, Locales & SQL
::::tabs
\=== Config
```lua
Config = {}
function L(cd, ...) if Locales[Config.Language][cd] then return string.format(Locales[Config.Language][cd], ...) else print('Locale is nil ('..cd..')') end end
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
--WHAT DOES 'auto_detect' DO?
--The 'auto_detect' feature automatically identifies your framework and SQL database resource, and applies the appropriate default settings.
Config.Framework = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', only ESX and QBCore frameworks will be detected. Use 'other' for custom frameworks.
Config.Database = 'auto_detect' --[ 'auto_detect' ] If you select 'auto_detect', only MySQL, GHMattimysql, and Oxmysql SQL database resources will be detected.
Config.AutoInsertSQL = true --Would you like the script to insert the necessary SQL tables into your database automatically? If you have already done this, please set it to false.
Config.Notification = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', only ESX, QBCore, cd_notifications, okokNotify, ps-ui and ox_lib notifications will be detected. Use 'other' for custom notification resources.
Config.Language = 'EN' --[ 'EN' / 'DK' / 'FR' / 'NL' ] You can add your own locales to Locales.lua, but be sure to update the Config.Language to match it.
Config.FrameworkTriggers = {
esx = { --If you have modified the default event names in the es_extended resource, change them here.
resource_name = 'es_extended',
main = 'esx:getSharedObject',
load = 'esx:playerLoaded',
job = 'esx:setJob'
},
qbcore = { --If you have modified the default event names in the qb-core resource, change them here.
resource_name = 'qb-core',
main = 'QBCore:GetObject',
load = 'QBCore:Client:OnPlayerLoaded',
job = 'QBCore:Client:OnJobUpdate',
duty = 'QBCore:Client:SetDuty'
}
}
--██╗███╗ ███╗██████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗████████╗
--██║████╗ ████║██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝
--██║██╔████╔██║██████╔╝██║ ██║██████╔╝ ██║ ███████║██╔██╗ ██║ ██║
--██║██║╚██╔╝██║██╔═══╝ ██║ ██║██╔══██╗ ██║ ██╔══██║██║╚██╗██║ ██║
--██║██║ ╚═╝ ██║██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║██║ ╚████║ ██║
--╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
Config.UsingOneSync = true --Do you use OneSync legacy or infinity?
Config.UseFrameworkDutySystem = true --Do you want to use your frameworks (esx/qbcore) built-in duty system?
Config.Debug = false --To enable debug prints.
Config.EnableTestCommand = false --The test command is 'dispatchtest'.
--███╗ ███╗ █████╗ ██╗███╗ ██╗
--████╗ ████║██╔══██╗██║████╗ ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
--╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
Config.NotifyStatusChange = true --Do you want to notify player's when a player changes their status? (eg., Available, Unavailable, Processing, etc.)
Config.AllowedJobs = { --A list of jobs who are allowed to use this dispatch.
--This will group different jobs together. Eg., so 2 jobs {'police', 'sheriff'} can both see can see each other on the dispatch UI and the pause menu/mini-map blips.
[1] = {'police', 'ambulance' }, --police & ambulance group
[2] = {'mechanic', }, --mechanic group
-- [3] = {'1st_job', '2nd_job'}, --An example of 2 grouped jobs.
}
Config.UpdateDistanceUI = { --Do you want the distance (how far the player is from the call) to be constantly updated on the dispatch UI?
ENABLE = true,
timer = 3 --(in seconds) How often the distance should be updated.
}
--██████╗ ██╗ ██╗██████╗ ███████╗ █████╗ ███╗ ██╗██████╗ ██████╗ █████╗ ██╗ ██╗ ███████╗██╗ ██████╗ ███╗ ██╗
--██╔══██╗██║ ██║██╔══██╗██╔════╝ ██╔══██╗████╗ ██║██╔══██╗ ██╔════╝██╔══██╗██║ ██║ ██╔════╝██║██╔════╝ ████╗ ██║
--██████╔╝██║ ██║██████╔╝███████╗ ███████║██╔██╗ ██║██║ ██║ ██║ ███████║██║ ██║ ███████╗██║██║ ███╗██╔██╗ ██║
--██╔══██╗██║ ██║██╔═══╝ ╚════██║ ██╔══██║██║╚██╗██║██║ ██║ ██║ ██╔══██║██║ ██║ ╚════██║██║██║ ██║██║╚██╗██║
--██████╔╝███████╗██║██║ ███████║ ██║ ██║██║ ╚████║██████╔╝ ╚██████╗██║ ██║███████╗███████╗███████║██║╚██████╔╝██║ ╚████║
--╚═════╝ ╚══════╝╚═╝╚═╝ ╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝
Config.PauseMenuBlips = {
ENABLE = true, --Do you want to use the built in player blips (on the pause menu & mini-map)?
data_update_timer = 1, --(in seconds) How many seconds should the blip data from the server side be sent to the client side to be updated?
blip_type = 'auto', --You can choose 3 different methods for displaying the player blips.
--'static' = Players will all have the same standard player blip.
--'dynamic'] = Players can change their player blip on the dispatch UI's settings page (assigned vehicle).
--'auto' = Blips will change automatically depending on the vehicle type. (CAN CAUSE HIGH RESOURCE USAGE!).
flashing_blips = true, --Do you want blips to flash when a player's vehicle has it's emergancy lights enabled?
bundle_blips = false, --Do you want to bundle the blips together so they do not spam the pause menu legend?
radiochannel_on_blips = true, --Do you want a players radio chanel to be displayed on blips?
minimize_longdistance_blips = true, --Do you want long distance blips to be minimized(smaller size) on the mini-map instead of them being hidden?
blip_sprites = { --These are the blip sprites (icons). More blips can be found here - https://docs.fivem.net/docs/game-references/blips.
['static'] = 1,
['foot'] = 1,
['car'] = 56,
['motorcycle'] = 226,
['helicopter'] = 43,
['boat'] = 427,
},
}
Config.BlipData = { --You need to add all the jobs that will be able to use the dispatch to the table below so you can choose their blip colour.
--largeui_blip_colour: The colour of the player blips on the mini-map and pause menu.The only colours available by default are blue/orange/yellow/red. More can be added in the html.
--pausemenu_blip_colour: The colour of the player blips on dispatch UI map. The 1st one is the default colour and the 2nd one is the flashing colour. More blip colours can be found here - https://docs.fivem.net/docs/game-references/blips.
['police'] = {largeui_blip_colour = 'blue', pausemenu_blip_colour = {3, 1}},
['ambulance'] = {largeui_blip_colour = 'red', pausemenu_blip_colour = {1, 0}},
['mechanic'] = {largeui_blip_colour = 'orange', pausemenu_blip_colour = {17, 0}},
--['CHANGE_ME'] = {largeui_blip_colour = 'blue', pausemenu_blip_colour = {3, 1}},
}
--██████╗ ██╗███████╗██████╗ █████╗ ████████╗ ██████╗██╗ ██╗███████╗██████╗
--██╔══██╗██║██╔════╝██╔══██╗██╔══██╗╚══██╔══╝██╔════╝██║ ██║██╔════╝██╔══██╗
--██║ ██║██║███████╗██████╔╝███████║ ██║ ██║ ███████║█████╗ ██████╔╝
--██║ ██║██║╚════██║██╔═══╝ ██╔══██║ ██║ ██║ ██╔══██║██╔══╝ ██╔══██╗
--██████╔╝██║███████║██║ ██║ ██║ ██║ ╚██████╗██║ ██║███████╗██║ ██║
--╚═════╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
Config.Dispatcher = {
ENABLE = false, --Do you want to use the build in dispatcher system? (this is optional)
notify_activity = true, --Do you want players to be notified when a dispatcher comes online/goes offline?
Perms = { --A list of jobs and the minimum job grade for those who are allowed to use the dispatcher features.
['police'] = 0,
['ambulance'] = 0,
['mechanic'] = 0,
},
AutoRefreshBlips = {
ENABLE = true, --Do you want the player blips on the dispatch UI map to be auto refreshed for the dispatchers?.
refresh_timer = 5, --(in seconds) The amount of time it takes to refresh the player blips (the lower the number the higher the resource usage).
},
VoipResource = 'toko' ---[ 'toko' / 'mumble' / 'pmavoice' / 'other' ] Choose your servers voip resource.
}
-- ██╗ ██████╗ ██████╗ ██████╗ █████╗ ██╗ ██╗ ██████╗ ██████╗ ███╗ ███╗███╗ ███╗ █████╗ ███╗ ██╗██████╗ ███████╗
-- ██║██╔═══██╗██╔══██╗ ██╔════╝██╔══██╗██║ ██║ ██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗ ██║██╔══██╗██╔════╝
-- ██║██║ ██║██████╔╝ ██║ ███████║██║ ██║ ██║ ██║ ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║ ██║███████╗
--██ ██║██║ ██║██╔══██╗ ██║ ██╔══██║██║ ██║ ██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║ ██║╚════██║
--╚█████╔╝╚██████╔╝██████╔╝ ╚██████╗██║ ██║███████╗███████╗ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║██║ ╚████║██████╔╝███████║
-- ╚════╝ ╚═════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝
Config.JobCallCommands = {
ENABLE = true,--Do you want to use the job chat commands eg., /911 to send a notification to the police.
--label: The job display label.
--command: The chat command.
--anonymous: Do you want this call to be anonymous? (does not show the callers name or phone number and uses radius blips).
--job_table: The jobs who can see the calls. (you can add multiple).
Civilian_Commands = {
{ job_label = 'Police', command = '911', anonymous = false, job_table = {'police', } },
{ job_label = 'Police', command = '911a', anonymous = true, job_table = {'police', } },
{ job_label = 'Ambulance', command = '911ems', anonymous = false, job_table = {'ambulance', } },
{ job_label = 'Mechanic', command = 'mechanic', anonymous = false, job_table = {'mechanic', } },
{ job_label = 'Car dealer', command = 'cardealer', anonymous = false, job_table = {'cardealer', } },
{ job_label = 'Real estate', command = 'realestate', anonymous = false, job_table = {'realestate', } },
{ job_label = 'Taxi', command = 'taxi', anonymous = false, job_table = {'taxi', } },
--{ job_label = 'CHANGE_ME', command = 'CHANGE_ME', anonymous = false, job_table = {'CHANGE_ME', 'CHANGE_ME'} },
},
JobReply_Command = 'reply' --The chat command for the jobs above^ to reply to incomming calls.
}
--██████╗ █████╗ ███╗ ██╗██╗ ██████╗ ██████╗ ██╗ ██╗████████╗████████╗ ██████╗ ███╗ ██╗
--██╔══██╗██╔══██╗████╗ ██║██║██╔════╝ ██╔══██╗██║ ██║╚══██╔══╝╚══██╔══╝██╔═══██╗████╗ ██║
--██████╔╝███████║██╔██╗ ██║██║██║ ██████╔╝██║ ██║ ██║ ██║ ██║ ██║██╔██╗ ██║
--██╔═══╝ ██╔══██║██║╚██╗██║██║██║ ██╔══██╗██║ ██║ ██║ ██║ ██║ ██║██║╚██╗██║
--██║ ██║ ██║██║ ╚████║██║╚██████╗ ██████╔╝╚██████╔╝ ██║ ██║ ╚██████╔╝██║ ╚████║
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
Config.PanicButton = {
ENABLE = true, --Do you want to allow dispatch users to use the built-in panic button?
command = 'panic', --The chat command.
key = 'down', --The key press. You can choose other keys here - https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/.
job_table = {'police', 'ambulance', }, --A list of jobs who can use the panic button. (every job in this list will be notified if a panic button is pressed).
cooldown = 10, --(in seconds) This cooldown is to prevent a player spamming the panic button.
play_sound_in_distance = true --Do you want the panic button sound to play to all nearby players?
}
--██████╗ ██╗███╗ ██╗ ██████╗
--██╔══██╗██║████╗ ██║██╔════╝
--██████╔╝██║██╔██╗ ██║██║ ███╗
--██╔═══╝ ██║██║╚██╗██║██║ ██║
--██║ ██║██║ ╚████║╚██████╔╝
--╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝
Config.Ping = {
ENABLE = true, --Do you want to allow players who have access to the dispatch to ping their location to other players of the same job?
command = 'dispatchping', --The chat command.
key = 'up', --The key press. You can choose other keys here - https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/.
cooldown = 10, --(in seconds) This cooldown is to prevent a player spamming pings.
}
--██████╗ ██████╗ ██╗ ██╗ ██████╗███████╗ █████╗ ██╗ ███████╗██████╗ ████████╗███████╗
--██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔════╝ ██╔══██╗██║ ██╔════╝██╔══██╗╚══██╔══╝██╔════╝
--██████╔╝██║ ██║██║ ██║██║ █████╗ ███████║██║ █████╗ ██████╔╝ ██║ ███████╗
--██╔═══╝ ██║ ██║██║ ██║██║ ██╔══╝ ██╔══██║██║ ██╔══╝ ██╔══██╗ ██║ ╚════██║
--██║ ╚██████╔╝███████╗██║╚██████╗███████╗ ██║ ██║███████╗███████╗██║ ██║ ██║ ███████║
--╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝╚══════╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝
Config.PoliceAlerts = {
ENABLE = true, --Do you want to use the built in police alerts?
police_jobs = {'police', }, --The jobs who will be notified from these police alerts.
whitelisted_jobs = {'police', 'ambulance', }, --These jobs will NOT trigger these police alerts.
cooldown = 30, --(in seconds) This cooldown is to prevent alerts from being spammed by the same player.
add_bolos = true, --(requires cd_radar) Do you want to add a bolo for the vehicle that was used in the crime?
require_witness_peds = {
ENABLE = false, --Do you want police alerts only to be sent if a witness (npc ped) is in the area?
distance = 100, --The distance to check for witnesses.
},
--[[GUNSHOTS CONFIG]]--
GunShots = {
ENABLE = true, ---Do you want gunshots to alert police?
WhitelistedZones = { --Shooting in whitelisted areas doesn't alert police.
[1] = {coords = vector3(13.98, -1098.05, 29.8), distance = 20}, --Legion gunrange.
[2] = {coords = vector3(821.09, -2163.46, 78.67), distance = 20}, --Cypress Flats gunrange.
--[3] = {coords = vector3(0, 0, 0), distance = 10},
},
WhitelistedWeapons = { --Shooting whitelisted weapons doesn't alert police.
[`WEAPON_FLARE`] = true,
[`WEAPON_FLAREGUN`] = true,
[`WEAPON_FIREEXTINGUISHER`] = true,
[`WEAPON_PETROLCAN`] = true,
[`WEAPON_STUNGUN`] = true,
--[`ADD_MORE_HERE`] = true,
},
WeaponLabels = {
[`WEAPON_ASSAULTRIFLE`] = 'AK-47',
[`WEAPON_BULLPUPRIFLE`] = 'Bullpup Rifle',
[`WEAPON_COMBATPISTOL`] = 'Combat Pistol',
[`WEAPON_CARBINERIFLE`] = 'Carbine Rifle',
[`WEAPON_CARBINERIFLE_MK2`] = 'Carbine Rifle mk2',
[`WEAPON_HEAVYPISTOL`] = 'Heavy Pistol',
[`WEAPON_MICROSMG`] = 'Mini Uzi',
[`WEAPON_MUSKET`] = 'Musket Rifle',
[`WEAPON_PISTOL`] = 'Pistol',
[`WEAPON_PISTOL_MK2`] = 'Pistol MK2',
[`WEAPON_PISTOL50`] = '50cal Pistol',
[`WEAPON_PUMPSHOTGUN`] = 'Pump Shotgun',
[`WEAPON_REVOLVER`] = 'Revolver',
[`WEAPON_SNSPISTOL`] = 'SNS Pistol',
[`WEAPON_SMG`] = 'SMG',
[`WEAPON_SPECIALCARBINE`] = 'Special Carbine',
[`WEAPON_SAWNOFFSHOTGUN`] = 'Sawnoff Shotgun',
--[`ADD_MORE_HERE`] = 'CHANGE_ME',
},
},
--[[SPEEDTRAP CONFIG]]--
SpeedTrap = {
ENABLE = true, ----Do you want speeding vehicles to alert police?
check_owner_for_fine = true, --Do you want players to only be fined in vehicles they own? (if enabled, players in stolen cars will not be fined).
Blip = {
ENABLE = true, --Do you want speed traps to display on a players minimap?
sprite = 184, --Icon of the blip.
scale = 0.7, --Size of the blip.
colour = 0, --Colour of the blip.
display = 5, --Set to [4] to display on the pause menu map or [5] to only display on the mini-map.
name = L('speedtrap_blip_name') --You dont need to change this.
},
Locations = {
--coords: The location of the speed trap.
--distance: The distance a player must be from the 'coords^' to alert the speed trap.
--speed_limit: The minimum speed to alert the speed trap (in MPH).
--fine_amount: The amount the player will be fined (set to 0 to not fine a player).
[1] = {coords = vector3(1051.42, 331.11, 84.00), distance = 9, speed_limit = 150, fine_amount = 500 }, --LS Freeway.
[2] = {coords = vector3(544.43, -373.24, 33.14), distance = 9, speed_limit = 150, fine_amount = 5000 }, --Into Legion.
[3] = {coords = vector3(-2612.10, 2940.81, 16.67), distance = 15, speed_limit = 150, fine_amount = 1000 }, --Zancuda.
[4] = {coords = vector3(287.94, -517.44, 42.89), distance = 15, speed_limit = 100, fine_amount = 500 }, --Pillbox.
[5] = {coords = vector3(2792.73, 4407.68, 48.44), distance = 24, speed_limit = 150, fine_amount = 1000 }, --Sandy Freeway.
[6] = {coords = vector3(577.11, -1028.32, 37.07), distance = 15, speed_limit = 100, fine_amount = 1000 }, --Mission Row.
[7] = {coords = vector3(114.83, -797.89, 30.97), distance = 15, speed_limit = 100, fine_amount = 2000 }, --Legion Square.
[8] = {coords = vector3(74.33, -163.30, 54.67), distance = 15, speed_limit = 100, fine_amount = 4000 }, --Pink Cage.
[9] = {coords = vector3(28.19, -971.05, 28.96), distance = 15, speed_limit = 100, fine_amount = 1000 }, --PDM.
--[10] = {coords = vector3(0, 0, 0), distance = 15, speed_limit = 50, fine_amount = 1000 },
}
},
}
--██╗ ██╗███████╗██╗ ██╗███████╗ █████╗ ███╗ ██╗██████╗ ██████╗ ██████╗ ███╗ ███╗███╗ ███╗ █████╗ ███╗ ██╗██████╗ ███████╗
--██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ██╔══██╗████╗ ██║██╔══██╗ ██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗ ██║██╔══██╗██╔════╝
--█████╔╝ █████╗ ╚████╔╝ ███████╗ ███████║██╔██╗ ██║██║ ██║ ██║ ██║ ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║ ██║███████╗
--██╔═██╗ ██╔══╝ ╚██╔╝ ╚════██║ ██╔══██║██║╚██╗██║██║ ██║ ██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║ ██║╚════██║
--██║ ██╗███████╗ ██║ ███████║ ██║ ██║██║ ╚████║██████╔╝ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║██║ ╚████║██████╔╝███████║
--╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝
Config.small_ui = {
ENABLE = true, --Do you want to enable the small UI?
command = 'dispatchsmall', --The chat command.
key = 'u' --The key press. You can choose other keys here - https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/.
}
Config.large_ui = {
ENABLE = true, --Do you want to enable the large map UI?
command = 'dispatchlarge',
key = 'l'
}
Config.respond = {
ENABLE = true, --Do you want to enable the units responding feature?
command = 'respond',
key = 'g'
}
Config.move_mode = {
ENABLE = true, --Do you want to enable the move mode feature?
command = 'movemode'
}
Config.small_ui_left = {
ENABLE = true, --Do you want to enable the small UI left scroll?
command = 'scrollleft',
key = 'left'
}
Config.small_ui_right = {
ENABLE = true, --Do you want to enable the small UI right scroll?
command = 'scrollright',
key = 'right'
}
-- ██████╗ ████████╗██╗ ██╗███████╗██████╗
--██╔═══██╗╚══██╔══╝██║ ██║██╔════╝██╔══██╗
--██║ ██║ ██║ ███████║█████╗ ██████╔╝
--██║ ██║ ██║ ██╔══██║██╔══╝ ██╔══██╗
--╚██████╔╝ ██║ ██║ ██║███████╗██║ ██║
-- ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
function Round(cd) return math.floor(cd+0.5) end
function Trim(cd) return cd:gsub('%s+', '') end
function CheckMultiJobs(job)
for cd = 1, #Config.AllowedJobs do
for c, d in pairs(Config.AllowedJobs[cd]) do
if d == job then
return Config.AllowedJobs[cd]
end
end
end
return false
end
function GetConfig()
return Config
end
-- █████╗ ██╗ ██╗████████╗ ██████╗ ██████╗ ███████╗████████╗███████╗ ██████╗████████╗
--██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
--███████║██║ ██║ ██║ ██║ ██║ ██║ ██║█████╗ ██║ █████╗ ██║ ██║
--██╔══██║██║ ██║ ██║ ██║ ██║ ██║ ██║██╔══╝ ██║ ██╔══╝ ██║ ██║
--██║ ██║╚██████╔╝ ██║ ╚██████╔╝ ██████╔╝███████╗ ██║ ███████╗╚██████╗ ██║
--╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝
-----DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
if Config.Framework == 'auto_detect' then
if GetResourceState(Config.FrameworkTriggers.esx.resource_name) == 'started' then
Config.Framework = 'esx'
elseif GetResourceState(Config.FrameworkTriggers.qbcore.resource_name) == 'started' then
Config.Framework = 'qbcore'
end
if Config.Framework == 'esx' or Config.Framework == 'qbcore' then
for c, d in pairs(Config.FrameworkTriggers[Config.Framework]) do
Config.FrameworkTriggers[c] = d
end
Config.FrameworkTriggers.esx, Config.FrameworkTriggers.qbcore = nil, nil
end
end
if Config.Database == 'auto_detect' then
if GetResourceState('mysql-async') == 'started' then
Config.Database = 'mysql'
elseif GetResourceState('ghmattimysql') == 'started' then
Config.Database = 'ghmattimysql'
elseif GetResourceState('oxmysql') == 'started' then
Config.Database = 'oxmysql'
end
end
if Config.Notification == 'auto_detect' then
if GetResourceState('cd_notifications') == 'started' then
Config.Notification = 'cd_notifications'
elseif GetResourceState('okokNotify') == 'started' then
Config.Notification = 'okokNotify'
elseif GetResourceState('ps-ui') == 'started' then
Config.Notification = 'ps-ui'
elseif GetResourceState('ox_lib') == 'started' then
Config.Notification = 'ox_lib'
else
if Config.Framework == 'esx' or Config.Framework == 'qbcore' then
Config.Notification = Config.Framework
else
Config.Notification = 'chat'
end
end
end
if Config.Framework == 'esx' then
Config.FrameworkSQLtables = {
vehicle_table = 'owned_vehicles',
vehicle_identifier = 'owner',
}
elseif Config.Framework == 'qbcore' then
Config.FrameworkSQLtables = {
vehicle_table = 'player_vehicles',
vehicle_identifier = 'citizenid',
}
end
-----DO NOT TOUCH ANYTHING ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
```
\===
\=== Config UI
```javascript
let autoDeleteInterval = 5; // In minutes
let defaultUnit = "mi"; // "m" for meters, "mi" for miles
```
\===
\=== Locales
===============================================================================
\=== Locales UI
=================================================================================
\=== SQL
Watch this video if you are unsure how to insert an SQL Query into your database.\
[HeidiSQL ](https://youtu.be/s3tqlHV3yb0)/ [PHPMyAdmin](https://youtu.be/NXqmYn7bbMM).
```sql
CREATE TABLE IF NOT EXISTS `cd_dispatch` (
`identifier` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_bin',
`callsign` VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci'
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;
```
\===
::::
---
---
url: /paid-scripts/dispatch/resource-integration.md
description: >-
Guide for replacing default police dispatch alerts with cd_dispatch
notifications in ESX resources, QBCore resources, and paid resources like
Jaksam Robbery Creator and Drugs Creator.
---
# Resource Integration
## ESX Resources
::::tabs
\=== client-side
> The links below will take you to resources from the official ESX GitHub. The highlighted line you will see is the default dispatch alert. All you need to do is replace that line with the code snippet we have provided below. Be sure to customise the [variables ](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)in the event to suit your server's needs.
### Step 1 - Find the default dispatch alert
Click any of the links below and find the highlighted line; this will be the default dispatch alert for that resource - [EXAMPLE](https://i.imgur.com/gmVOi5i.png).
* [esx\_ambulancejob](https://github.com/esx-framework/esx_ambulancejob/blob/ef7fdbb44c466079d553df940db5c9874c7bec08/client/main.lua#L187)
### Step 2 - Replace the default dispatch alert
Find the same line in that resource on your server and replace that line with the code snippet provided below.
```lua
local data = exports['cd_dispatch']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
job_table = {'police', },
coords = data.coords,
title = '10-15 - Store Robbery',
message = 'A '..data.sex..' robbing a store at '..data.street,
flash = 0,
unique_id = data.unique_id,
sound = 1,
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = '911 - Store Robbery',
time = 5,
radius = 0,
}
})
```
![]()
*Before and after example from a random resource.*
### Step 3 - Customise the variables
Be sure to customise the [variables ](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)in the event to suit your server's needs.
::::
## QBCore Resources
::::tabs
\=== client-side
> The links below will take you to resources from the official QBCore GitHub. The highlighted line you will see is the default dispatch alert. All you need to do is replace that line with the code snippet we have provided below. Be sure to customise the [variables ](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)in the event to suit your server's needs.
### Step 1 - Find the default dispatch alert
Click any of the links below and find the highlighted line; this will be the default dispatch alert for that resource - [EXAMPLE](https://i.imgur.com/0qDM9LQ.png).
* [qb-drugs](https://github.com/qbcore-framework/qb-drugs/blob/7568f7eb396254b9132b39674634949660fa030e/client/cornerselling.lua#L30)
* [qb-police (anpr)](https://github.com/qbcore-framework/qb-policejob/blob/c9a2ae70015c6eb3d18d38e46ce085d2b8d89d37/client/anpr.lua#L36)
* [qb-ambulancejob (1)](https://github.com/qbcore-framework/qb-ambulancejob/blob/2ff1e377446d238bd1494e019b03c55ab2f4c964/client/dead.lua#L54)
* [qb-ambulancejob (2)](https://github.com/qbcore-framework/qb-ambulancejob/blob/2ff1e377446d238bd1494e019b03c55ab2f4c964/client/dead.lua#L189)
* [qb-ambulancejob (3)](https://github.com/qbcore-framework/qb-ambulancejob/blob/fc17631680ffe423a0710f76dc19ecb3482c0a51/client/laststand.lua#L70)
* [qb-bakrobbery (fleeca)](https://github.com/qbcore-framework/qb-bankrobbery/blob/ee8f8a1b06dd771bf23b1fcd2d54dab0a07613a5/client/fleeca.lua#L273)
* [qb-bankrobbery (pacific 1)](https://github.com/qbcore-framework/qb-bankrobbery/blob/ee8f8a1b06dd771bf23b1fcd2d54dab0a07613a5/client/pacific.lua#L51)
* [qb-bankrobbery (pacific 2)](https://github.com/qbcore-framework/qb-bankrobbery/blob/ee8f8a1b06dd771bf23b1fcd2d54dab0a07613a5/client/pacific.lua#L93)
* [qb-bankrobbery (paleto)](https://github.com/qbcore-framework/qb-bankrobbery/blob/ee8f8a1b06dd771bf23b1fcd2d54dab0a07613a5/client/paleto.lua#L42)
* [qb-storerobbery (1)](https://github.com/qbcore-framework/qb-storerobbery/blob/d75de7624ff30ccb109dcd2b9c7901e887055b4e/client/main.lua#L90)
* [qb-storerobbery (2)](https://github.com/qbcore-framework/qb-storerobbery/blob/d75de7624ff30ccb109dcd2b9c7901e887055b4e/client/main.lua#L151)
* [qb-storerobbery (3)](https://github.com/qbcore-framework/qb-storerobbery/blob/d75de7624ff30ccb109dcd2b9c7901e887055b4e/client/main.lua#L168)
* [qb-truckrobbery](https://github.com/qbcore-framework/qb-truckrobbery/blob/4c4e2584cf517ec55858d89217877e097be749c6/client/main.lua#L156)
* [qb-jewelery](https://github.com/qbcore-framework/qb-jewelery/blob/b9089a14df852ddaca14773561362f4aa8c77d56/client/main.lua#L80)
* [qb-houserobbery](https://github.com/qbcore-framework/qb-houserobbery/blob/19ba35dac2047d1a6941f82d466033ea5b9891d3/client/main.lua#L90)
### Step 2 - Replace the default dispatch alert
Find the same line in that resource on your server and replace that line with the code snippet provided below.
```lua
local data = exports['cd_dispatch']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
job_table = {'police', },
coords = data.coords,
title = '10-15 - Store Robbery',
message = 'A '..data.sex..' robbing a store at '..data.street,
flash = 0,
unique_id = data.unique_id,
sound = 1,
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = '911 - Store Robbery',
time = 5,
radius = 0,
}
})
```
![]()
*Before and after example from a random resource.*
### Step 3 - Customise the variables
Be sure to customise the [variables ](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)in the event to suit your server's needs.
::::
## Paid Resources
::: info
Our goal is to get as many resources pre-configured to be compatible with our dispatch, or at the very least; we will try to add them here for you to do yourself.
:::
::::tabs
\=== Jaksam Robbery Creator
You can find this event in `[robberies_creator/integrations/sv_integrations.lua]`.
Fully replace the existing event with this new edited one.
```lua
RegisterNetEvent("robberies_creator:alertedPolice", function(coords, message)
TriggerClientEvent('cd_dispatch:AddNotification', -1, {
job_table = {'police', },
coords = coords,
title = '10-15 - Robbery',
message = message,
flash = 0,
unique_id = tostring(math.random(0000000,9999999)),
sound = 1,
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = '911 - Robbery',
time = 5,
radius = 0,
}
})
end)
```
*Be sure to customise the* [*variables* ](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)*in the event to suit your server's needs.*
\=== Jaksam Drugs Creator
You can find this event in `[drugs_creator/integrations/sv_integrations.lua]`.
Fully replace the existing event with this new edited one.
```lua
RegisterNetEvent("drugs_creator:alertedPolice", function(coords, message)
TriggerClientEvent('cd_dispatch:AddNotification', -1, {
job_table = {'police', },
coords = coords,
title = '10-15 - Drugs',
message = message,
flash = 0,
unique_id = tostring(math.random(0000000,9999999)),
sound = 1,
blip = {
sprite = 431,
scale = 1.2,
colour = 3,
flashes = false,
text = '911 - Drugs',
time = 5,
radius = 0,
}
})
end)
```
*Be sure to customise the* [*variables* ](https://docs.codesign.pro/paid-scripts/dispatch#a-detailed-guide-for-all-variables-used-in-the-dispatch-code-snippet-.)*in the event to suit your server's needs.*
::::
---
---
url: /paid-scripts/door-lock/installation-guide.md
description: >-
Step-by-step installation guide for cd_doorlock. Covers cd_bridge dependency,
download from CFX Portal, resource configuration, and key bind setup for FiveM
servers.
---
# Installation Guide
## 1. Codesign Bridge
## ::: info Framework, Database, and Integration Handling
**This resource requires `cd_bridge` to be installed and running before it can function.**
`cd_bridge` is **drag-and-drop** and requires **no configuration or file editing**.
It handles framework connections, database setup, and error handling behind the scenes. When the bridge starts, it automatically detects and initializes all compatible resources — including all Codesign scripts and any Codesign-compatible scripts you have installed.
**For installation instructions, see the** [**👉 full bridge setup guide →**](https://docs.codesign.pro/paid-scripts/bridge/installation-guide)**.**
:::
## 2. Download Resource
#### Download the Resource from FiveM’s Portal
1. [**👉 Download cd\_doorlock →**](https://portal.cfx.re/assets/granted-assets?search=cd_doorlock)
2. Unzip the downloaded file
3. In your server’s `resources` directory, **create a folder named `[codesign]` if it does not already exist**
4. Place **`cd_doorlock`** (and all other Codesign resources) inside the **`[codesign]`** folder
![]()
Example resources folder with a `[codesign]` directory
## 3. Configure Resource
#### Review and Adjust config.lua Options
You must review all configurable options in `[cd_doorlock/configs/config.lua]` and adjust them to suit your server’s needs.
Be sure to read the **commented help text** at the end of each line — it explains the purpose of each configuration option.
![]()
The most important config options are in the **Important** category at the top of `config.lua`.\
All other settings are optional.
![]()
## 4. Configure Key Binds
**Before Starting the Resource**
Before launching this resource on your main or live server, we strongly recommend configuring your **key binds**, as this resource uses [**FiveM’s Key Mapping**](https://docs.codesign.pro/helpful-guides/register-key-mapping) system.
**Where Can I Configure My Key Binds?**
You can configure all key binds directly in `[cd_doorlock/configs/config.lua]`.
**Why Is This Important?**
Once a player joins your server with this resource running, you can no longer force key bind changes through the config file — players must adjust them manually through the **in-game pause menu settings**.\
However, any changes you make will still apply to new players who join afterward.
This system is more **optimized** and gives players the flexibility to customize their key binds for both **keyboard** and **controller** use.\
You can also review the [**Default Keybinds**](../garage/developer-api/keys.md) provided with this resource.
![]()
Keybind settings located in the pause menu
---
---
url: /paid-scripts/door-lock/troubleshooting-guide.md
description: >-
Troubleshooting guide for cd_doorlock with error codes, common issues, door
validation, admin access setup, and ZAP-Hosting JSON file permission fixes.
---
# Troubleshooting Guide
## Error Codes
## ::: info Notice
If you encounter an error code not listed below, please open a support ticket in the [Codesign Discord](https://discord.gg/codesign) for assistance.
:::
### Server
**7854** - You are pressing E to interact with a door, but no doors are nearby. It's possible you are out of range of the door, so get closer.
**3001** - You are pressing E to interact with a door, but no doors have been created/imported yet.
### Client
**4387** - You are pressing E to interact with a door, but your job/identifier does not match the job/identifier required to interact with this door.
**7854** - You are pressing E to interact with a door, but no doors are nearby.
**3001** - You are pressing E to interact with a door, but no doors have been created/imported yet.
**6854** - This usually happens when importing/migrating doors with incompatible coordinates. This door needs to be deleted and re created.
## Common Issues
Please check out our [**Self Debugging Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder is `cd_doorlock`.
**Encrypted Files** Do not edit the encrypted files in any way.
::: details **Can't select a new door to add?**
**Example:** If you try to create a new door, the target eye icon appears but the door does not highlight.
**Reason:** This is common with garage doors or gates. The door is either larger or smaller than the default set `Config.DoorValidationDimensions`.
**Solution:** Edit the **minimum and maximum values** used for door detection.
If you enable `Config.Debug`, the system will display the **actual size of the door** you are looking at in F8. Use these values to correctly adjust the `min` and `max` settings for accurate detection.
![]()
F8 prints with Config.Debug enabled.
A simpler option is to just set all the min to 0.0 and all the max to 20.0. But the target system will think every object is a door while creating new doors.
```lua
Config.DoorValidationDimensions = {
normal = {
max_height = 20.0,
min_height = 0.0,
max_width = 20.0,
min_width = 0.0,
max_depth = 20.0,
min_depth = 0.0,
},
garage = {
max_height = 20.0,
min_height = 0.0,
max_width = 20.0,
min_width = 0.0,
max_depth = 20.0,
min_depth = 0.0,
},
gate = {
max_height = 20.0,
min_height = 0.0,
max_width = 20.0,
min_width = 0.0,
max_depth = 20.0,
min_depth = 0.0,
}
}
```
:::
::: details **All Config.AdminAccess options disabled**
**Example:** By default, all of the admin access options inside `Config.AdminAccess`, such as the Identifiers, AcePerms & Discord are set to **false**.
**Reason:** You need to enable at least 1 of these to allow admins to create new doors.
**Solution:** Enable at least 1 methods in `Config.AdminAccess`.
:::
::: details **On the UI only 2 tab's are showing not 6? (no admin perms)**
**Example:** You are an admin but only the Control and Settings tab are visible on the UI; but it should show all 6 tabs (Create/Edit, Control, Import, Export, Convert & Settings). So you are unable to create new doors or import doors.
**Reason:** This is because you don't have admin permissions set up correctly on your server. There could be multiple reasons for this.
1. The Config.AdminAccess in the config.lua has not been configured correctly for your server.
2. If you use ESX, QBCORE or QBOX your players permissions are set up incorrectly through your framework.
3. If you are using the Standalone framework option, and you have enabled Ace Perms; the ace perms are most likely not set up correctly in your server.cfg. To confirm this is the issue you can change the script to use the "command" ace perm and if the doors work then this is your issue, as the "command" ace perm gives every player access.
4. If you are using the Standalone framework option, and you have enabled Discord Perms; badger discord perms is required and it must be named `[Badger_Discord_API]`.
**Solution:** If you are not able to figure it out from the above options open a ticket on discord.
:::
::: details **New doors don't save (using ZAP-Hosting)?**
**Example:** If you use ZAP-Hosting, and you create new doors but they don't save after a script/server restart.
**Reason:** This is because data is not being written to JSON file's due to permission issues. (Only for people using zap-hosting).
**Solution:**
1. Stop the server.
2. Move the files to your server using filezilla or winscp.
3. Set the permissions for all JSON files to read write and execute for owner, group and user - https://www.pipeten.com/support/scripting/changing-file-permissions-using-filezilla/.
4. Then start the server.
:::
---
---
url: /paid-scripts/door-lock/features.md
description: >-
Features overview for cd_doorlock. Covers door locking, unlocking,
permissions, admin access, lockpicking, and integration with dispatch systems.
---
# Features
---
---
url: /paid-scripts/door-lock/developer-api.md
description: >-
Developer API index for cd_doorlock. Reference for chat commands, events,
exports, keys, and items for integrating the door lock system with other FiveM
scripts.
---
# Developer API
---
---
url: /paid-scripts/door-lock/developer-api/events.md
description: >-
Events reference for cd_doorlock including set door state, lockdown building,
and set door permissions for client and server integration.
---
# Events
## ::: info Notice
These events are entirely optional and can be triggered as needed to integrate cd\_garage with your own scripts or custom systems.
:::
## Client
## ::: tip **Client-Side Events**
* Defined with **`RegisterNetEvent`** **in client files**.
* Triggered using **`TriggerEvent`** (if from client) or **`TriggerClientEvent`** (if from server).
* Run only on **one player's game client** (the player's PC).
:::
### Set Door State (Closest)
Sets the lock state of the closest door. The first argument **state** determines whether the door is locked (`true`) or unlocked (`false`).
```lua [Parameters]
---@param state boolean Determines the door state (true = locked, false = unlocked).
---@example
local state = true
```
```lua [client-side to client-side]
TriggerEvent('cd_doorlock:SetDoorState_closest', state)
```
```lua [server-side to client-side]
TriggerClientEvent('cd_doorlock:SetDoorState_closest', source, state)
```
### Set Door State (By Name)
Sets the lock state of a specific door by name. The first argument **state** determines whether the door becomes locked (`true`) or unlocked (`false`). The second and third arguments specify the door's **name** and **location group**.
```lua [Parameters]
---@param state boolean Determines the door state (true = locked, false = unlocked).
---@param doorName string The unique name of the door.
---@param locationGroup string The building's location group.
---@example
local state = true
local doorName = 'Main Enterance'
local locationGroup = 'MRPD'
```
```lua [client-side to client-sid]
TriggerEvent('cd_doorlock:SetDoorState_name', state, doorName, locationGroup)
```
```lua [server-side to client-side]
TriggerClientEvent('cd_doorlock:SetDoorState_name', source, state, doorName, locationGroup)
```
### Set Door State (By Unique ID)
Sets the lock state of a specific door using its unique ID. The first argument **state** determines whether the door becomes locked (`true`) or unlocked (`false`). The second argument is the door's **unique ID**.
```lua [Parameters]
---@param state boolean Determines the door state (true = locked, false = unlocked).
---@param uniqueID string The unique ID assigned to the door.
---@example
local state = true
local uniqueID = "1234-5678"
```
```lua [client-side to client-side]
TriggerEvent('cd_doorlock:SetDoorState_uniqueid', state, uniqueID)
```
```lua [server-side to client-side]
TriggerClientEvent('cd_doorlock:SetDoorState_uniqueid', source, state, uniqueID)
```
## Server
## ::: tip **Server-Side Events**
* Defined with **`RegisterServerEvent`** and **`AddEventHandler`** **in server files**.
* Triggered using **`TriggerEvent`** (if from server) or **`TriggerServerEvent`** (if from client).
* Run on the **server**, not on any individual player's game client.
:::
### Lockdown Building
The first argument **state** sets the lockdown status (`true` = lock all doors, `false` = unlock all doors).\
The second argument defines the **location group** of the building.\
All players inside the defined building will receive a lockdown notification.
```lua [Parameters]
---@param state boolean Lockdown state (true = lock, false = unlock).
---@param locationGroup string The building's location group.
---@example
local locationGroup = 'MRPD'
local state = true
```
```lua [client-side to server-side]
TriggerServerEvent('cd_doorlock:LockdownBuilding', locationGroup , state)
```
```lua [server-side to server-side]
TriggerEvent('cd_doorlock:SetDoorState_uniqueid', locationGroup , state)
```
### Set Door Permissions (By Unique ID)
Sets the permission data for a specific door using its unique ID.\
You can set **all permission types** or **only specific ones**.\
When setting only certain permissions, leave the others **nil**, and they will simply not have any permissions assigned.\
The second argument **perms** is a table defining who can access the door.
```lua [@parameters]
---@param uniqueId string The door's unique ID.
---@param perms table Permission settings for the door.
---@example
**local uniqueId = 12
**local perms = {
job = {
{name = 'police', grade = 0},
{name = 'ems', grade = 0}
},
identifier = { 'steam:11000010abcd123' },
ace = { 'admin' },
discord = { '123456789012345678' },
items = {
name = 'keycard',
amount = 1,
destroy = false
}
}
--- OR
local perms = {
job = {
{name = 'police', grade = 0},
{name = 'ems', grade = 0}
}
}
```
```lua [client-side to server-side]
TriggerServerEvent('cd_doorlock:SetDoorPerms', uniqueId, perms)
```
```lua [server-side to server-side]
TriggerEvent('cd_doorlock:SetDoorPerms', uniqueId, perms)
```
### Add Door Permissions (By Unique ID)
Adds new permission data to a specific door using its unique ID.\
The **perms** table is merged into the door's existing permissions instead of replacing them.\
You can add **one or many** permission types.\
Any permission type you leave **nil** will simply not be added.
```lua [Parameters]
---@param uniqueId string The door's unique ID.
---@param perms table Permission data to add to the door.
---@example
local uniqueId = 12
local perms = {
identifier = { 'steam:11000010abcd123' },
items = {
name = 'keycard',
amount = 1,
destroy = false
}
}
--- OR
local perms = {
job = {
{name = 'police', grade = 0},
{name = 'ems', grade = 0}
}
}
```
```lua [client-side to server-side]
TriggerServerEvent('cd_doorlock:AddDoorPerms', uniqueId, perms)
```
```lua [server-side to server-side]
TriggerEvent('cd_doorlock:AddDoorPerms', uniqueId, perms)
```
---
---
url: /paid-scripts/door-lock/developer-api/exports.md
description: >-
Exports reference for cd_doorlock including Get all doors, get door unique ID,
get door state, and get door data for client-side integration.
---
# Exports
## ::: info Notice
These exports are entirely optional and can be used as needed within your own scripts or integrations.
:::
## Client
### Get All Doors
Returns a table containing all doors and their associated data.
```lua [Parameters]
--- @return table doors A table of all doors and their full data sets.
--- @example
local doors = exports['cd_doorlock']:GetAllDoors()
print('Total doors:', #doors)
for index, door in pairs(doors) do
print('Name: ', data.door_name)
print('Location Group: ', door.location_group)
print('Unique ID: ', door.unique_id)
end
```
```lua
local doors = exports['cd_doorlock']:GetAllDoors()
```
### Get Door Unique ID
Returns the **unique ID** of a door.\
The first and second arguments define which door to retrieve the unique ID from.\
This unique ID is required for some events and is consistent for the door.
```lua [Parameters]
--- @param doorName string The name of the door.
--- @param locationGroup string The location group the door belongs to.
--- @return string uniqueId The door's unique ID.
--- @example
local doorName = 'Main Entrance'
local locationGroup = 'MRPD'
local uniqueId = exports['cd_doorlock']:GetDoorUniqueID(doorName, locationGroup)
print('Door unique ID:', uniqueId)
```
```lua
local uniqueId = exports['cd_doorlock']:GetDoorUniqueID(doorName, locationGroup)
```
### Get Door State (Closest)
Returns the locked state of the closest door.
```lua [Parameters]
--- @return boolean state The door's state (true = locked, false = unlocked).
--- @example
local state = exports['cd_doorlock']:GetDoorState_closest()
if state then
print('The closest door is locked.')
else
print('The closest door is unlocked.')
end
```
```lua
local state = exports['cd_doorlock']:GetDoorState_closest()
```
### Get Door State (By Name)
Returns the locked state of a specific door.\
The first and second arguments define which door's state you want to check.\
This allows you to retrieve whether a specific named door is locked or unlocked.
```lua [@parameters]
--- @param doorName string The name of the door.
--- @param locationGroup string The location group the door belongs to.
--- @return boolean state The door's state (true = locked, false = unlocked).
--- @example
local doorName = 'Main Entrance'
local locationGroup = 'MRPD'
local state = exports['cd_doorlock']:GetDoorState_name(doorName, locationGroup)
if state then
print('The specified door is locked.')
else
print('The specified door is unlocked.')
end
```
```lua
local state = exports['cd_doorlock']:GetDoorState_name(doorName, locationGroup)
```
### Get Door State (By Unique ID)
Returns the locked state of a specific door.\
The unique ID determines exactly which door's state you want to check.\
This allows you to retrieve whether a specific door is locked or unlocked using its unique identifier.
```lua [Parameters]
--- @param uniqueId string The unique ID of the door.
--- @return boolean state The door's state (true = locked, false = unlocked).
--- @example
local uniqueId = '1234-5678'
local state = exports['cd_doorlock']:GetDoorState_uniqueid(uniqueId)
if state then
print('The door is locked.')
else
print('The door is unlocked.')
end
```
```lua
local state = exports['cd_doorlock']:GetDoorState_closest()
```
### Get Door Data (Closest)
Returns the full cached data of the closest door.\
This function provides all stored information for the nearest door, including its settings, permissions, and configuration data.\
Useful when you need complete door details for logic, debugging, or UI.
```lua [Parameters]
--- @return table doorData The full cached data of the closest door.
--- @example
local data = exports['cd_doorlock']:GetDoorDataFull_closest()
if data then
print('Door Name:', data.door_name)
print('Unique ID:', data.unique_id)
else
print('No door found nearby.')
end
```
```lua
local data = exports['cd_doorlock']:GetDoorDataFull_closest()
```
### Get Door Data (By Name)
Returns the full cached data of a specific door.\
The first and second arguments define which door's data you want to retrieve.\
This allows you to access all stored information for a specific named door, including its settings, permissions, and configuration data.
```lua [Parameters]
--- @param doorName string The name of the door.
--- @param locationGroup string The location group the door belongs to.
--- @return table doorData The full cached data of the specified door.
--- @example
local doorName = 'Main Entrance'
local locationGroup = 'MRPD'
local data = exports['cd_doorlock']:GetDoorDataFull_name(doorName, locationGroup)
if data then
print('Door Name:', data.door_name)
print('Unique ID:', data.unique_id)
else
print('Door not found.')
end
```
```lua
local data = exports['cd_doorlock']:GetDoorDataFull_name(doorName, locationGroup)
```
### Get Door Data (By Unique ID)
Returns the full cached data of a specific door.\
The unique ID determines exactly which door's data you want to retrieve.\
This allows you to access all stored information for a specific door, including its settings, permissions, and configuration data.
```lua [Parameters]
--- @param uniqueId string The unique ID of the door.
--- @return table doorData The full cached data of the specified door.
--- @example
local uniqueId = '1234-5678'
local data = exports['cd_doorlock']:GetDoorDataFull_uniqueid(uniqueId)
if data then
print('Door Name:', data.door_name)
print('Unique ID:', data.unique_id)
else
print('Door not found.')
end
```
```lua
local data = exports['cd_doorlock']:GetDoorDataFull_uniqueid(uniqueId)
```
## Server
### Get All Doors
Returns a table containing all doors and their associated data.
```lua [Parameters]
--- @return table doors A table of all doors and their full data sets.
--- @example
local doors = exports['cd_doorlock']:GetAllDoors()
print('Total doors:', #doors)
for index, door in pairs(doors) do
print('Name: ', data.door_name)
print('Location Group: ', door.location_group)
print('Unique ID: ', door.unique_id)
end
```
```lua
local doors = exports['cd_doorlock']:GetAllDoors()
```
### Get Door Unique ID
Returns the **unique ID** of a door.\
The first and second arguments define which door to retrieve the unique ID from.\
This unique ID is required for some events and is consistent for the door.
```lua [Parameters]
--- @param doorName string The name of the door.
--- @param locationGroup string The location group the door belongs to.
--- @return string uniqueId The door's unique ID.
--- @example
local doorName = 'Main Entrance'
local locationGroup = 'MRPD'
local uniqueId = exports['cd_doorlock']:GetDoorUniqueID(doorName, locationGroup)
print('Door unique ID:', uniqueId)
```
```lua
local uniqueId = exports['cd_doorlock']:GetDoorUniqueID(doorName, locationGroup)
```
### Get Door State (Closest)
Returns the locked state of the closest door.
```lua [Parameters]
--- @return boolean state The door's state (true = locked, false = unlocked).
--- @example
local state = exports['cd_doorlock']:GetDoorState_closest(source)
if state then
print('The closest door is locked.')
else
print('The closest door is unlocked.')
end
```
```lua
local state = exports['cd_doorlock']:GetDoorState_closest(source)
```
### Get Door State (By Name)
Returns the locked state of a specific door.\
The first and second arguments define which door's state you want to check.\
This allows you to retrieve whether a specific named door is locked or unlocked.
```lua [@parameters]
--- @param doorName string The name of the door.
--- @param locationGroup string The location group the door belongs to.
--- @return boolean state The door's state (true = locked, false = unlocked).
--- @example
local doorName = 'Main Entrance'
local locationGroup = 'MRPD'
local state = exports['cd_doorlock']:GetDoorState_name(doorName, locationGroup)
if state then
print('The specified door is locked.')
else
print('The specified door is unlocked.')
end
```
```lua
local state = exports['cd_doorlock']:GetDoorState_name(doorName, locationGroup)
```
### Get Door State (By Unique ID)
Returns the locked state of a specific door.\
The unique ID determines exactly which door's state you want to check.\
This allows you to retrieve whether a specific door is locked or unlocked using its unique identifier.
```lua [Parameters]
--- @param uniqueId string The unique ID of the door.
--- @return boolean state The door's state (true = locked, false = unlocked).
--- @example
local uniqueId = '1234-5678'
local state = exports['cd_doorlock']:GetDoorState_uniqueid(uniqueId)
if state then
print('The door is locked.')
else
print('The door is unlocked.')
end
```
```lua
local state = exports['cd_doorlock']:GetDoorState_closest()
```
### Get Door Data (Closest)
Returns the full cached data of the closest door.\
This function provides all stored information for the nearest door, including its settings, permissions, and configuration data.\
Useful when you need complete door details for logic, debugging, or UI.
```lua [Parameters]
--- @return table doorData The full cached data of the closest door.
--- @example
local data = exports['cd_doorlock']:GetDoorDataFull_closest(source)
if data then
print('Door Name:', data.door_name)
print('Unique ID:', data.unique_id)
else
print('No door found nearby.')
end
```
```lua
local data = exports['cd_doorlock']:GetDoorDataFull_closest(source)
```
### Get Door Data (By Name)
Returns the full cached data of a specific door.\
The first and second arguments define which door's data you want to retrieve.\
This allows you to access all stored information for a specific named door, including its settings, permissions, and configuration data.
```lua [Parameters]
--- @param doorName string The name of the door.
--- @param locationGroup string The location group the door belongs to.
--- @return table doorData The full cached data of the specified door.
--- @example
local doorName = 'Main Entrance'
local locationGroup = 'MRPD'
local data = exports['cd_doorlock']:GetDoorDataFull_name(doorName, locationGroup)
if data then
print('Door Name:', data.door_name)
print('Unique ID:', data.unique_id)
else
print('Door not found.')
end
```
```lua
local data = exports['cd_doorlock']:GetDoorDataFull_name(doorName, locationGroup)
```
### Get Door Data (By Unique ID)
Returns the full cached data of a specific door.\
The unique ID determines exactly which door's data you want to retrieve.\
This allows you to access all stored information for a specific door, including its settings, permissions, and configuration data.
```lua [Parameters]
--- @param uniqueId string The unique ID of the door.
--- @return table doorData The full cached data of the specified door.
--- @example
local uniqueId = '1234-5678'
local data = exports['cd_doorlock']:GetDoorDataFull_uniqueid(uniqueId)
if data then
print('Door Name:', data.door_name)
print('Unique ID:', data.unique_id)
else
print('Door not found.')
end
```
```lua
local data = exports['cd_doorlock']:GetDoorDataFull_uniqueid(uniqueId)
```
---
---
url: /paid-scripts/door-lock/developer-api/chat-commands.md
description: >-
Chat commands reference for cd_doorlock including /doorlock, /doorlockui, and
/debug_doorlock for managing doors and debugging.
---
# Chat Commands
## ::: info Notice
These chat commands can be renamed or disabled in the **`Keys and Commands`** section of the `[configs/config.lua]`.
:::
## **Player Commands**
### **/doorlock**
Opens the door closest to the player.
```bash
/doorlock
```
### **/doorlockui**
Open the Door Lock UI to manage doors, including creating, editing, and deleting them.
```bash
/doorlockui
```
### **/debug\_doorlock**
Toggles the door lock debug mode.
```bash
/debug_doorlock
```
---
---
url: /paid-scripts/door-lock/developer-api/items.md
description: >-
Default usable items for cd_doorlock including lockpicks, keycards, and other
item-based door interaction methods.
---
# Items
---
---
url: /paid-scripts/door-lock/developer-api/keys.md
description: >-
Default keybinds for cd_doorlock. The E key opens the closest door.
Configurable via FiveM Key Mapping in the in-game pause menu settings.
---
# Keys
## ::: info Notice
* You can modify or disable these keys in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section of the `[configs/config.lua]`.
* Ensure you understand how [Key Mapping](https://docs.codesign.pro/coding-information/register-key-mapping) works.
:::
## Open Door (closest)
E - Opens the closest door to the player.
---
---
url: /paid-scripts/door-lock/doorlock-import.md
description: >-
Import preconfigured MLO doors for Gabz, G&N's Studio, Kiiya Interiors, Prompt
Studio, and TStudio. One-click import for supported MLO developers with
cd_doorlock.
---
# Doorlock Import
{% youtube 9MQlOC15\_GQ %}
***
### Compatibility Overview
A reference guide describing the compatibility levels used across all supported resources.
| Status | Description |
| --- | --- |
| **Built-In (script)** | Fully integrated into the script and auto-detected, no modifications or configuration needed. |
| **Built-In (creator)** | Fully integrated by the resource creator, no modifications required. |
| **Built-In (cd\_bridge)** | Fully integrated through cd\_bridge and auto-detected, no extra changes needed in the supported resource. |
| **Minor Changes Required** | Small, simple edits such as adding or copying a single line of code. |
| **Moderate Changes Required** | Involves replacing existing logic or functions with the versions provided by Codesign. |
| **Major Changes Required** | Extensive modifications across multiple files or large code sections. |
## Supported MLO Developers
All MLO resources from this creator are fully supported.
---
---
url: /paid-scripts/door-lock/doorlock-migration.md
description: >-
Migrate from ox_doorlock or qb-doorlock to cd_doorlock. Supports automatic
database reading, SQL query migration, and JSON export for seamless door data
transfer.
---
# Doorlock Migration
{% youtube UHprY1TGExw %}
## Supported Doorlock Migrations
A reference guide describing the compatibility levels used across all supported resources.
| Resource Name | Compatibility | Notes |
| -------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ----- |
| [ox\_doorlock](https://github.com/overextended/ox_doorlock) | Built-In (cd\_doorlock) | |
| [qb-doorlock](https://github.com/qbcore-framework/qb-doorlock) | Built-In (cd\_doorlock) | |
### Ox Doorlock
For **ox\_doorlock**, you have two migration options:\
the script can automatically read the door data directly from the ox\_doorlock database table, or you can paste a SQL query or JSON export into the migration tool.
### QB Doorlock
For **qb-doorlock**, you can migrate your data by letting the script read directly from `Config.DoorList`, or by pasting the door data manually into the migration tool.
---
---
url: /paid-scripts/door-lock/changelog.md
description: >-
Latest updates, changes, and improvements for cd_doorlock. Includes new
preconfigured MLO doors, bridge dependency, bug fixes, and UI improvements for
the door lock system.
---
# Changelog
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
## ::: danger Important Notice (cd\_bridge dependency)
Since v2.1.1, `cd_doorlock` requires `cd_bridge` to work.\
This improves compatibility and makes future updates easier.
:::
## v2.1.16
```bash [Files Changed]
fxmanifest.lua
server/error_handling.lua
client/client.lua
client/door_perms.lua
```
## ::: info Changes
* Improved compatibility with custom frameworks.
* Changed `debugdoorlock` to print in client and server consoles.
* Other minor various improvements.
:::
## v2.1.15
```bash [Files Changed]
fxmanifest.lua
client/error_handling.lua
server/error_handling.lua
html (full folder)
```
## ::: info Changes
* Improved debug prints for discord perms users.
:::
## ::: warning Fixes
* Fixed issue allowing doors to be imported/migrated without a location group.
:::
## v2.1.14
```bash [Files Changed]
fxmanifest.lua
client/lockpicking.lua
server/door_perms.lua
```
## ::: warning Fixes
* Fixed dispatch classic throwing 3777 errors when triggered from doorlock.
* Fixed framework admin permissions overwriting other permission checks.
:::
***
## v2.1.13
```bash [Files Changed]
fxmanifest.lua
server/error_handling.lua
```
## ::: info Changes
* Added further debug prints to `debugdoorlock`.
:::
## ::: warning Fixes
* Fix for UI not selecting the proper door when search is active.
:::
## v2.1.12
```bash [Files Changed]
fxmanifest.lua
client/client.lua
server/server.lua
server/auto_insert_sql.lua
server/error_handling.lua
html (full folder)
```
## ::: info Changes
* Added player identifier printing to `/debugdoorlock` logs to aid debugging.
* Position and scale now save correctly.
:::
## ::: warning Fixes
* Fixed an issue where gates set the usable radius while fully open instead of fully closed, ensuring players can interact with the gate from the correct position when it is closed.
* Fixed indexing issues when searching for doors.
* Automatically fixed MariaDB issues by setting the `auto_lock` default to `0` instead of `NULL`.
:::
## v2.1.11
```bash [Files Changed]
fxmanifest.lua
configs/config_ui.js
configs/config.lua (added Config.DoorDetection)
client/client.lua
```
## ::: info Changes
* Added `Config.DoorDetection` to fully control door dimension checks, allowing them to be enabled or disabled and optionally highlight all detected doors in a building when `OutlineAllDoorsInBuildingInBuilding` is enabled.
:::
## ::: warning Fixes
* Fixed `door_name_max_length` error.
:::
## v2.1.10
```bash [Files Changed]
fxmanifest.lua
client/client.lua
server/server.lua
server/auto_insert_sql.lua
html (full folder)
(added K4MBI and Kiiya's doors to JSON Files/import_locations)
```
## ::: tip Added
* Added preconfigured doors for all K4MBI and Kiiya's MLOs, ready to import with a single click.
:::
## ::: info Changes
* Doors are now sorted by location group to ensure display consistency.
* Modified auto-insert SQL to automatically fix database issues even when auto-insert is disabled.
:::
## ::: warning Fixes
* Fixed a bug where using "Edit Selected" via the target door selection, then closing the UI without making changes, caused the door to be walkable despite showing as locked.
:::
## v2.1.9
```bash [Files Changed]
fxmanifest.lua
client/client.lua
server/server.lua
server/functions.lua
server/error_handling.lua
```
## ::: info Changes
* Doors now load immediately in-game after migrating from JSON files to the SQL database.
* Improved and updated the door hash allow/deny list logic. Will now accept multiple formats ``{ "model", `model`, -12345678`` }.
* Changed cd\_doorlock\_locationgroups.name collation from utf8mb4\_unicode\_ci to utf8mb4\_bin to fix duplicate entry errors.
* Added a timeout if a door is not fully closed when selecting it.
:::
## ::: warning Fixes
* Added validation to ensure keymapping commands are not empty when enabled.
* Fixed an issue where larger or wider doors could not be locked or unlocked after being created.
* Fixed the JSON-to-SQL prompt not showing when automatic SQL insertion was disabled.
* Automatically insert location groups from door data when none are found during JSON-to-SQL migration.
:::
## v2.1.7
```bash [Files Changed]
fxmanifest.lua
client/error_handling.lua
server/server.lua
server/error_handling.lua
server/functions.lua
```
## ::: info Changes
* json\_2\_sql conversion no longer fails due to missing unique\_id values.
* Player-loaded cache events now function more reliably.
:::
## v2.1.7
```bash [Files Changed]
fxmanifest.lua
client/error_handling.lua
```
## ::: info Changes
* Relaxed the default Config.DoorValidationDimensions values.
:::
## v2.1.6
```bash [Files Changed]
fxmanifest.lua
server/door_perms.lua
```
## ::: warning Fixes
* Fixed issues with the identifier perms throwing errors.
:::
## v2.1.5
```bash [Files Changed]
fxmanifest.lua
client/client.lua
```
## ::: warning Fixes
* Fixed the "remove\_lockpick\_item" callback not registered error.
:::
## v2.1.4
```bash [Files Changed]
fxmanifest.lua
client/client.lua
configs/config.lua
```
## ::: tip Added
* Added clearer debug prints when interacting with a door and you dont have perms.
* Added Config.IconSize for you to change the size of the door icon.
:::
## ::: warning Fixes
* Fixed passcode not saving after creating/editing a door.
* Fix for "other" framework's framework door access perms being auto disabled on script start.
:::
## v2.1.3
```bash [Files Changed]
fxmanifest.lua
configs/locales.lua
server/error_handling.lua
server/version_check.lua
server/auto_insert_sql.lua
JSON Files/import_locations (Added Prompt Studios)
```
## ::: tip Added
* Added Prompt Studios Door Locks
:::
## ::: warning Fixes
* Fixed one of the enums in th server sql, changed from gate to gates.
* Fixed the "title" locale error.
* Fixed the wonky prints in the version check.
:::
## v2.1.2
```bash [Files Changed]
fxmanifest.lua
configs/server_webhooks.lua
configs/locales.lua
server/auto_insert_sql.lua
server/server.lua
server/error_handling.lua
```
## ::: warning Fixes
* Fixed the GetLocales error in server\_webhooks.
* Fixed auto\_lock not saving when using SQL database method.
:::
## v2.1.1
## ::: tip Added
* **cd\_bridge** — a new utility resource that acts as the core dependency for all Codesign scripts. This bridge streamlines framework integration, database handling, error management, and compatibility with other resources. Future updates and new integrations will now be significantly easier to implement.
* **SQL Database** — Support for saving door data to an SQL database. Door information can now be stored and managed through SQL instead of relying solely on JSON files.
* If database option is enabled, the SQL will auto insert into your database. Run the `json_2_sql` command to migrate to the SQL database.
* Added animation when locking/unlocking doors.
* Added many new locales (EN | ES | FR | DE | IT | PT | PT-BR | NL | PL | RU | TR | ZH | JA | AR | UA | CZ | DK | SE | NO | KR | HI).
:::
## ::: info Changes
* Improved the debug prints.
:::
## ::: warning Fixes
* Minor fixes
* Fixed issues with all doors not highlighting correctly when `Config.OutlineAvailableDoors` is enabled.
:::
## v2.0.2
## ::: tip Added
* Converter tab
* Options
* OX Doorlock SQL, JSON or Database
* QB Doorlock JSON or Database
* Export tab
* Option to export doors by location group
* Door data backup
* Door data will now be saved every script restart. Saves 7 copies
* Imports
* Created imports for G\&N Studios, TStudio by TurboSaif, Prompt, Kiiya (Partial)
* Full Rewrite of nearly every file.
* Major optimisations all around.
* Added qbox compatibility
* We now support dozens of resources:
* **Framework:** 'esx', 'qbcore', 'qbox', 'vrp', 'standalone'
* **Database:** 'mysql-async', 'ghmattimysql', 'oxmysql'
* **Inventory:** 'codem-inventory', 'ox\_inventory', 'qb-inventory', 'qs-inventory', 'esx', 'qbcore', 'other', 'none'
* **Notification:** 'cd\_notifications', 'mythic\_notify', 'okokNotify', 'origen\_notify', 'ox\_lib', 'pNotify', 'ps-ui', 'rtx\_notify', 'vms\_notifyv2', 'esx', 'qbcore', 'chat'
* **Draw Text UI**: 'cd\_doorlock', 'cd\_drawtextui', 'jg-textui', 'okokTextUI', 'ps-ui', 'qbcore', 'vms\_notifyv2'
* **Locales:** 'EN', 'ES', 'FR', 'DE', 'IT', 'PT', 'NL', 'PL', 'RU'
:::
## ::: info Changes
* UI Design refresh and update
* Added more options to door creation
* Sound unlock and lock sounds
* More sound files
* Keep open option
* Item permissions now have a required amount option and an option to remove on use
* Optimized door data and load times
* Redesigned the import tab
* Imports now have a category option as well as search option
:::
---
---
url: /paid-scripts/vip-shop.md
description: >-
FiveM VIP/donator shop with vehicle stock management, subscriptions, Tebex
integration, and zDiscord support. Includes custom point system and
configurable rewards.
---
# VIP Shop
[**Buy Here**](https://codesign.pro/product/4754302)
[**FiveM Forums Post**](https://forum.cfx.re/t/release-codesign-donator-shop/2511717)
[**YouTube Showcase Video**](https://youtu.be/1aVKajWtF9s)
## 📘 Start Here
* **Installation Guide**\
Step-by-step setup and configuration.
* **Configuration**\
All optional features that can be enabled in config explained.
### 🔧 Developer Reference
* **Chat Commands**\
Player & staff commands with usage examples.
* **Events**\
Triggerable events (client/server) with Lua examples.
* **Exports**\
Optional functions to integrate cd\_doorlock with other scripts.
### 🧠 Need Help?
* [**Troubleshooting Guide**](https://docs.codesign.pro/paid-scripts/door-lock/troubleshooting-guide)\
Common issues and error codes.
* **Support:** Join our Discord –
### 💡 Developer Notes
* Keep integrations simple: use provided **Exports** and **Events**.
* All code samples are **Lua**, beginner-friendly, and copy/paste ready.
* Prefer **auto-detect** config options where available.
---
---
url: /paid-scripts/vip-shop/installation-guide.md
description: >-
Step-by-step installation guide for cd_vipshop. Covers cd_bridge dependency,
Tebex integration, item setup, and configuration for the FiveM VIP donator
shop.
---
# Installation Guide
## 1. Download
1. Download your resource from [FiveM's Portal](https://portal.cfx.re/assets/granted-assets?search=cd_dispatch3d).
2. Unzip the `cd_vipshop.zip` folder and place this folder in your server's resource folder.
## 2. Bridge
> **This resource is the core of all Codesign scripts.** It handles framework connections, database setup, and error handling behind the scenes. When the bridge starts, it automatically detects and starts every compatible resource including all Codesign scripts and any Codesign-compatible scripts you have installed.
1. Download **cd\_bridge** from [FiveM's Portal](https://portal.cfx.re/assets/granted-assets?search=cd_bridge).
2. Add cd\_bridge to the bottom of your server start config (`server.cfg`).
```
ensure cd_bridge
```
For more information on how to [**install the bridge**](https://docs.codesign.pro/paid-scripts/bridge/installation-guide), check out the full guide.
## 3. Config.lua
You must review all configurable options in `[cd_vipshop/configs/config.lua]` and adjust them to suit your server's needs.
\
Be sure to read the **commented help text** at the end of each line it explains the purpose of each configuration option.
![]()
The most important config options are in the **Important** category at the top of `config.lua`.\
All other settings are optional.
![]()
## 4. Install Dependencies
**Where Can I Find These Dependencies?**
You can find all dependencies in the `[cd_vipshop/dependencies]` folder.\
Each dependency has its own folder containing a text file with a GitHub download link.\
Alternatively, you can view the full list in the table below.
***
**Where Should I Put These Dependencies?**
Place all dependencies in your main **resources** folder, just like any other resource.\
**Do not** place them inside the `cd_garage` folder.
***
**Do I Need to Add Them to the Server Start Config?**
* **Required:** No need to add these to your `server.cfg` they start automatically as dependencies of this resource.
* **Optional:** Yes, these must be manually added to your `server.cfg`.
| Resource Name | Download | Detai |
| ------------------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| **`cd_drawtextui`** | [Github](https://github.com/dsheedes/cd_drawtextui) | REQUIRED by default but can be replaced. |
## 5. Create a Game Server
Create a game server on your [**Tebex Webstore**](https://server.tebex.io/settings/servers) to generate your **secret key**.\
If you haven't done this before, watch the [**video guide**](https://youtu.be/YZs_hWNtYQM).
Add the following line to your **server.cfg**, replacing `CHANGE_ME` with your Tebex secret key:
```
sv_tebexSecret CHANGE_ME
```
![]()
## 6. Create a Product on Your Tebex Webstore
Create a product on your [**Tebex Webstore**](https://server.tebex.io/settings/servers) and add the **command** below.\
If this is your first time, follow the [**video guide**](https://youtu.be/xVCRvNG_JxI).
Add this command to the product:
```
tebex_purchase {"transaction_id":"{transaction}", "package":"{packageName}"}
```
## ::: info Using subscriptions?
See **Subscriptions Setup** for monthly compatibility.
:::
## 7. Config.TebexListings
### Important Product Setup
* The **product name** on your Tebex Webstore **must exactly match** the `ProductName` in `Config.TebexListings` (`configs/config.lua`)
* The **amount** is how many **coins the player receives** when the product is purchased
![]()
The product name on your **Tebex Webstore**.
## 8. Configure the In-Game Shop
Add or remove shop rewards (vehicles, money, items, weapons) using `Config.Shop` in `configs/config.lua`.
## 9. Redeem a Purchase
After a player buys a product from your **Tebex Webstore**, Tebex will automatically run a command on your server (this can take **2–10 minutes**).
Once complete, the player can redeem their purchase in-game using:
```
/redeem tebex_transaction_id
```
This will save the player's **vip tokens** and make them available to spend.
---
---
url: /paid-scripts/vip-shop/troubleshooting-guide.md
description: >-
Troubleshooting guide for cd_vipshop with common issues, error codes, and
solutions for the FiveM VIP donator shop.
---
# Troubleshooting Guide
## Error Codes
::: info Notice
If you encounter an error code not listed below, please open a support ticket in the [Codesign Discord](https://discord.gg/codesign) for assistance.
:::
### Server
* **0886****-** The `GetIdentifier` function in the `configs/server_customise_me.lua` is returning a nil value instead of a string containing the player's identifier.
* **0887****-** The package variable in the database is returning a nil value instead of a string containing the product name(s) of the player's purchase.
* **0888****-** The name of the package which was purchased on your Tebex store does not match with any of the packages in your Config.TebexListings. The name of the wrongly named package will be visible in the error message.
* **4454** - This means a player is trying to use the `"tebex_purchase"`. This command is only supposed to be triggered from the server-side by tebex when a player makes a purchase on your tebex store.
* **7742** - This could mean you are triggering the `"tebex_purchase"` from the server console, which you shouldn't be. This command is only supposed to be triggered from the server-side by tebex when a player makes a purchase on your tebex store. The other reason is that tebex is not sending the correct data due to "Configure Resource" step not being completed correctly.
* **0811** - This means the number of display vehicles you have configured to be on display in `Config.DisplayVehicles.RandomizeVehicles.display_vehicle_count`, is higher than the number of possible vehicle locations in `Config.DisplayVehicles.VehicleCoords['manually_set']`.
* **0822** - This means the number of display vehicles you have configured to be on display in `Config.DisplayVehicles.Vehicles`, is higher than the number of possible vehicle locations in `Config.DisplayVehicles.VehicleCoords['manually_set']`.
## Common Issues
Please check out our [**Self Debugging Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder is `cd_vipshop`.
**Encrypted Files** Do not edit the encrypted files in any way.
::: details **Can't Redeem a Purchase?**
**Example:**\
A player has purchased a product from your Tebex store, but cannot redeem it in-game after **10 minutes**.
**Possible Reasons:**
* The `sv_tebexSecret` key is active on **another server** (test/dev/localhost), causing Tebex to send data to the wrong server
* The Tebex command is set to **Only execute when the player is online**, and the player was offline at the time of purchase
* Tebex may be experiencing temporary issues
**Solution:**
1. Make sure `sv_tebexSecret` is **only** set on your live server
2. Edit the Tebex product command and set **Require Player To Be Online** to **Execute the command even if the player is offline.**
3. Restart your server after any changes
4. If the issue persists, wait and try again
:::
::: details **Tebex Secret Key?**
**Example:**\
You see this error in your server console:
```
[cd_donatorshop] - Unable To Start (sv_tebexSecret is nil)
```
**Reason:**\
**Step 5** has not been completed correctly.
**Solution:**
* Make sure `sv_tebexSecret` is set in your **server config**
* Restart the server after adding it
:::
::: details **Redeemed 0 Balance?**
**Example:**\
A player redeems a purchase, but the notification shows **0 balance** instead of the expected amount.
**Reason:**\
The **product name** on your Tebex store does not **exactly match** the `ProductName` in `Config.TebexListings`.
**Solution:**
* Make sure both names match **exactly**
* Check **capital letters, spaces, and punctuation**
:::
::: details **Not All Display Vehicles Spawned?**
**Example:**\
Some display vehicles stop spawning and the vehicle UI is no longer visible.
**Reason:**\
One of the vehicle **models** in the `Config.Vehicle` table (`configs/config.lua`) has an **incorrect spawn name**.
**Solution:**
* Check the **model spawn names** for all vehicles
* The issue is usually the vehicle **listed after the last one that spawned correctly**
* Fix the spawn name and restart the script
:::
---
---
url: /paid-scripts/vip-shop/features.md
description: >-
Features for cd_vipshop including vehicle stock management, monthly
subscriptions via Tebex, and zDiscord integration for QBCore with point
management commands.
---
# Features
## Vehicle Stock
### How does vehicle stock work?
Vehicle stock lets you **limit how many times a specific vehicle can be sold** in the VIP shop.
* Stock is **saved in the database**
* Stock amounts can be **changed at any time**
* Only vehicles **added to the vehicle stock table** are limited
* Vehicles **not** in the table can be sold **unlimited times**
### How do I use vehicle stock?
1. Enable vehicle stock in `configs/config.lua`:
* Set `Config.VehicleStock` to **true**
2. Open your server database
3. Locate the **`cd_vipshop_vehiclestock`** table
4. Add:
* The **vehicle spawn name**
* The **stock amount**
![]()
⚠️ Vehicle stock **can only be edited in the database**.
> 📽️ [A video example is available if you need a walkthrough.](https://gyazo.com/eb32f7cb4c2a330a7be7f8d359213d47)
### Subscriptions (Monthly)
To enable **recurring / monthly subscriptions** on your Tebex store:
1. Go to **Step 6** where you added the Tebex command to the product
2. Add **the same command a second time**
3. Change **when the second command is sent** to **run on renewal** (not on purchase)
This ensures the player automatically receives the **same amount of vip tokens** every time their subscription renews.
![]()
### zDiscord Integration
To integrate with **zDiscord**:
1. Add the **3 files** from the download into:
```
zdiscord/server/commands
```
2. Restart your server
This integration is **QBCore only** unless you modify the code.
#### Available Commands
* `/pointlist [cid]` – View a player’s points
* `/pointadd [cid] [points]` – Add points to a player
* `/pointremove [cid] [points]` – Remove points from a player
---
---
url: /paid-scripts/vip-shop/developer-api.md
---
# Developer API
---
---
url: /paid-scripts/vip-shop/developer-api/chat-commands.md
---
***
description: >-
Chat commands reference for cd\_vipshop including player and staff commands for managing the VIP donator shop.
keywords: cd\_vipshop chat commands, VIP shop commands, donator commands, FiveM VIP, Codesign developer API
-----------------------------------------------------------------------------------------------------------
# Chat Commands
## ::: info Notice
These chat commands can be renamed or disabled in the **`Keys and Commands`** section of the `[configs/config.lua]`.
:::
## **Player Commands**
### **/redeem**
Redeems vip tokens after a Tebex purchase.
```lua
/redeem
-- /redeem tbx-8832421a77453-etd002
```
***
### **/add\_balance**
*(Staff Command)* The example command adds **10 donator coins** to **ID 1**.
```lua
/add_balance
--/add_balance 1 10
```
### **/remove\_balance**
*(Staff Command)* The example command removes **20 donator tokens** from **ID 2**.
```lua
/remove_balance
-- /remove_balance 2 20
```
---
---
url: /paid-scripts/vip-shop/developer-api/exports.md
---
***
description: >-
Exports reference for cd\_vipshop including functions for point management, purchases, and VIP shop integration.
keywords: cd\_vipshop exports, VIP shop exports, point management, purchases, FiveM exports, Codesign developer API
-------------------------------------------------------------------------------------------------------------------
# Exports
## ::: info Notice
These exports are entirely optional and can be used as needed within your own scripts or integrations.
:::
## Server
### Get Balance
Returns a player's **VIP balance**.
```lua [Parameters]
--- @param number source The player source.
--- @return number balance The player's VIP balance.
--- @example
local balance = exports['cd_vipshop']:GetVipBalance(source)
print('VIP Balance:', balance)
```
```lua
local balance = exports['cd_vipshop']:GetVipBalance(source)
```
### Add Balance
Adds VIP tokens to a player.
```lua [Parameters]
--- @param number source The player source.
--- @param number amount The amount of VIP tokens to add.
--- @example
exports['cd_vipshop']:AddVipBalance(source, 5)
```
```lua
exports['cd_vipshop']:AddVipBalance(source, amount)
```
### Remove Balance
Removes VIP tokens from a player.
```lua [Parameters]
--- @param number source The player source.
--- @param number amount The amount of VIP tokens to remove.
--- @example
exports['cd_vipshop']:RemoveVipBalance(source, 5)
```
```lua
exports['cd_vipshop']:RemoveVipBalance(source, amount)
```
### Can Purchase Check
Checks whether a player can afford a purchase.
```lua [Parameters]
--- @param number source The player source.
--- @param number cost The cost of the purchase.
--- @return boolean canPurchase Whether the player can afford the purchase.
--- @example
local canPurchase = exports['cd_vipshop']:CanPurchaseCheck(source, 50)
print('Can purchase:', canPurchase)
```
```lua
local canPurchase = exports['cd_vipshop']:CanPurchaseCheck(source, cost)
```
---
---
url: /paid-scripts/vip-shop/changelog.md
description: >-
Latest updates, changes, and improvements for cd_vipshop. Includes cd_bridge
integration, bug fixes, and new features for the FiveM VIP shop system.
---
# Changelog
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
## ::: danger Important Notice (cd\_bridge dependency)
Since v1.1.0, `cd_vipshop` requires `cd_bridge` to work.\
This improves compatibility and makes future updates easier.
:::
## v4.3.6
```bash [Files Changed]
fxmanifest.lua
server/other/purchase_made.lua
```
## ::: warning Fixes
* Fixed an issue where a negative bank balance would cancel a purchase even when the bank cost was 0.
:::
## v4.3.5
```bash [Files Changed]
fxmanifest.lua
server/rewards/vehicles.lua
```
## ::: warning Fixes
* Fixed random plate generation erroring when purchasing a vehicle.
:::
## v4.3.4
```bash [Files Changed]
fxmanifest.lua
client/other/display_vehicles.lua
client/other/test_drive.lua
html (FULL FOLDER)
```
## ::: warning Fixes
* Fixed issue where players could press G to test drive even when test drive was disabled in the config.
* Fixed issue where vehicle keys were not always removed, due to some vehicle key scripts requiring vehicle to be defined.
* Fixed plate input being covered by categories.
* Fixed notification going out of bounds.
:::
## v4.3.3
```bash [Files Changed]
fxmanifest.lua
server/main/server.lua
```
## ::: warning Fixes
* Fixed /redeem not working correctly.
:::
## v4.3.2
```bash [Files Changed]
fxmanifest.lua
client/other/test_drive.lua
server/main/server.lua
```
## ::: info Changes
* Vehicle keys are now removed after a test drive.
:::
## ::: warning Fixes
* Fixed issues with the tebex purchase command.
:::
## v4.3.1
## ::: tip Added
* Added support for manually set air, boat, and car locations that work alongside randomization.
:::
## ::: info Changes
* Integrated with `cd_bridge` for easier future updates and improved stability.
:::
---
---
url: /paid-scripts/event-calendar.md
description: >-
FiveM event calendar for scheduling and managing in-game events. Includes
installation guide, configuration, and developer API reference.
---
# Event Calendar
[**Buy Here**](https://codesign.pro/event-calendar/)
**FiveM Forums Post**
**YouTube Walkthrough Video**
## 📘 Start Here
* [**Installation Guide**](https://docs.codesign.pro/paid-scripts/door-lock/installation-guide)\
Step-by-step setup and configuration.
* [**Configuration**](https://docs.codesign.pro/paid-scripts/door-lock/optional-features)\
All optional features that can be enabled in config explained.
* [**Compatibility**](https://docs.codesign.pro/paid-scripts/door-lock/doorlock-import)\
What’s built-in vs needs changes.
***
### 🔧 Developer Reference
* [**Chat Commands**](https://docs.codesign.pro/paid-scripts/door-lock/developer-api/chat-commands)\
Player & staff commands with usage examples.
* [**Events**](https://docs.codesign.pro/paid-scripts/door-lock/developer-api/events)\
Triggerable events (client/server) with Lua examples.
* [**Exports**](https://docs.codesign.pro/paid-scripts/door-lock/developer-api/exports)\
Optional functions to integrate cd\_doorlock with other scripts.
* [**Keys & Controls**](https://docs.codesign.pro/paid-scripts/door-lock/developer-api/keys)\
Default keybinds and interaction methods.
* [Items](https://docs.codesign.pro/paid-scripts/door-lock/developer-api/items)\
Default items and item-based interaction methods.
***
### 🧠 Need Help?
* [**Troubleshooting Guide**](https://docs.codesign.pro/paid-scripts/door-lock/troubleshooting-guide)\
Common issues and error codes.
* **Support:** Join our Discord –
***
### 💡 Developer Notes
* Keep integrations simple: use provided **Exports** and **Events**.
* All code samples are **Lua**, beginner-friendly, and copy/paste ready.
* Prefer **auto-detect** config options where available.
---
---
url: /paid-scripts/event-calendar/installation-guide.md
description: >-
Step-by-step installation guide for the FiveM event calendar system. Covers
cd_bridge dependency, download, configuration, and setup.
---
# Installation Guide
### 1. Codesign Bridge
#### Framework, Database, and Integration Handling
**This resource requires `cd_bridge` to be installed and running before it can function.**
`cd_bridge` is **drag-and-drop** and requires **no configuration or file editing**.
It handles framework connections, database setup, and error handling behind the scenes. When the bridge starts, it automatically detects and initializes all compatible resources — including all Codesign scripts and any Codesign-compatible scripts you have installed.
**For installation instructions, see the** [**👉 full bridge setup guide →**](https://docs.codesign.pro/paid-scripts/bridge/installation-guide)**.**
### 2. Download
#### Download the Resource from FiveM’s Portal
1. [**👉 Download cd\_eventcalendar →**](https://portal.cfx.re/assets/granted-assets?search=cd_eventcalendar)
2. Unzip the downloaded file
3. In your server’s `resources` directory, **create a folder named `[codesign]` if it does not already exist**
4. Place **`cd_eventcalendar`** (and all other Codesign resources) inside the **`[codesign]`** folder
![]()
Example resources folder with a \[codesign] directory
### 3. Configure Resource
#### Review and Adjust config.lua Options
You must review all configurable options in `[cd_eventcalendar/configs/config.lua]` and adjust them to suit your server’s needs.
Be sure to read the **commented help text** at the end of each line — it explains the purpose of each configuration option.
![]()
The most important config options are in the **Important** category at the top of `config.lua`.\
All other settings are optional.
![]()
---
---
url: /paid-scripts/event-calendar/troubleshooting-guide.md
description: >-
Troubleshooting guide for the FiveM event calendar system with common issues,
error codes, and solutions.
---
# Troubleshooting Guide
## Error Codes
## ::: info Notice
If you encounter an error code not listed below, please open a support ticket in the [Codesign Discord](https://discord.gg/codesign) for assistance.
:::
### Server
/
### Client
/
## Common Issues
Please check out our [**Self Debugging Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
🔔 **Folder Name** Make sure the name of the folder is `cd_eventcalendar`.
🔔 **Encrypted Files** Do not edit the encrypted files in any way.
---
---
url: /paid-scripts/event-calendar/features.md
description: >-
Features overview for the FiveM event calendar system. Covers event
scheduling, reminders, and calendar management for roleplay servers.
---
# Features
---
---
url: /paid-scripts/event-calendar/developer-api/chat-commands.md
description: >-
Chat commands reference for the FiveM event calendar system including player
and staff commands for managing events.
---
# Chat Commands
## ::: info Notice
These chat commands can be renamed or disabled in the **`Keys and Commands`** section of the `[configs/config.lua]`.
:::
## **Player Commands**
### **/calendar**
Opens the event calendar UI.
```bash
/calendar
```
---
---
url: /paid-scripts/event-calendar/changelog.md
description: >-
Latest updates, changes, and improvements for the FiveM event calendar system.
Tracks version history, new features, and bug fixes.
---
# Changelog
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
## ::: danger Important Notice (cd\_bridge dependency)
`cd_eventcalendar` requires `cd_bridge` to work.\
This improves compatibility and makes future updates easier.
:::
## v1.1.1
```bash [Files Changed]
html (FULL FOLDER)
```
## ::: info Changes
> Attempting to resolve visual issues whith multiple of the same person appearing in the event list.
> Attempting to resolve visual issues with gift icon not disappearing after claiming a gift.
* Added stricter checks for attending events
* Added stricter checks for gift claiming
:::
## v1.1.0
```bash [Files Changed]
html (FULL FOLDER)
```
## ::: tip Added
* Added item label to item search in gift packs
* Added visual description editor for events
* Added separate datepickers for start and end dates
:::
## ::: info Changes
* Gift packs now filter items instead of scrolling
* Settings now filter languages instead of scrolling
* Replaced air-datepicker with vanilla-calendar-pro
* Added visual feedback after creating event
:::
## v1.0.1
```bash [Files Changed]
fxmanifest.lua
client/client.lua
server/server.lua
html (FULL FOLDER)
```
## ::: warning Fixes
* Fixed error when updating gift packs.
* Optimised confetti for claiming rewards.
* Image fallback now displays properly in every interface.
:::
---
---
url: /paid-scripts/radar.md
description: >-
FiveM police ALPR radar system with speed detection, BOLO alerts, vehicle
database lookup, and ANPR functionality. Supports ESX, QBCore, and standalone
frameworks.
---
# Radar
[**Buy Here**](https://codesign.pro/product/5155713)
[**FiveM Forums Post**](https://forum.cfx.re/t/paid-codesign-police-alpr-radar/4891890?u=codesign)
[**YouTube Showcase Video**](https://www.youtube.com/watch?v=ESLlIdzzelc)
## INSTALLATION GUIDE
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
**2.** Unzip the `cd_radar.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_radar`. 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_radar
```
### Step 1 - Fxmanifest
Depending on your framework and dependencies, you may need to make some changes inside the **`[cd_radar/fxmanifest.lua]`**. We have made this easier by [commenting ](https://i.imgur.com/bbb0dam.png)on the lines you possibly need to change.
### Step 2 - Configure Resource
You **MUST** read all configurable options inside the **`[cd_radar/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [commented out help text](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections at the top of the `config.lua`. Everything else is optional.**
> [**NEW: Auto Framework Detect!**](https://i.imgur.com/zNW8Kpg.png)
>
> Introducing our new 'auto\_detect' feature! It automatically identifies your framework and SQL database resource, and applies the appropriate default settings.
### Step 3 - Configure Key Binds
::: warning Important
Before starting this resource on your main/live server, we highly advise configuring your key binds because this resource uses [Fivem's Key Mapping](../../helpful-guides/register-key-mapping.md).
:::
**Where can I configure my key binds?**
You can configure key binds in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section near the bottom of the **`[cd_radar/configs/config.lua]`**.
> **Why do I need to do this?**
>
> Well long story short;- once a player has joined your server with this resource running you can no longer force change their key binds for this resource through the config.lua, only they can change it in the in-game [pause menu settings](https://imgur.com/GRWKelR). Although it will change for the players who join after you have changed it.
>
> The benefit of this system is that it's much more optimised and players can easily change their key binds on keyboards or controllers. You can also check out the [Default Keybinds](./#default-keybinds) for this resource.
## 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]`.
### Vehicles Data
> **What is Vehicles Data used for?**
>
> When using ESX or QBCore we take information that most servers will already have stored to get the vehicles to display names of custom vehicles.
::::tabs
\==ESX
On ESX we will grab the vehicle's display names from the `"vehicles"` database table as this is very common in esx servers.
**Multiple "vehicles" database tables**
We were informed that some servers use multiple "vehicles" database tables for donator vehicles**,** emergency vehicles etc. So all you need to do is add the names of these database tables into the `Config.VehiclesData.VehicleDatabase_TableNames` in the config,lua.
\==QBCore
On QBCore we will grab the vehicle's display names from the `qb-core/shared.lua/QBShared.Vehicles` as this is very common in QBCore servers.
\==Standalone
If `Config.VehiclesData` is disabled, the script will get the vehicle's display names from the vehicle handling files `vehicles.meta`. Example: `Adder`.
\==Other
If `Config.VehiclesData` is disabled, the script will get the vehicle's display names from the vehicle handling files `vehicles.meta`. Example: `Adder`.
::::
### Adding/Removing BOLOs & spaners from other resources
> **Why do I need this?**
>
> This is optional, but it is possible to add BOLOs and spaners from other resources, such as MDTs or police resources.
::::tabs
\==Adding BOLOs & spaners
:::::tabs
\===client-side to server-side
```lua [This is a template.]
TriggerServerEvent('cd_radar:RadarDatabase_ADD', {
plate = CHANGE_ME,
model = CHANGE_ME,
colour = CHANGE_ME,
reason = CHANGE_ME,
type = CHANGE_ME,
name = nil,
notes = nil,
date = nil,
})
```
```lua [This is an example of how this can be formatted.]
TriggerServerEvent('cd_radar:RadarDatabase_ADD', {
plate = 'CODESIGN',
model = 'Adder',
colour = 'Blue',
reason = 'Drugs',
type = 'bolo',
name = nil,
notes = 'Pablo Escobar wannabe (selling drugs)',
date = nil,
})
```
::: info Note
When triggering the event from client-side to server-side, the player triggering the event must have an authorised job.
:::
\===server-side to server-side
```lua [This is a template.]
TriggerEvent('cd_radar:RadarDatabase_ADD', {
plate = CHANGE_ME,
model = CHANGE_ME,
colour = CHANGE_ME,
reason = CHANGE_ME,
type = CHANGE_ME,
name = nil,
notes = nil,
date = nil,
})
```
```lua [This is an example of how this can be formatted.]
TriggerEvent('cd_radar:RadarDatabase_ADD', {
plate = 'CODESIGN',
model = 'Adder',
colour = 'Blue',
reason = 'Drugs',
type = 'bolo',
name = nil,
notes = 'Pablo Escobar wannabe (selling drugs)',
date = nil,
})
```
::: info Note
When triggering the event from the server-side to server-side, cd\_radar can not get a character's name as the source will not be defined.
:::
#### What does each of the variables above mean?
* **plate:** The vehicle's plate (string).
* **model:** The vehicle's display name (string).
* **colour:** The vehicle's colour (string).
* **reason:** The reason must match one of the reasons in the "**`reasonList`**" in the `[configs/config_ui.js]` (string).
* **type:** Choose between "**`bolo`**" or "**`spaner`**" (string).
* **name:** \[*OPTIONAL]* The character's name (string).
* *If left as `nil` then cd\_radar auto-fill this for you.*
* **notes:** \[*OPTIONAL]* Notes left by the officer who issued the bolo/spaner (string).
* **date:** \[*OPTIONAL]* The time this bolo/spaner was issued (string).
* *If left as `nil` then cd\_radar auto-fill this for you.*
\==Removing BOLOs & spaners
:::::tabs
\===client-side to server-side
```lua [The vehicles plate must be defined in the 1st argument.]
TriggerServerEvent('cd_radar:RadarDatabase_REMOVE', plate)
```
::: info Note
When triggering the event from client-side to server-side, the player triggering the event must have an authorised job.
:::
\===server-side to server-side
```lua [The vehicles plate must be defined in the 1st argument.]
TriggerEvent('cd_radar:RadarDatabase_REMOVE', plate)
```
::: info Note
When triggering the event from the server-side to server-side, cd\_radar can not get a character's name as the source will not be defined.
:::
:::::
## Information
### Default Key Binds
These keys can be modified and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section of the `[configs/config.lua]`.
Please make sure you understand how [Key Mapping](https://docs.codesign.pro/coding-information/register-key-mapping) works.
| Key | Description |
| ------- | ----------------------------- |
| **`J`** | Interact with the radar's UI. |
| **`O`** | Toggle the radar lock. |
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| Command | Description |
| -------------------- | ------------------------------- |
| **`/radarsettings`** | Interact with the radar's UI. |
| **`/radartoggle`** | Toggle the radar UI visibility. |
| **`/radarlock`** | Toggle the radar lock. |
### Events
These events are completely optional; you can use them if needed.
:::tabs
\===client-side to server-side
**Interact With Radar**
```lua [Interact With Radar UI with your mouse.]
TriggerEvent('cd_radar:InteractWithRadar')
```
**Toggle Radar**
```lua [Toggle the radar UI visibility.]
TriggerEvent('cd_radar:ToggleRadar')
```
**Show Radar**
```lua [Show the radar UI.]
TriggerEvent('cd_radar:ShowRadar')
```
**Hide Radar**
```lua [Hide the radar UI.]
TriggerEvent('cd_radar:HideRadar')
```
**Toggle Radar Lock**
```lua [Toggle the radar lock.]
TriggerEvent('cd_radar:ToggleRadarLock')
```
::::
## Common Issues
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder is `cd_radar`.
**Encrypted Files** Do not edit the encrypted files in any way.
> **Radar Ignores Emergency Vehicles?**
>
> eg., if your radar is ignoring emergency vehicles.
>
> ```
> This is normal; by design we have made it so the radar ignores emergency vehicles; as during police chases this could get really annoying. So please be aware of this if testing the resource out emergency vehicles aren't being seen by the speed limit radar.
> ```
> **Radar Locking Below The Limit I Set?**
>
> eg., if you have your radar to lock vehicles at 70mph but they are locking at 30mph.
>
> ```
> This is because you have not set the limit for all 4 cameras. Each camera has its own individual speed limit for locking vehicles. Set them all to the new limit individually.
> ```
> **Radar Not Visible But I Have The Correct Job/perms?**
>
> eg., if you are confident you have the correct job/perms, but the radar still isn't visible when in a vehicle.
>
> ```
> This is because the radar is set to only be visible when you are in an emergancy vehicle. To test this theory, spawn in a default gta police car (/car police), then it should work. If a default gta police car works, but your custom police car does not, then the vehicle class for your custom car is not set as an emergancy vehicle (VC_EMERGENCY) in the vehicles.meta.
> ```
> **I'm Not Able To Add Plates To The Radar's Database?**
>
> eg., if you are trying to add plates to the radar's database manually or through another script but it doesn't get added and there are no errors.
>
> ```
> The most common reason for this is because you do not have permission to use the radar (your job is not in the Config.AllowList table in the config.lua). The only way the script will allow you to add a plate to the radar's database is if your job has permission or the event is being triggered from the server side. There will be no visible error if you try to add a plate to the radar's database without proper permissions.
> ```
## Error Codes
If you see an error code not listed below please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).
:::tabs
\==Server
**468454** - You do not have the `vehicles` database table, so you need to disable `Config.VehiclesData` by setting the ENABLE option to false.
**3364** - You are triggering the `cd_radar:RadarDatabase_REMOVE` server event to remove bolos/spaners, but this vehicle does not have a bolo/spaner on it.
**8800** - When triggering the `cd_radar:RadarDatabase_ADD` server event to add bolos/spaners, you need to send a **`table`**, but you are not.
**8801** - When triggering the `cd_radar:RadarDatabase_ADD` server event to add bolos/spaners, the **`plate`** variable is not a string or is nil.
**8802** - When triggering the `cd_radar:RadarDatabase_ADD` server event to add bolos/spaners, the **`model`** variable is not a string or is nil.
**8803** - When triggering the `cd_radar:RadarDatabase_ADD` server event to add bolos/spaners, the **`colour`** variable is not a string or is nil.
**8804** - When triggering the `cd_radar:RadarDatabase_ADD` server event to add bolos/spaners, the **`reason`** variable is not a string or is nil.
**8805** - When triggering the `cd_radar:RadarDatabase_ADD` server event to add bolos/spaners, the **`type`** variable is not a string or is nil.
**8806** - When triggering the `cd_radar:RadarDatabase_ADD` server event to add bolos/spaners, the **`reason`** variable is not defined in the `config_ui.js`'s **`reasonList`** table. The strings must be an exact match (case sensitive).
**8807** - When triggering the `cd_radar:RadarDatabase_ADD` server event to add bolos/spaners, the **`plate`** variable is either more than 8 characters or is an empty string.
**8808** - When triggering the `cd_radar:RadarDatabase_ADD` server event to add bolos/spaners, the **`type`** variable can only be either `bolo` or `spaner`, but you are sending something different.
\==Client
N/A
:::
## Changelog
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
## ::: danger Important
When updating a resource that uses JSON files as a database as this one does, **DO NOT** delete/replace the files/folders inside the **`JSON files`** folder, as this will overwrite your saved database.
:::
### v1.0.7
```bash [Files Changed]
fxmanifest.lua
client/client.lua
```
**Changelog:**
## ::: warning Fixed
* Fixed the radar UI opening and not closing after interacting with garage, dispatch or any codesign UI while having cd\_bridge installed.
:::
### v1.0.6
```bash [Files Changed]
fxmanifest.lua
client/client.lua
```
**Changelog:**
## ::: warning Fixed
* Significantly improved the radars vehicle detection.
:::
### v1.0.5
**Changelog:**
## ::: tip Added
* Added Turkish locales thanks to Lumisaphy.
* Added pre-configured notification events/exports for some notification scripts that are auto-set by the auto\_detect.
* Added "Config.ClearDatabaseOnRestart" config option to delete the BOLO/spaner database on script start.
:::
## ::: info Updated
* Optimised the events and data that sync the radar's database.
* Error codes will now tell you which script the errors came from for easier debugging.
* Removed unnecessary script start prints.
:::
## ::: warning Fixed
* Fixed the radar database not sometimes syncing when joining the server off-duty and then going on duty on QBCore.
:::
### v1.0.4
**Changelog:**
## ::: tip Added
* Added pre-configured cd\_dispatch integrations.
:::
## ::: warning Fixed
* Fixed some minor issues with the discord webhook.
:::
### v1.0.3
**Changelog:**
## ::: tip Added
* **Auto Framework Detection** - We have added a new feature we are calling '**auto\_detect**', which will automatically identify your framework resource and framework notifications and apply the appropriate default settings.
* **Multiple Choice Permissions Access:** With this new feature, you are no longer forced to choose 1 way of adding permissions, you can use multiple all at the same time. You can choose from the framework's job, discord roles, ace perms and identifiers all at the same time!
:::
## ::: warning Fixed
* Fixed the errors when removing a bolo/spaner.
* Fixed the errors with owner check.
:::
### v1.0.2
**Changelog:**
## ::: warning YOUR RADAR DATABASE WILL BE DELETED IF YOU DON'T READ THIS.
**Copy all of the data inside the \[`radar_database.txt]` file and paste them inside the \[`JSON Files/radar_database.json]` file.**
:::
## ::: tip Added
* Added `Config.UseFrameworkDutySystem` so you can choose whether you want to use your framework's built-in duty system.
:::
## ::: info Updated
* Updated the debug prints.
* The remove bolo/spaner event now only requires the plate to be sent instead of the whole table.
* Removed the SQL query to get a character name on esx and replaced it with the ESX getName function.
:::
## ::: warning Fixed
* Fixed the radar database not being synced when switching jobs.
* Added an auto fix for the QB-shared vehicle misconfigured files.
* Fixed some locales on the UI.
:::
### v1.0.1
**Changelog:**
## ::: tip Added
* Added configurable debug prints.
:::
## ::: info Updated
* Cleaned up some of the unused/unneeded code.
:::
## ::: warning Fixed
* Fixed an issue with the standalone perms checks.
:::
### v1.0.0
---
---
url: /paid-scripts/radar/configs-locales-and-sql.md
description: >-
Configuration, locales, and SQL setup for cd_radar. Includes framework
auto-detect, vehicle data, BOLO management, and speed detection settings.
---
# Configs, Locales & SQL
:::tabs
\==Config
```lua
Config = {}
function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
--WHAT DOES 'auto_detect' DO?
--The 'auto_detect' feature automatically identifies your framework and SQL database resource, and applies the appropriate default settings.
Config.Framework = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', only ESX, QBCore, vRP and Standalone frameworks will be detected. Use 'other' for custom frameworks.
Config.Database = 'auto_detect' --[ 'auto_detect' ] If you select 'auto_detect', only MySQL, GHMattimysql, and Oxmysql SQL database resources will be detected.
Config.Notification = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', the default notifications for your framework will be used. Use 'other' for custom notification resources.
Config.Language = 'EN' --[ 'EN' / 'NL' ] You can add your own locales to Locales.lua, but be sure to update the Config.Language to match it.
Config.FrameworkTriggers = {
esx = { --If you have modified the default event names in the es_extended resource, change them here.
resource_name = 'es_extended',
main = 'esx:getSharedObject',
load = 'esx:playerLoaded',
job = 'esx:setJob'
},
qbcore = { --If you have modified the default event names in the qb-core resource, change them here.
resource_name = 'qb-core',
main = 'QBCore:GetObject',
load = 'QBCore:Client:OnPlayerLoaded',
job = 'QBCore:Client:OnJobUpdate',
duty = 'QBCore:Client:SetDuty'
}
}
--██╗███╗ ███╗██████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗████████╗
--██║████╗ ████║██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝
--██║██╔████╔██║██████╔╝██║ ██║██████╔╝ ██║ ███████║██╔██╗ ██║ ██║
--██║██║╚██╔╝██║██╔═══╝ ██║ ██║██╔══██╗ ██║ ██╔══██║██║╚██╗██║ ██║
--██║██║ ╚═╝ ██║██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║██║ ╚████║ ██║
--╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
Config.Debug = false --To enable debug prints.
Config.UseFrameworkDutySystem = false --Do you want to use your frameworks (esx/qbcore) built-in duty system?
--███╗ ███╗ █████╗ ██╗███╗ ██╗
--████╗ ████║██╔══██╗██║████╗ ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
--╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
Config.MainThreadWaitTimer = 200 --The wait timer in the main thread. (lowering this number will make the UI more responsive but consume more resources and vise versa).
Config.SpeedMultiplier = 2.236936 --[2.236936 (MPH) / 3.6 (KMH)] The vehicles speed multiplier.
Config.RadarDistance = 50.0 --The distance from your vehicle that the radar can scan other vehicles (may not work accurately above 50).
Config.AllowList = { --A list of different methods where you can define which players can use the radar.
Framework = { --Ignore this framework section if you don't use a framework.
['esx'] = {'police', 'bcso', },
['qbcore'] = {'police', 'bcso', },
['vrp'] = {'police', 'bcso', },
},
Identifiers = {
ENABLE = false, --Do you want to allow players with specific identifiers use the radar?
identifier_list = {'steam:xxxxx', 'license:xxxxx', 'fivem:xxxxx', } --You can use a players steam, license or fivem id etc.
},
AcePerms = {
ENABLE = false, --Do you want to allow players with specific ace perms use the radar?
aceperms_list = {'radar.police', } --Make sure you have your ace perms configured correctly in your server.cfg.
},
Discord = { --This feature requires the Badger Discord API resource.
ENABLE = false, --Do you want to allow players with specific discord roles in your discord use the radar?
discord_list = {'xxxxx', 'xxxxx', } --You must put the role id from your discord here (https://www.itgeared.com/how-to-get-role-id-on-discord).
}
}
Config.DisabledKeys = { --A list of keys which are disabled while you interact with the radar UI.
1,2,21,24,25,47,58,75,106,140,141,142,143,245,257,263,264,
}
--██╗ ██╗███████╗██╗ ██╗██╗ ██████╗██╗ ███████╗███████╗ ██████╗ █████╗ ████████╗ █████╗
--██║ ██║██╔════╝██║ ██║██║██╔════╝██║ ██╔════╝██╔════╝ ██╔══██╗██╔══██╗╚══██╔══╝██╔══██╗
--██║ ██║█████╗ ███████║██║██║ ██║ █████╗ ███████╗ ██║ ██║███████║ ██║ ███████║
--╚██╗ ██╔╝██╔══╝ ██╔══██║██║██║ ██║ ██╔══╝ ╚════██║ ██║ ██║██╔══██║ ██║ ██╔══██║
-- ╚████╔╝ ███████╗██║ ██║██║╚██████╗███████╗███████╗███████║ ██████╔╝██║ ██║ ██║ ██║ ██║
-- ╚═══╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝╚══════╝╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
Config.VehiclesData = {
ENABLE = true, --Do you want to allow the script to grab vehicles data ( ESX: from the 'vehicles' table in the database / QBCORE: from the shared.lua ).
Vehicledatabase_Tablenames = { --FOR ESX ONLY. The 'vehicles' database table is common in esx servers, but we will repurpose this to store information for us grab vehicle data from.
[1] = 'vehicles', --As some people use multiple vehicles tables for donator vehicles, emergency vehicles etc, this is optional for those people.
--[2] = 'vehicles2',
--[3] = 'add_more_here',
},
}
--██╗ ██╗███████╗██╗ ██╗███████╗ █████╗ ███╗ ██╗██████╗ ██████╗ ██████╗ ███╗ ███╗███╗ ███╗ █████╗ ███╗ ██╗██████╗ ███████╗
--██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ██╔══██╗████╗ ██║██╔══██╗ ██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗ ██║██╔══██╗██╔════╝
--█████╔╝ █████╗ ╚████╔╝ ███████╗ ███████║██╔██╗ ██║██║ ██║ ██║ ██║ ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║ ██║███████╗
--██╔═██╗ ██╔══╝ ╚██╔╝ ╚════██║ ██╔══██║██║╚██╗██║██║ ██║ ██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║ ██║╚════██║
--██║ ██╗███████╗ ██║ ███████║ ██║ ██║██║ ╚████║██████╔╝ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║██║ ╚████║██████╔╝███████║
--╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝
Config.InteractWithRadar = {
ENABLE = true, --Do you want to allow player's interact with their radar UI?
command = 'radarsettings', --The chat command.
key = 'j', --The keypress.
}
Config.LockRadar = {
ENABLE = true, --Do you want to allow player's to lock the police radar from scanning?
command = 'radarlock',
key = 'o',
}
Config.ToggleRadar = {
ENABLE = true, --Do you want to allow player's to show/hide their radar UI?
command = 'radartoggle',
}
-- ██████╗ ████████╗██╗ ██╗███████╗██████╗
--██╔═══██╗╚══██╔══╝██║ ██║██╔════╝██╔══██╗
--██║ ██║ ██║ ███████║█████╗ ██████╔╝
--██║ ██║ ██║ ██╔══██║██╔══╝ ██╔══██╗
--╚██████╔╝ ██║ ██║ ██║███████╗██║ ██║
-- ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
function Round(cd) return math.floor(cd+0.5) end
function Trim(cd) return cd:gsub('%s+', '') end
-- █████╗ ██╗ ██╗████████╗ ██████╗ ██████╗ ███████╗████████╗███████╗ ██████╗████████╗
--██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
--███████║██║ ██║ ██║ ██║ ██║ ██║ ██║█████╗ ██║ █████╗ ██║ ██║
--██╔══██║██║ ██║ ██║ ██║ ██║ ██║ ██║██╔══╝ ██║ ██╔══╝ ██║ ██║
--██║ ██║╚██████╔╝ ██║ ╚██████╔╝ ██████╔╝███████╗ ██║ ███████╗╚██████╗ ██║
--╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝
-----DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
if Config.Framework == 'auto_detect' then
if GetResourceState(Config.FrameworkTriggers.esx.resource_name) == 'started' then
Config.Framework = 'esx'
elseif GetResourceState(Config.FrameworkTriggers.qbcore.resource_name) == 'started' then
Config.Framework = 'qbcore'
elseif GetResourceState('vrp') == 'started' then
Config.Framework = 'vrp'
else
Config.Framework = 'standalone'
end
if Config.Framework == 'esx' or Config.Framework == 'qbcore' then
for c, d in pairs(Config.FrameworkTriggers[Config.Framework]) do
Config.FrameworkTriggers[c] = d
end
Config.FrameworkTriggers.esx, Config.FrameworkTriggers.qbcore = nil, nil
end
end
if Config.Notification == 'auto_detect' then Config.Notification = Config.Framework if Config.Notification == 'standalone' or Config.Notification == 'vrp' then Config.Notification = 'chat' end end
if Config.Database == 'auto_detect' then
if GetResourceState('mysql-async') == 'started' then
Config.Database = 'mysql'
elseif GetResourceState('ghmattimysql') == 'started' then
Config.Database = 'ghmattimysql'
elseif GetResourceState('oxmysql') == 'started' then
Config.Database = 'oxmysql'
end
end
if GetResourceState('Badger_Discord_API') ~= 'started' then
Config.AllowList.Discord.ENABLE = false
end
if Config.Framework == 'esx' or Config.Framework == 'qbcore' or Config.Framework == 'vrp' then
Config.AllowList.Framework.ENABLE = true
else
Config.AllowList.Framework.ENABLE = false
end
if Config.Framework ~= 'esx' and Config.Framework ~= 'qbcore' then
Config.VehiclesData.ENABLE = false
elseif Config.Framework == 'qbcore' then
Config.VehiclesData.ENABLE = true
end
-----DO NOT TOUCH ANYTHING ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
```
\==Config UI
```javascript
let reasonList = [
"Drugs",
"Firearms",
"Gang",
"Murder",
"Robbery",
"Speeding"
]
```
\==Locales
\==Locales UI
:::
---
---
url: /paid-scripts/vehicle-control.md
description: >-
FiveM vehicle control system with remote door locks, engine control, window
control, extras management, and lightbar toggles. Supports ESX, QBCore, and
standalone frameworks.
---
# Vehicle Control
[**Buy Here**](https://codesign.pro/product/5206820)
[**FiveM Forums Post**](https://forum.cfx.re/t/paid-codesign-vehicle-control/4992984)
[**YouTube Showcase Video**](https://youtu.be/Bwc4aZNVqtM)
[**YouTube Walkthrough Video**](https://www.youtube.com/watch?v=l_jCRtMMGAQ)
## INSTALLATION GUIDE
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
**2.** Unzip the `cd_vehiclecontrol.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_vehiclecontrol`. 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_vehiclecontrol
```
### Step 1 - Fxmanifest
Depending on your framework and dependencies, you may need to make some changes to the **`[cd_vehiclecontrol/fxmanifest.lua]`**. We have made this easier by [commenting ](https://i.imgur.com/bbb0dam.png)on the lines you possibly need to change.
### Step 2 - Configure Resource
You **MUST** read all configurable options inside the **`[cd_vehiclecontrol/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [”commented out help text”](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections at the top of the `config.lua`. Everything else is optional.**
> [**NEW: Auto Framework Detect!**](https://i.imgur.com/zNW8Kpg.png)
>
> Introducing our new 'auto\_detect' feature! It automatically identifies your Framework and applies the appropriate default settings.
### Step 3 - Configure Key Binds
Before starting this resource on your main/live server, we highly advise you to configure your key binds because this resource uses [Fivem's Key Mapping](../../helpful-guides/register-key-mapping.md).
**Where can I configure my key binds?**
You can configure key binds in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section near the bottom of the **`[cd_vehiclecontrol/configs/config.lua]`**.
> **Why do I need to do this?**
>
> Well long story short;- once a player has joined your server with this resource running you can no longer force change their key binds for this resource through the config.lua, only they can change it in the in-game [pause menu settings](https://imgur.com/GRWKelR). Although it will change for the players who join after you have changed it.
>
> The benefit of this system is that it's much more optimised and players can easily change their key binds on keyboards or controllers. You can also check out the [Default Keybinds](./#default-keybinds) for this resource.
### Step 4 - Vehicle Lock
> **What is the vehicle lock display?**
>
> This clickable button on the UI allows players to lock/unlock their vehicle from the UI itself.
**Do you want to use the vehicle lock display?**
**NO =** You can skip this step.
**YES =** A few small modifications are required; read below for more information.
1. Enable **`Config.VehicleLock`** in the `[configs/config.lua]` file.
2. [This screenshot](https://i.imgur.com/iMGvCDr.png) shows the 2 functions that must be modified in the `[configs/client_customise_me.lua]` file. Read the [”commented out help text”](https://i.imgur.com/QCja8UZ.png) for further information.
## ::: info Do you use cd\_garage and its built-in keys feature?
Then you don't need to make any changes. We have already pre-configured this for you.
:::
## INFORMATION
### Default Key Binds
These keys can be modified and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section of the `[configs/config.lua]`.
Please make sure you understand how [Key Mapping](https://docs.codesign.pro/coding-information/register-key-mapping) works.
| Key | Description |
| ------- | ------------------------------ |
| **`K`** | Open the vehicle control's UI. |
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| Command | Description |
| ----------------- | ------------------------------ |
| **`/vehcontrol`** | Open the vehicle control's UI. |
### Events
These events are completely optional; you can use them if needed.
::::tabs
\==client-side to client-side
**Open the UI**
```lua [Open the vehicle control's UI.]
TriggerEvent('cd_vehiclecontrol:OpenUI')
```
**Close the UI**
```lua [Close the vehicle control's UI.]
TriggerEvent('cd_vehiclecontrol:CloseUI')
```
\==server-side to client-side
**Open the UI**
```lua [Open the vehicle control's UI.]
TriggerClientEvent('cd_vehiclecontrol:OpenUI', source)
```
**Close the UI**
```lua [Close the vehicle control's UI.]
TriggerClientEvent('cd_vehiclecontrol:CloseUI', source)
```
::::
## Common Issues
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
🔔 **Folder Name** Make sure the name of the folder is `cd_vehiclecontrol`.
🔔 **Encrypted Files** Do not edit the encrypted files in any way.
> **Some extras such as lightbars not working?**
>
> eg., the lightbar extra for example can be toggled off, but when toggled back on it's not visible.
>
> ```
> ✔️ Sometimes extras such as lightbars will only be visible if the car is fully repaired first.
>
> To fix this you can set Config.Extras.extras_workaround_fix to true in the configs/config.lua.
>
> There is a downside with this though; because to overcome this issue we fully repair the vehicle. After the extra has been enabled we re-aply most of the damage such as broken doors, broken windows and popped tyres. But we are unable to re-apply the minor visual body damage such as dints, bumps or scratches. So some players may abuse this to repair minor visual body damage on their vehicles.
> ```
## Error Codes
If you see an error code not listed below, please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).
::::tabs
\==Server
N/A
\==Client
**5467** - This means the GetVehicleLockState() function in the configs/client\_customise\_me.lua is is not returning what the script expects. It should return either “locked” or “unlocked” as a string.
**9833** - This means the DoesPlayerHaveKeys() function in the configs/client\_customise\_me.lua is not returning what the script expects. It should be returning either true or false as a boolean. This usually happens when you have enabled the Config.VehicleLock in the config, but you have not edited the function to work with your vehicle lock script.
::::
## Changelog
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
### v1.0.0
### v1.0.1
**Changelog:**
## ::: tip Added
* Added a config option to disable the use of toggling liveries, extras or neons on the ui.
* Disabled the option to toggle extras when in a helicopter.
:::
### v1.0.2
**Changelog:**
## ::: tip Added
* **Job-restricted Usage:** You can allow all players to be able to use this part of the UI to toggle extras and liveries or you can restrict it to certain jobs only *(you can choose multiple jobs)*.
* **Location Restricted Usage:** You can allow players to be able to use this part of the UI to toggle extras and liveries anywhere on the map or you can restrict it to certain areas around the map *(you can choose multiple locations)*.
* **Note:** The 2 usage-restricting features above^^ can work independently of each other or in combination with each other; (for example., only police and ambulance jobs can use the UI to toggle extras but also they can only do this in certain areas around the map.)
* **Bugged Extras (lightbars) Fix 1:** If your vehicle is in full health you will now be able to toggle on the bugged extras such as lightbars.
* **Bugged Extras (lightbars) Fix 2:** Added a new config option `Config.Extras.extras_workaround_fix` which will also fix this issue on vehicles that are damaged but do have small side effects [#Common Issues](./#common-issues).
:::
## ::: warning Edited
* Changed the default key from `N` to `K` as n had some issues with the chat.
:::
### v1.0.3
## ::: tip Added
* **Auto Framework Detection** - We have added a new feature we are calling '**auto\_detect**', which will automatically identify your framework resource and framework notifications and apply the appropriate default settings.
* Added the option to restrict the use of extras and liveries to certain vehicle models.
* Added a config option to blacklist neon light colours. By default, all cars have neons enabled and default colours, so we will disable the default colours and only allow custom ones.
* Added a config option to prevent auto seat shuffle.
:::
## ::: info Updated
* Restricted passengers from using the extras, liveries, engine toggle, indicators and neons.
* Added debug prints.
:::
## ::: warning Edited
* Fixed the "no NUI callback captured" warnings.
* Fixed some minor bugs with the UI.
* Fixed the toggle engine being visible even if you don't have keys.
:::
### v1.0.4
## ::: tip Added
* Added the ability to use the vehicle control UI when standing outside the vehicle. However, this does have limited options when compared to sitting inside the vehicle.
* Added `Config.Extras.disable_extras_in_heli` to allow servers to choose whether they want to disable extras in helicopters (some servers wanted this disabled due to players removing the helicopter blades).
* Added a function `EngineToggled()` to the client\_customise\_me, which is triggered every time the engine is toggled on/off in a vehicle. This is optional and can be used if needed for compatibility with other resources.
* Added pre-configured notifications for multiple notification resources.
:::
### v1.0.5
```bash [Files Changed]
fxmanifest.lua
client/client.lua
```
**Changelog:**
## ::: warning Fixed
* Fixed extras not working in vehicles.
:::
### v1.0.6
```bash [Files Changed]
fxmanifest.lua
client/client.lua
```
**Changelog:**
## ::: tip Added
* We now grab livery's from the mod kit as well as the standard get livery native.
* Clicking the livery you currently have enabled will remove it and set the vehicle to have no livery (or the default livery, depending on the vehicle).
:::
### v1.0.7
```bash [Files Changed]
fxmanifest.lua
client/client.lua
client/functions.lua
HTML (FULL FOLDER)
```
**Changelog:**
## ::: tip Added
* Added support for bomb bay doors.
:::
---
---
url: /paid-scripts/vehicle-control/configs-locales-and-sql.md
description: >-
Configuration, locales, and SQL setup for cd_vehiclecontrol. Includes
framework auto-detect, vehicle lock, extras, key binds, and UI customization
settings.
---
# Configs, Locales & SQL
::::tabs
\==Config
```lua
Config = {}
function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
--WHAT DOES 'auto_detect' DO?
--The 'auto_detect' feature automatically identifies your framework and applies the appropriate default settings.
Config.Framework = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', only ESX, QBCore and Standalone frameworks will be detected. Use 'other' for custom frameworks.
Config.Notification = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', only ESX, QBCore, cd_notifications, okokNotify, ps-ui and ox_lib notifications will be detected. Use 'other' for custom notification resources.
Config.Language = 'EN' --[ 'EN' / 'DE' / 'NL' ] You can add your own locales to Locales.lua, but be sure to update the Config.Language to match it.
Config.FrameworkTriggers = {
esx = { --If you have modified the default event names in the es_extended resource, change them here.
resource_name = 'es_extended',
main = 'esx:getSharedObject',
load = 'esx:playerLoaded',
job = 'esx:setJob'
},
qbcore = { --If you have modified the default event names in the qb-core resource, change them here.
resource_name = 'qb-core',
main = 'QBCore:GetObject',
load = 'QBCore:Client:OnPlayerLoaded',
job = 'QBCore:Client:OnJobUpdate',
duty = 'QBCore:Client:SetDuty'
}
}
--██╗███╗ ███╗██████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗████████╗
--██║████╗ ████║██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝
--██║██╔████╔██║██████╔╝██║ ██║██████╔╝ ██║ ███████║██╔██╗ ██║ ██║
--██║██║╚██╔╝██║██╔═══╝ ██║ ██║██╔══██╗ ██║ ██╔══██║██║╚██╗██║ ██║
--██║██║ ╚═╝ ██║██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║██║ ╚████║ ██║
--╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
Config.Debug = false --To enable debug prints.
Config.UseFrameworkDutySystem = false --Do you want to use your frameworks (esx/qbcore) built-in duty system?
--███╗ ███╗ █████╗ ██╗███╗ ██╗
--████╗ ████║██╔══██╗██║████╗ ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
--╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
Config.Liveries = {
ENABLE = true, --Do you want the vehicle liveries feature to be enabled on the UI? (if set to false none of the options below will work).
Job_Restricted = {
ENABLE = false, ----Do you want the vehicle liveries feature to only be usable by certain jobs?
job_table = {'police', 'ambulance', } --If the line above^ is set to true, choose which jobs can use this.
},
Location_Restricted = {
ENABLE = false, --Do you want the vehicle liveries feature to only be usable within a radius of certain locations?
location_table = { --If the line above^ is set to true, choose which locations can use this.
[1] = {coords = vec3(450.19, -1021.18, 28.4), radius = 20}, --MRPD
--[2] = {coords = vec3(0.0, 0.0, 0.0), radius = 5},
}
},
Vehicle_Restricted = {
ENABLE = false, --Do you want the vehicle liveries feature to only be usable by certain vehicles?
vehicle_table = {'police', 'ambulance', } --If the line above^ is set to true, choose which vehicles can use this.
},
}
Config.Extras = {
ENABLE = true, --Do you want the vehicle extras feature to be enabled on the UI? (if set to false none of the options below will work).
extras_workaround_fix = true, --Sometimes extras such as lightbars will only be visible if the car is fully repaired first. So to fix this we repair the car and then re-aply the damage - READ MORE HERE https://docs.codesign.pro/paid-scripts/vehicle-control#common-issues.
max_extras = 20, --Whats the maximum amount of extras your vehicles have?
disable_extras_in_heli = false, --Do you want to disable the extras feature for helicopters? (this was requested due to people removing the helis blades lol).
Job_Restricted = {
ENABLE = false, --Do you want the vehicle extras feature to only be usable by certain jobs?
job_table = {'police', 'ambulance', } --If the line above^ is set to true, choose which jobs can use this.
},
Location_Restricted = {
ENABLE = false, ----Do you want the vehicle extras feature to only be usable within a radius of certain locations?
location_table = { --If the line above^ is set to true, choose which locations can use this.
[1] = {coords = vec3(450.19, -1021.18, 28.4), radius = 20}, --MRPD
--[2] = {coords = vec3(0.0, 0.0, 0.0), radius = 5},
}
},
Vehicle_Restricted = {
ENABLE = false, --Do you want the vehicle extras feature to only be usable by certain vehicles?
vehicle_table = {'police', 'ambulance', } --If the line above^ is set to true, choose which vehicles can use this.
}
}
Config.Neons = {
ENABLE = true, --Do you want to allow your players to toggle neon lights using the UI?
blacklisted_colours = { --By default all cars have neons enabled and have default colours, so we will disable the default colours and only allow custom colours.
{r = 255, g = 0, b = 255}, --purple (one of the default colours).
{r = 255, g = 255, b = 255}, --white (one of the default colours).
--{r = 0, g = 0, b = 0}, --You can add more here if you need.
}
}
Config.VehicleLock = {
ENABLE = false, --Do you want to allow players to lock/unlock vehicles and view if the vehicle is locked? (this is not a vehicle lock system, it depends on external lock scripts).
disable_doors_when_locked = true --Do you want to disable opening the doors when the vehicle is locked?
}
Config.DisabledKeys = { --A list of keys which are disabled while you interact with the UI.
1,2,21,24,25,47,58,75,106,140,141,142,143,245,257,263,264,
}
Config.BlacklistedVehicleClass = { --A list of vehicle classes which can't use the UI. (https://docs.fivem.net/natives/?_0x29439776AAA00A62).
13, --bicycles
}
Config.IndicatorSync = false --Do you want indicator's to be synced server side to all players? (this will consume slightly more resources).
Config.PreventAutoSeatShuffle = true --Do you want to prevent the auto seat shuffle in the vehicle? (This will consume more resources).
--██╗ ██╗███████╗██╗ ██╗███████╗ █████╗ ███╗ ██╗██████╗ ██████╗ ██████╗ ███╗ ███╗███╗ ███╗ █████╗ ███╗ ██╗██████╗ ███████╗
--██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ██╔══██╗████╗ ██║██╔══██╗ ██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗ ██║██╔══██╗██╔════╝
--█████╔╝ █████╗ ╚████╔╝ ███████╗ ███████║██╔██╗ ██║██║ ██║ ██║ ██║ ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║ ██║███████╗
--██╔═██╗ ██╔══╝ ╚██╔╝ ╚════██║ ██╔══██║██║╚██╗██║██║ ██║ ██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║ ██║╚════██║
--██║ ██╗███████╗ ██║ ███████║ ██║ ██║██║ ╚████║██████╔╝ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║██║ ╚████║██████╔╝███████║
--╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝
Config.OpenUI = {
ENABLE = true, --Do you want to allow player's open the vehicle control UI?
command = 'vehcontrol', --The chat command.
key = 'k' --The keypress.
}
-- ██████╗ ████████╗██╗ ██╗███████╗██████╗
--██╔═══██╗╚══██╔══╝██║ ██║██╔════╝██╔══██╗
--██║ ██║ ██║ ███████║█████╗ ██████╔╝
--██║ ██║ ██║ ██╔══██║██╔══╝ ██╔══██╗
--╚██████╔╝ ██║ ██║ ██║███████╗██║ ██║
-- ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
function Round(cd) return math.floor(cd+0.5) end
function Trim(cd) return cd:gsub('%s+', '') end
-- █████╗ ██╗ ██╗████████╗ ██████╗ ██████╗ ███████╗████████╗███████╗ ██████╗████████╗
--██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
--███████║██║ ██║ ██║ ██║ ██║ ██║ ██║█████╗ ██║ █████╗ ██║ ██║
--██╔══██║██║ ██║ ██║ ██║ ██║ ██║ ██║██╔══╝ ██║ ██╔══╝ ██║ ██║
--██║ ██║╚██████╔╝ ██║ ╚██████╔╝ ██████╔╝███████╗ ██║ ███████╗╚██████╗ ██║
--╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝
-----DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
if Config.Framework == 'auto_detect' then
if GetResourceState(Config.FrameworkTriggers.esx.resource_name) == 'started' then
Config.Framework = 'esx'
elseif GetResourceState(Config.FrameworkTriggers.qbcore.resource_name) == 'started' then
Config.Framework = 'qbcore'
else
Config.Framework = 'standalone'
end
if Config.Framework == 'esx' or Config.Framework == 'qbcore' then
for c, d in pairs(Config.FrameworkTriggers[Config.Framework]) do
Config.FrameworkTriggers[c] = d
end
Config.FrameworkTriggers.esx, Config.FrameworkTriggers.qbcore = nil, nil
end
end
if Config.Notification == 'auto_detect' then
if GetResourceState('cd_notifications') == 'started' then
Config.Notification = 'cd_notifications'
elseif GetResourceState('okokNotify') == 'started' then
Config.Notification = 'okokNotify'
elseif GetResourceState('ps-ui') == 'started' then
Config.Notification = 'ps-ui'
elseif GetResourceState('ox_lib') == 'started' then
Config.Notification = 'ox_lib'
end
end
-----DO NOT TOUCH ANYTHING ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
```
\==Locales
\==Locales UI
::::
---
---
url: /paid-scripts/car-hud.md
description: >-
A highly customizable FiveM car HUD with speedometer, RPM gauge, fuel gauge,
seatbelt system, cruise control, and configurable key binds. Supports ESX,
QBCore, and standalone frameworks.
---
# Car HUD
[**Buy Here**](https://codesign.pro/product/4211752)
[**FiveM Forums Post**](https://forum.cfx.re/t/release-paid-codesign-highly-customisable-car-hud/1885401)
[**YouTube Showcase Video**](https://youtu.be/bG1p46QYo_g)
## INSTALLATION GUIDE
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Keymaster](https://portal.cfx.re).
**2.** Unzip the `cd_carhud.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_carhud`. 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_carhud
```
### Step 1 - Configure Resource
You **MUST** read all configurable options inside the **`[cd_carhud/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [commented out help text](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections at the top of the `config.lua`. Everything else is optional.**
> [**NEW: Auto Framework Detect!**](https://i.imgur.com/zNW8Kpg.png)
>
> Introducing our new 'auto\_detect' feature! It automatically identifies your framework and applies the appropriate default settings.
### Step 2 - Configure Key Binds
Before starting this resource on your main/live server, we highly advise configuring your key binds because this resource uses [Fivem's Key Mapping](../../helpful-guides/register-key-mapping.md).
**Where can I configure my key binds?**
You can configure key binds in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section near the bottom of the **`[cd_carhud/configs/config.lua]`**.
> **Why do I need to do this?**
>
> Well long story short;- once a player has joined your server with this resource running you can no longer force change their key binds for this resource through the config.lua, only they can change it in the in-game [pause menu settings](https://imgur.com/GRWKelR). Although it will change for the players who join after you have changed it.
>
> The benefit of this system is that it's much more optimised and players can easily change their key binds on keyboards or controllers. You can also check out the [Default Keybinds](./#default-keybinds) for this resource.
### Step 4 - Fuel Script
Configure `Config.FuelScript` in the config.lua.
**If you don't use any of the 3 pre-configured fuel scripts**, you will need set `Config.FuelScript` to **'other'** and add your code to get a vehicles fuel level from your fuel script into the `GetFuel` function in `configs/client_customise_me.lua`.
```lua
function GetFuel(vehicle)
if Config.FuelScript == 'none' then
return GetVehicleFuelLevel(vehicle) --Default FiveM native example.
elseif Config.FuelScript == 'legacyfuel' then
return DecorGetFloat(vehicle, '_FUEL_LEVEL') --Legacy Fuel example.
elseif Config.FuelScript == 'frfuel' then
return math.ceil((100 / GetVehicleHandlingFloat(vehicle, "CHandlingData", "fPetrolTankVolume")) * math.ceil(GetVehicleFuelLevel(vehicle))) --FRFuel example.
elseif Config.FuelScript == 'other' then
--Add your own code here to get a vehicles fuel.
end
end
```
##
## INFORMATION
### Default Keybinds
These keys can be modified and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section of the `[configs/config.lua]`.
Please make sure you understand how [Key Mapping](https://docs.codesign.pro/coding-information/register-key-mapping) works.
| **Key** | **Description** |
| ------- | ---------------------- |
| **`Y`** | Open the settings UI. |
| **`B`** | Toggle the seatbelt. |
| **`=`** | Toggle cruise control. |
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| **Command** | **Description** |
| ------------------- | --------------------------------- |
| **`/carhud`** | Open the settings UI. |
| **`/seatbelt`** | Toggle the seatbelt. |
| **`/carhudtoggle`** | Toggle the car hud UI visibility. |
### Events
These events are completely optional; you can use them if needed.
::: tabs
\= client-side to client-side
**Open the settings UI**
```lua
TriggerEvent('cd_carhud:OpenSettingsUI')
```
**Toggle the seatbelt**
```lua
TriggerEvent('cd_carhud:ToggleSeatbelt')
```
**Toggle cruise control**
```lua
TriggerEvent('cd_carhud:ToggleCruise')
```
Toggle the car hud UI visibility
```lua
TriggerEvent('cd_carhud:ToggleHud')
```
\= server-side to client-side
**Open the settings UI**
```lua
TriggerClientEvent('cd_carhud:OpenSettingsUI', source)
```
**Toggle the seatbelt**
```lua
TriggerClientEvent('cd_carhud:ToggleSeatbelt', source)
```
**Toggle cruise control**
```lua
TriggerClientEvent('cd_carhud:ToggleCruise', source)
```
Toggle the car hud UI visibility
```lua
TriggerClientEvent('cd_carhud:ToggleHud', source)
```
:::
### FAQ
#### Can I change the default UI settings?
Yes, you can; this can be done from `configs/ui_config.js`. After editing the default settings, you must click the `Default Values` button on the UI to apply the default values.
#### Optimization?
The balance between performance and optimization is something that you need to decide. You can't have the resource performing at its peak by updating the UI every frame without affecting the optimization. A middle ground is set by default so you can get the best of both worlds with little compromise.
* **Seat belt (0.03*****ms*****)** - By default, the thread for the seat belt in `client/functions.lua` consumes the majority of the ms. You can disable the seatbelt completely by setting `Config.Seatbelt.ENABLE` to false.
* **CarHUD UI (0.02*****ms*****)** - The default refresh rate value is 500ms. But you can set this default value for all players at the bottom of the `configs/ui_config.js`. By default, the UI with all elements and settings enabled will use 0.02ms during use. Each player can also modify this value; lowering it will make the UI more responsive at the cost of increased resource usage.
#### Will the settings save after I relog?
Yes, the settings will save after you relog and after a server restart.
#### How do I use the indicators/turn signals?
The car HUD itself does not include this, but you can use an existing resource that uses these [FiveM natives](https://runtime.fivem.net/doc/natives/?_0xB5D45264751B7DF0) such as [this](https://forum.cfx.re/t/release-luxart-vehicle-control/17304).
## COMMON ISSUES
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder is `cd_carhud.`
**Encrypted Files** Do not edit the encrypted files in any way.
## ERROR CODES
If you see an error code not listed below, please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).
::: tabs
\= Server
N/A
\= Client
**3216855** - The value of the Refresh Timer in the settings UI is nil, enter a number and it will be fixed.
**88146545** - Either the Config.Language you have chosen does not have a matching set of locales in the Locales.lua or one of the locales in the Locales.lua is missing/has been renamed. Whatever you changed, revert it and try again.
**30165847** - The format of the Notif function is wrong, what ever you have changed, revert the change and try again.
:::
## CHANGELOG
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
::::tabs
\==v4.0.1
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
## ::: tip Added
* **Auto Framework Detection** - We have added a new feature we are calling '**auto\_detect**', which will automatically identify your framework and apply the appropriate default settings.
* Added the option to display debug prints.
:::
## ::: warning Fixed
* Fixed the rpm not being 0 when the engine is off.
:::
\==v4.0.0
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
## ::: danger **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).**
:::
\== v3.0.0
v3.0.0 - v3.0.6
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: tip Added
* Added cruise control.
* Added a command to toggle the carhud visibility (also an option to hide the minimap visibility within this when the carhud visibility is disabled).
* Added compass
* Compass can be moved around / enabled disabled.
* Compass heading can be hidden / shown.
* Compass caret can be hidden / shown.
:::
::::
---
---
url: /paid-scripts/car-hud/configs-locales-and-sql.md
description: >-
Configuration, locales, and UI settings for cd_carhud. Includes framework
auto-detect, fuel script integration, gauge colors, dashboard elements,
seatbelt, cruise control, and key bind settings.
---
# Configs, Locales & SQL
::: tabs
\= Config
```lua
Config = {}
function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
--WHAT DOES 'auto_detect' DO?
--The 'auto_detect' feature automatically identifies your framework and applies the appropriate default settings.
Config.Framework = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', only ESX, QBCore and Standalone frameworks will be detected. Use 'other' for custom frameworks.
Config.Notification = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', the default notifications for your framework will be used. Use 'other' for custom notification resources.
Config.Language = 'EN' --[ 'EN' / 'BG' / 'CZ' / 'DE' / 'ES' / 'FI' / 'FR' / 'NL' / 'PT' / 'SE' / 'SK' ] You can add your own locales to Locales.lua, but be sure to update the Config.Language to match it.
Config.FrameworkTriggers = {
esx = { --If you have modified the default event names in the es_extended resource, change them here.
resource_name = 'es_extended',
main = 'esx:getSharedObject'
},
qbcore = { --If you have modified the default event names in the qb-core resource, change them here.
resource_name = 'qb-core',
main = 'QBCore:GetObject'
}
}
--██╗███╗ ███╗██████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗████████╗
--██║████╗ ████║██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝
--██║██╔████╔██║██████╔╝██║ ██║██████╔╝ ██║ ███████║██╔██╗ ██║ ██║
--██║██║╚██╔╝██║██╔═══╝ ██║ ██║██╔══██╗ ██║ ██╔══██║██║╚██╗██║ ██║
--██║██║ ╚═╝ ██║██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║██║ ╚████║ ██║
--╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
Config.FuelScript = 'none' --[ 'none' / 'legacyfuel' / 'frfuel' / 'other' ] Choose your fuel script so we can get a vehicles fuel to display on the carhud UI.
Config.Debug = false --To enable debug prints.
--███╗ ███╗ █████╗ ██╗███╗ ██╗
--████╗ ████║██╔══██╗██║████╗ ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
--╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
Config.DisableExitingVehicle = false --Do you want to disable exiting the vehicle when the seatbelt is enabled? (If this is enabled, this will increase the ms usage slightly).
Config.HideMiniMapOnFootOnFoot = false --Do you want the mini-map to be hidden when the player is on foot, and only show when a player is in a vehicle? (if disabled the mini-map will always be visible).
--██╗ ██╗███████╗██╗ ██╗███████╗ █████╗ ███╗ ██╗██████╗ ██████╗ ██████╗ ███╗ ███╗███╗ ███╗ █████╗ ███╗ ██╗██████╗ ███████╗
--██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ██╔══██╗████╗ ██║██╔══██╗ ██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗ ██║██╔══██╗██╔════╝
--█████╔╝ █████╗ ╚████╔╝ ███████╗ ███████║██╔██╗ ██║██║ ██║ ██║ ██║ ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║ ██║███████╗
--██╔═██╗ ██╔══╝ ╚██╔╝ ╚════██║ ██╔══██║██║╚██╗██║██║ ██║ ██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║ ██║╚════██║
--██║ ██╗███████╗ ██║ ███████║ ██║ ██║██║ ╚████║██████╔╝ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║██║ ╚████║██████╔╝███████║
--╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝
Config.Settings = {
ENABLE = true, --Do you want to allow player's to use the settings UI?
command = 'carhud', --The chat command.
key = 'y' --The key to press.
}
Config.Seatbelt = {
ENABLE = true, --Do you want to use the built-in seatbelt?
command = 'seatbelt',
key = 'b',
eject = true, --Do you want player's to be ejected from the vehicle when they crash hard enough?
ragdoll = true, --Do you want player's to ragdoll for a short time after being ejected from a vehicle?
tyrepop = true, --Do you want a random tyre to pop when they crash hard enough?
}
Config.Cruise = {
ENABLE = true, --Do you want to use the built-in cruise control?
command = 'cruise',
key = 'equals'
}
Config.ToggleCarhud = {
ENABLE = true, --Do you want to allow player's to show/hide their carhud UI?
command = 'carhudtoggle',
minimap = true, --Do you want the map to be hidden while the main carhud UI is hidden?
}
-- █████╗ ██╗ ██╗████████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗████████╗
--██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
--███████║██║ ██║ ██║ ██║ ██║ ██║ ██║█████╗ ██║ █████╗ ██║ ██║
--██╔══██║██║ ██║ ██║ ██║ ██║ ██║ ██║██╔══╝ ██║ ██╔══╝ ██║ ██║
--██║ ██║╚██████╔╝ ██║ ╚██████╔╝ ██████╔╝███████╗ ██║ ███████╗╚██████╗ ██║
--╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝
-----DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
if Config.Framework == 'auto_detect' then
if GetResourceState(Config.FrameworkTriggers.esx.resource_name) == 'started' then
Config.Framework = 'esx'
elseif GetResourceState(Config.FrameworkTriggers.qbcore.resource_name) == 'started' then
Config.Framework = 'qbcore'
else
Config.Framework = 'standalone'
end
if Config.Framework == 'esx' or Config.Framework == 'qbcore' then
for c, d in pairs(Config.FrameworkTriggers[Config.Framework]) do
Config.FrameworkTriggers[c] = d
end
Config.FrameworkTriggers.esx, Config.FrameworkTriggers.qbcore = nil, nil
end
end
if Config.Notification == 'auto_detect' then Config.Notification = Config.Framework if Config.Notification == 'standalone' then Config.Notification = 'chat' end end
-----DO NOT TOUCH ANYTHING ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
```
\= Config UI
```javascript
// These are the default values for carhud
// Make sure you save a copy of this file in case you mess something up.
// Do not edit things you aren't sure about, instead ask a question on Codesign Discord and someone will respond.
let settings = {
gauges:{
elements:{ // Identifiers of elements
fuel:"#fuel",
fuel_bg:"#fuelFill",
speed:"#speed",
speed_bg:"#speedFill",
rpm:"#rpm",
rpm_bg:"#rpmFill"
},
units:"MPH", // Default units
display:{ // Default display values for gauges
fuel:true,
speed:true,
rpm:true,
},
color:{ // Default colors of bars
speed:["#ffba08", "#faa307", "#f48c06", "#f48c06", "#e85d04", "#dc2f02", "#d00000","#9d0208", "#6a040f", "#370617"],
rpm:["#d3d3d3", "#b1a7a6", "#e5383b", "#ba181b", "#660708"],
fuel:["#ffba08", "#ffba08"]
}
},
dashboard:{
elements:{ // Identifiers of dashboard elements
main:"#infoCluster",
left:"#leftIndicatorDisplay",
right:"#rightIndicatorDisplay",
seatbelt:"#seatbeltDisplay",
engine:"#engineDisplay",
fuel:"#fuelDisplay",
cruisecontrol:"#ccDisplay",
lowbeam:"#lowBeamDisplay",
highbeam:"#highBeamDisplay"
},
engineAlert:10, // Default engine alert
fuelAlert:20, // Default fuel alert
display:true, // Display of gauges
individual:{
left:true,
engine:true,
seatbelt:true,
fuel:true,
cruisecontrol:true,
lowbeam:true,
highbeam:true,
right:true
}
},
streetCompass:{
elements:{
street:"#streetName",
compass:"#compass",
heading:"#compass-current-number",
caret:"#compass-current-caret"
},
display:{ // Display of street
street:true,
compass:true,
heading:true,
caret:true
}
},
size:{
fuel:{
base:150, // Base size of fuel gauge
scale:1, // Do not change
},
speed:{
base:150, // Base size of speed gauge
scale:1, // Do not change
font:[32, 16] // Base sizes of speed font, first is speed, second is unit (MPH/KMH)
},
rpm:{
base:100, // Base size of rpm gauge
scale:1, // Do not change
font:[16, 13.2] // Base sizes of rpm font, first is rpm value, second is rpm text (RPM)
},
dashboard:{
base:48,
scale:1,
padding:10
},
street:"20px", // Default street size, make sure you also change it in html
compass:{
scale:1 // Scale, 1 = 100%, 0.5 = 50%, 1.5 = 150%
},
},
position:{ // Default positions of elements
fuel:{
top:"0px",
left:"0px"
},
speed:{
top:"0px",
left:"0px"
},
rpm:{
top:"0px",
left:"0px"
},
dashboard:{
top:"0px",
left:"0px"
},
street:{
top:"0px",
left:"0px"
},
compass:{
top:"0px",
left:"0px"
}
},
refresh:500, // Default refresh rate, make sure you also change it in html (IN MILLISECONDS)
compass: {
display:true,
movement_scale: 2.66666666667, // 2.66666666667px = 1 heading [DO NOT CHANGE IF YOU DON'T KNOW WHAT YOU ARE DOING, IT WILL BREAK THE ACCURACY OF COMPASS]
background_position:1225, // N center
}
};
let default_settings = JSON.parse(JSON.stringify(settings));
```
\= Locales
\= Locales UI
\= SQL
N/A
:::
---
---
url: /paid-scripts/arm-wrestling.md
description: >-
A FiveM arm wrestling mini-game with configurable tables, spam-key gameplay,
chat commands, events, and usable items. Supports ESX, QBCore, and standalone
frameworks.
---
# Arm Wrestling
[**Buy Here**](https://codesign.pro/product/5382137)
[**FiveM Forums Post**](https://forum.cfx.re/t/paid-codesign-arm-wrestling/5010934)
[**YouTube Walkthrough Video**](https://youtu.be/YFwVRK7tfEQ)
## INSTALLATION GUIDE
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Portal](https://portal.cfx.re).
**2.** Unzip the `cd_armwrestling.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_armwrestling`. 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_armwrestling
```
### Step 1 - Configure Resource
You **MUST** read all configurable options inside the **`[cd_armwrestling/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [”commented out help text”](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections at the top of the `config.lua`. Everything else is optional.**
> [**NEW: Auto Framework Detect!**](https://i.imgur.com/zNW8Kpg.png)
>
> Introducing our new 'auto\_detect' feature! It automatically identifies your framework and applies the appropriate default settings.
## HOW TO USE
This resource is very easy to install and configure. Once the steps above are complete the rest is simple:
1. Use the [#Chat Command](./#chat-commands) to spawn an arm wrestling table.
2. Walk up to it and press E to join the game.
3. You will have to wait for another player, but once the other player joins, the countdown will start.
4. Spam the keys displayed on your screen.
##
## INFORMATION
### Default Key Binds
*This resource does not use key mapping; these keys are hard coded.*
| Key | Description |
| ------- | --------------------------------------------------------------- |
| **`E`** | Join a game at the closest table. |
| **`X`** | While waiting for another player this key will cancel the game. |
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| Command | Description |
| -------------------------- | ----------------------------------------------------------------- |
| **`/armwrestling_table`** | Spawn an arm wrestling table. |
| **`/armwrestling_delete`** | Delete the closest arm wrestling table *(within a small radius)*. |
### Events
These events are completely optional; you can use them if needed.
::: tabs
\= client-side to client-side
**Spawn an arm wrestling table**
Spawns the prop on your location.
```lua
TriggerEvent('cd_armwrestling:SpawnTable')
```
**Delete the closest arm wrestling table**
```lua
TriggerEvent('cd_armwrestling:DeleteTable')
```
\= server-side to client-side
**Spawn an arm wrestling table at your location**
```lua
TriggerClientEvent('cd_armwrestling:SpawnTable', source)
```
**Delete the closest arm wrestling table**
```lua
TriggerClientEvent('cd_armwrestling:DeleteTable', source)
```
:::
### Usable Items
Usable items can be renamed or disabled in the `[configs/config.lua]`.
| Item Name | Description |
| ------------------------ | ----------------------------- |
| **`armwrestling_table`** | Spawn an arm wrestling table. |
::: tabs
\= Add items on ESX
Run these SQL queries in your database.
```sql
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('armwrestling_table', 'Arm Wrestling Table', 1, 0, 1);
```
\= Add items on QBCore
Add these lines to \[qb-core/shared/items.lua].
```lua
['armwrestling_table'] = {['name'] = 'armwrestling_table', ['label'] = 'Arm Wrestling Table', ['weight'] = 500, ['type'] = 'item', ['image'] = 'armwrestling_table.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Spawn an arm wrestling table'},
```
:::
##
## COMMON ISSUES
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
🔔 **Folder Name** Make sure the name of the folder either `cd_armwrestling`.
🔔 **Encrypted Files** Do not edit the encrypted files in any way.
## CHANGELOG
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
::: tabs
\= v1.0.0
**Files Changed**:
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type**:
* \[x] Mandatory
* \[ ] Optional
\= v1.0.1
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[ ] Mandatory
* \[x] Optional
:::
---
---
url: /paid-scripts/arm-wrestling/configs-locales-and-sql.md
description: >-
Configuration, locales, and auto-detect setup for cd_armwrestling. Includes
framework detection, key spam settings, UI timings, available table props, and
admin permissions.
---
# Configs, Locales & SQL
::: tabs
\= Config
```lua
Config = {}
Config.Keys={['ESC']=322,['F1']=288,['F2']=289,['F3']=170,['F5']=166,['F6']=167,['F7']=168,['F8']=169,['F9']=56,['F10']=57,['~']=243,['1']=157,['2']=158,['3']=160,['4']=164,['5']=165,['6']=159,['7']=161,['8']=162,['9']=163,['-']=84,['=']=83,['BACKSPACE']=177,['TAB']=37,['Q']=44,['W']=32,['E']=38,['R']=45,['T']=245,['Y']=246,['U']=303,['P']=199,['[']=39,[']']=40,['ENTER']=18,['CAPS']=137,['A']=34,['S']=8,['D']=9,['F']=23,['G']=47,['H']=74,['K']=311,['L']=182,['LEFTSHIFT']=21,['Z']=20,['X']=73,['C']=26,['V']=0,['B']=29,['N']=249,['M']=244,[',']=82,['.']=81,['LEFTCTRL']=36,['LEFTALT']=19,['SPACE']=22,['RIGHTCTRL']=70,['HOME']=213,['PAGEUP']=10,['PAGEDOWN']=11,['DELETE']=178,['LEFTARROW']=174,['RIGHTARROW']=175,['TOP']=27,['DOWNARROW']=173,['NENTER']=201,['N4']=108,['N5']=60,['N6']=107,['N+']=96,['N-']=97,['N7']=117,['N8']=61,['N9']=118,['UPARROW']=172,['INSERT']=121}
function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
--WHAT DOES 'auto_detect' DO?
--The 'auto_detect' feature automatically identifies your framework and applies the appropriate default settings.
Config.Framework = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', only ESX, QBCore and Standalone frameworks will be detected. Use 'other' for custom frameworks.
Config.Notification = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', the default notifications for your framework will be used. Use 'other' for custom notification resources.
Config.Language = 'EN' --[ 'EN' ] You can add your own locales to Locales.lua, but be sure to update the Config.Language to match it.
Config.FrameworkTriggers = {
esx = { --If you have modified the default event names in the es_extended resource, change them here.
resource_name = 'es_extended',
main = 'esx:getSharedObject'
},
qbcore = { --If you have modified the default event names in the qb-core resource, change them here.
resource_name = 'qb-core',
main = 'QBCore:GetObject'
}
}
--██╗███╗ ███╗██████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗████████╗
--██║████╗ ████║██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝
--██║██╔████╔██║██████╔╝██║ ██║██████╔╝ ██║ ███████║██╔██╗ ██║ ██║
--██║██║╚██╔╝██║██╔═══╝ ██║ ██║██╔══██╗ ██║ ██╔══██║██║╚██╗██║ ██║
--██║██║ ╚═╝ ██║██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║██║ ╚████║ ██║
--╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
Config.Debug = false --To enable debug prints.
--███╗ ███╗ █████╗ ██╗███╗ ██╗
--████╗ ████║██╔══██╗██║████╗ ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
--╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
Config.KeySpam = {
key_change_interval = 5, --(in seconds) How often do you want the key you spam to change?
Keys = { --The list of possible keys to press.
[1] = {key = Config.Keys['E'], label = 'E'},
[2] = {key = Config.Keys['W'], label = 'W'},
[3] = {key = Config.Keys['A'], label = 'A'},
[4] = {key = Config.Keys['S'], label = 'S'},
[5] = {key = Config.Keys['D'], label = 'D'},
[6] = {key = Config.Keys['SPACE'], label = 'SPACE'},
--[7] = {key = Config.Keys['CHANGEME'], label = 'CHANGEME'},
}
}
Config.UISettings = { --The configurable settings for the countdown, victory and defeat UI's.
Countdown = {
start = 3, --The number from which the countdown will start
end_ = 1, --The number after which the UI will display "GO" and close.
volume = 0.2 --(0.01-1.0) The volume.
},
Victory = {
fire_interval = 1000, --(in miliseconds) Fires confetti after a win every x miliseconds.
stop_confetti = 3000, --(in miliseconds) Stops confetti after a win after x miliseconds
close_after = 5000, --(in miliseconds) Closes the UI after a win after x miliseconds.
volume = 0.2 --(0.01-1.0) The volume.
},
Defeat = {
close_after = 5000, --(in miliseconds) Closes the UI after a win after x miliseconds.
volume = 0.2 --(0.01-1.0) The volume.
}
}
Config.AvailableTables = { --A list of all available arm wrestling tables that can be spawned and used.
[1] = `prop_arm_wrestle_01`,
[2] = `bkr_prop_clubhouse_arm_wrestle_01a`,
[3] = `bkr_prop_clubhouse_arm_wrestle_02a`,
--[4] = `ADD_MORE_HERE`,
}
Config.DisabledControls = { --A list of keys which are disabled while you are in a game.
23,32,33,34,35,37,63,64,71,72,75,246
}
-- ██████╗ ████████╗██╗ ██╗███████╗██████╗
--██╔═══██╗╚══██╔══╝██║ ██║██╔════╝██╔══██╗
--██║ ██║ ██║ ███████║█████╗ ██████╔╝
--██║ ██║ ██║ ██╔══██║██╔══╝ ██╔══██╗
--╚██████╔╝ ██║ ██║ ██║███████╗██║ ██║
-- ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
function Round(cd) return math.floor(cd+0.5) end
function Trim(cd) return cd:gsub('%s+', '') end
-- █████╗ ██╗ ██╗████████╗ ██████╗ ██████╗ ███████╗████████╗███████╗ ██████╗████████╗
--██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
--███████║██║ ██║ ██║ ██║ ██║ ██║ ██║█████╗ ██║ █████╗ ██║ ██║
--██╔══██║██║ ██║ ██║ ██║ ██║ ██║ ██║██╔══╝ ██║ ██╔══╝ ██║ ██║
--██║ ██║╚██████╔╝ ██║ ╚██████╔╝ ██████╔╝███████╗ ██║ ███████╗╚██████╗ ██║
--╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝
-----DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
if Config.Framework == 'auto_detect' then
if GetResourceState(Config.FrameworkTriggers.esx.resource_name) == 'started' then
Config.Framework = 'esx'
elseif GetResourceState(Config.FrameworkTriggers.qbcore.resource_name) == 'started' then
Config.Framework = 'qbcore'
else
Config.Framework = 'standalone'
end
if Config.Framework == 'esx' or Config.Framework == 'qbcore' then
for c, d in pairs(Config.FrameworkTriggers[Config.Framework]) do
Config.FrameworkTriggers[c] = d
end
Config.FrameworkTriggers.esx, Config.FrameworkTriggers.qbcore = nil, nil
end
end
if Config.Framework == 'standalone' then
Config.SpawnTable.UsableItem.ENABLE = false
end
if Config.Notification == 'auto_detect' then Config.Notification = Config.Framework if Config.Notification == 'standalone' then Config.Notification = 'chat' end end
-----DO NOT TOUCH ANYTHING ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
```
\= Locales
\= UI Locales
:::
---
---
url: /paid-scripts/cctv-cameras.md
description: >-
FiveM CCTV camera system with placeable 360°, 180°, and fixed cameras.
Includes camera management UI, access permissions, temporary access exports,
and usable items for ESX and QBCore.
---
# CCTV Cameras
[**Buy Here**](https://codesign.pro/product/5501429)
[**FiveM Forums Post**](https://forum.cfx.re/t/paid-codesign-cctv-cameras/5046714)
[**YouTube Walkthrough Video**](https://youtu.be/5xUKtxSVxZA)
## INSTALLATION GUIDE
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
**2.** Unzip the `cd_cctv.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_cctv`. 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_cctv
```
### Step 1 - Configure Resource
You **MUST** read all configurable options inside the **`[cd_cctv/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [commented out help text](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections at the top of the `config.lua`. Everything else is optional.**
> [**NEW: Auto Framework Detect!**](https://i.imgur.com/zNW8Kpg.png)
>
> Introducing our new 'auto\_detect' feature! It automatically identifies your framework and applies the appropriate default settings.
### Step 2 - Add More Camera Types
In the `[cd_cctv/configs/config.lua]` file, scroll down to the [PLACING CCTV CAMERAS](https://i.imgur.com/jUqzENG.png) section. In the **`Config.CCTV`** table you can configure default cameras or add new ones; everything is explained in the [commented out help text](https://i.imgur.com/89Vsywi.png).
### HOW TO USE
This resource is very easy to install, configure and use. Once the steps above are complete, the rest is simple:
1. You have 2 ways to place the CCTV cameras, depending on if you use a framework. You can either use the **`/cctv1`** or **`/cctv2`** chat commands or use the **`cctv1`** or **`cctv2`** usable items (if you use a framework).
2. Now you have placed your camera, use the **`/cctvui`** chat command to open the CCTV management UI; here, you can view the cameras and give other players access to view your cameras.
## INFORMATION
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| Command | Description |
| ------------- | ------------------------------------------------------------ |
| **`/cctvui`** | Open the cctv UI. |
| **`/cctv1`** | Place a camera (with default settings in Config.CCTV). |
| **`/cctv2`** | Place a 180° camera (with default settings in Config.CCTV). |
| **`/cctv3`** | Place a fixed camera (with default settings in Config.CCTV). |
### Events
These events are completely optional; you can use them if needed.
:::tabs
\==client-side to client-side
**Open the CCTV management UI**
```lua
TriggerEvent('cd_cctv:OpenCCTVUI')
```
\==server-side to client-side
**Open the CCTV management UI**
```lua
TriggerClientEvent('cd_cctv:OpenCCTVUI', source)
```
:::
### Exports
These exports are completely optional; you can use them if needed.
:::tabs
\==client-side exports
**Gain access to view all cameras within a distance**
You can trigger this export in robberies for example to gain access to view all cameras for a period of time within a set distance of the coords provided. \[ coords = vector3, distance = integer, time = integer (in minutes) ]
```lua
exports["cd_cctv"]:GetTemporaryAccessWithinDistance(coords, distance, time)
```
**Gain access to view a specific camera**
You can trigger this export in robberies for example to gain access to a specific camera for a period of time. \[ camera\_id = string , time = integer (in minutes) ]
```lua
exports["cd_cctv"]:GetTemporaryAccessByID(camera_id, time)
```
**Temporarily disable all cameras within a distance**
You can trigger this export in robberies for example to disable all cameras for a period of time within a set distance of the coords provided. \[ coords = vector3, distance = integer, time = integer (in minutes) ]
```lua
exports["cd_cctv"]:DisableCamerasInDistance(coords, distance, time)
```
**Temporarily disable a specific camera**
You can trigger this export in robberies for example to disable a specific camera for a period of time. \[ camera\_id = string , time = integer (in minutes) ]
```lua
exports["cd_cctv"]:DisableCameraById(camera_id, time)
```
:::
### Usable Items
Usable items can be renamed or disabled in the `[configs/config.lua]`. You can also add more in the **`Config.CCTV`** table.
| Item Name | Description |
| ----------- | ------------------------------------------------------------ |
| **`cctv1`** | Place a 360° camera (with default settings in Config.CCTV). |
| **`cctv2`** | Place a 180° camera (with default settings in Config.CCTV). |
| **`cctv3`** | Place a fixed camera (with default settings in Config.CCTV). |
> **Inventory Images (100x100)**
:::tabs
\==Add items on ESX
Run these SQL queries in your database.
```sql
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('cctv1', 'CCTV 1', 1, 0, 1);
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('cctv2', 'CCTV 2', 1, 0, 1);
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('cctv3', 'CCTV 3', 1, 0, 1);
```
\==Add items on QBCore
Add these lines to \[qb-core/shared/items.lua].
```lua
['cctv1'] = {['name'] = 'cctv1', ['label'] = 'CCTV 1', ['weight'] = 500, ['type'] = 'item', ['image'] = 'cctv1.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Placeable CCTV camera'},
['cctv2'] = {['name'] = 'cctv2', ['label'] = 'CCTV 2', ['weight'] = 500, ['type'] = 'item', ['image'] = 'cctv2.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Placeable 180° CCTV camera'},
['cctv3'] = {['name'] = 'cctv3', ['label'] = 'CCTV 3', ['weight'] = 500, ['type'] = 'item', ['image'] = 'cctv2.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Placeable fixed camera'},
```
:::
## COMMON ISSUES
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder either `cd_cctv`.
**Encrypted Files** Do not edit the encrypted files in any way.
## ERROR CODES
If you see an error code not listed below, please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).
:::tabs
\==Server
**0001** - The simple answer is that you did not complete [#Step 2](./#step-2-move-the-json-file) of the installation guide above.
\==Client
N/A
:::
## CHANGELOG
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
## :::danger **PLEASE READ! (JSON files)**
When updating a resource that uses JSON files as a database as this one does, **DO NOT** delete/replace the files/folders inside the **`JSON files`** folder, as this will overwrite your saved database.
:::
::::tabs
\==v1.0.0
**Files Changed**:
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type**:
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
\==v1.0.3
**Files Changed**:
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type**:
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
::: tip Added
-------------
Added Failsafe checks for detection notify if no job is present
:::
:::warning Fixed
* Fixed issues with AcePerms and Discord Perms breaking the ui for people
* Fixed ui not showing No Access permissions yet if you remove all the permissions
* Fixed Search not sticking after person views and stop viewing a camera
* Fixed ui bug for information bubbles
:::
\==v1.0.6
**Files Changed**:
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```lua
fxmanifest.lua
client/client.lua
```
**Update Type**:
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
## :::warning Fixed
* Fixed cctv not updating properly for admins if access updated.
:::
\==v1.0.7
**Files Changed**:
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```lua
fxmanifest.lua
configs (FULL FOLDER)
```
**Update Type**:
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
## :::warning Fixed
* Fixed issue with ESX item not removing while placing CCTV (optional only for ESX users who want to use it item based).
:::
\==v1.0.8
**Files Changed**:
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```lua
fxmanifest.lua
configs/server_customise_me.lua
server/server.lua
client/functions.lua
```
**Update Type**:
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
## :::warning Fixed
* Fixed sending alerts to people with access and jobs with access.
:::
\==v1.0.9
**Files Changed**:
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```lua
fxmanifest.lua
configs/server_customise_me.lua
server/server.lua
client/client.lua
```
**Update Type**:
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
## :::warning Fixed
* Fixed to check access before sending alerts for detection.
* Fixed alerts firing for data loading to everyone.
* Race condition checking for sending detection alerts.
* Fixed Doorlock typo in notify.
\==v1.0.10
**Files Changed**:
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```lua
fxmanifest.lua
client/client.lua
```
**Update Type**:
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
:::warning Fixed
* Hotfix to disable cameras sometimes bugging out
:::
\==v1.0.11
**Files Changed**:
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```lua
fxmanifest.lua
config/server_customise_me.lua
server/server.lua
```
**Update Type**:
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
## :::tip Added
* Cached player source and identifier for less stress on server
:::
\==v1.0.12
**Files Changed**:
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```lua
fxmanifest.lua
server/server.lua
html (full folder)
```
**Update Type**:
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
## :::warning Fixed
* Fixed error in server console when player drops without loading completely.
* Fixed pagination overflow.
:::
---
---
url: /paid-scripts/cctv-cameras/configs-locales-and-sql.md
description: >-
Configuration, locales, and SQL setup for cd_cctv. Includes framework
auto-detect, camera types, admin permissions, Discord integration, ACE perms,
and camera detection settings.
---
# Configs, Locales & SQL
:::tabs
\==Config
```lua
Config = {}
function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
--WHAT DOES 'auto_detect' DO?
--The 'auto_detect' feature automatically identifies your framework, SQL database resource, and framework notifications, and applies the appropriate default settings.
Config.Framework = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', only ESX, QBCore, vRP and Standalone frameworks will be detected. Use 'other' for custom frameworks.
Config.Notification = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', the default notifications for your framework will be used. Use 'other' for custom notification resources.
Config.Language = 'EN' --[ 'EN' ] You can add your own locales to Locales.lua, but be sure to update the Config.Language to match it.
Config.FrameworkTriggers = {
esx = { --If you have modified the default event names in the es_extended resource, change them here.
resource_name = 'es_extended',
main = 'esx:getSharedObject',
load = 'esx:playerLoaded',
job = 'esx:setJob'
},
qbcore = { --If you have modified the default event names in the qb-core resource, change them here.
resource_name = 'qb-core',
main = 'QBCore:GetObject',
load = 'QBCore:Client:OnPlayerLoaded',
job = 'QBCore:Client:OnJobUpdate',
gang = 'QBCore:Client:OnGangUpdate',
duty = 'QBCore:Client:SetDuty'
}
}
--██╗███╗ ███╗██████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗████████╗
--██║████╗ ████║██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝
--██║██╔████╔██║██████╔╝██║ ██║██████╔╝ ██║ ███████║██╔██╗ ██║ ██║
--██║██║╚██╔╝██║██╔═══╝ ██║ ██║██╔══██╗ ██║ ██╔══██║██║╚██╗██║ ██║
--██║██║ ╚═╝ ██║██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║██║ ╚████║ ██║
--╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
Config.Debug = false --To enable debug prints.
Config.UseFrameworkDutySystem = false --Do you want to use your frameworks (esx/qbcore) built-in duty system?
Config.CheckInterval = 2 --(in minutes) How often should the script check for cameras if they are expired or not?
--███╗ ███╗ █████╗ ██╗███╗ ██╗
--████╗ ████║██╔══██╗██║████╗ ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
--╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
Config.ThresholdToDestroyCamera = 300 --(in ms) The threshold to destroy the camera if it gets damaged. (if the camera gets damaged more than this threshold, it will be destroyed.)
Config.AdminAccess = { --A list of different methods where you can define which players have admin permissions on the in-game UI.
Framework = { --Ignore this framework section if you dont use a framework.
['esx'] = {'superadmin', 'admin', },
['qbcore'] = {'god', 'admin', },
['vrp'] = {5, 6, 7, 8, 9, 10, },
['other'] = {'change_me', 'change_me', },
},
Identifiers = {
ENABLE = false, --Do you want to allow players with specific identifiers to use the admin features?
identifier_list = {'steam:xxxxx', 'license:xxxxx', 'fivem:xxxxx', }, --You can use a players steam, license or fivem id etc.
},
AcePerms = {
ENABLE = false, --Do you want to allow players with specific ace perms to use the admin features?
aceperms_list = {'command', 'cctv', }, --Make sure you have your ace perms configured correctly in your server.cfg.
},
Discord = { --This feature requires the Badger Discord API resource.
ENABLE = false, --Do you want to allow players with specific discord roles in your discord to use the admin features?
discord_list = {'758736678000082910', '758736678000082910', }, --You must put the role id from your discord here (https://www.itgeared.com/how-to-get-role-id-on-discord).
}
}
Config.CCTVAccessPerms = { --When giving other players access to view your cameras, you always need to define which permission groups have access to them. Here you can choose which perms options are available to choose from on the in-game UI.
AcePerms = true, --Do you want to allow your admins to add ace perms to the cctv permissions?
Discord = true --Do you want to allow your admins to add discord roles to the cctv permissions? This feature requires the Badger Discord API resource.
}
--██████╗ ██╗ █████╗ ██████╗██╗███╗ ██╗ ██████╗ ██████╗ ██████╗████████╗██╗ ██╗ ██████╗ █████╗ ███╗ ███╗███████╗██████╗ █████╗ ███████╗
--██╔══██╗██║ ██╔══██╗██╔════╝██║████╗ ██║██╔════╝ ██╔════╝██╔════╝╚══██╔══╝██║ ██║ ██╔════╝██╔══██╗████╗ ████║██╔════╝██╔══██╗██╔══██╗██╔════╝
--██████╔╝██║ ███████║██║ ██║██╔██╗ ██║██║ ███╗ ██║ ██║ ██║ ██║ ██║ ██║ ███████║██╔████╔██║█████╗ ██████╔╝███████║███████╗
--██╔═══╝ ██║ ██╔══██║██║ ██║██║╚██╗██║██║ ██║ ██║ ██║ ██║ ╚██╗ ██╔╝ ██║ ██╔══██║██║╚██╔╝██║██╔══╝ ██╔══██╗██╔══██║╚════██║
--██║ ███████╗██║ ██║╚██████╗██║██║ ╚████║╚██████╔╝ ╚██████╗╚██████╗ ██║ ╚████╔╝ ╚██████╗██║ ██║██║ ╚═╝ ██║███████╗██║ ██║██║ ██║███████║
--╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝
Config.DetectionCooldown = 2 --How long should the script wait before sending another notification to the owner if a camera detects something?
Config.CommandBased = true --If you want to use commands to place cameras, set this to true. (You can use both command and item based at the same time).
Config.ItemBased = false --If you want to use items to place cameras, set this to true. (You can use both command and item based at the same time).
--If you have selected item based, make sure to create the items in your database or items.lua based on the framework/inventory you are using.
--Also if your inventory doesnt use base QBCore/ESX useable items event, change them in the server_customise_me.lua file.
Config.CCTV = {
["cctv1"] = {
prop = "hei_prop_bank_cctv_02",
persistent = true, --Do you want these types of cameras to be persistant (will respawn even after server restart)?
time = 10, --(in minutes) If "persistent" option above^ is disabled, after x amount of minutes, the cctv will be removed.
type = "360", --[ "360" / "180" / "fixed" ] Choose whether this camera can turn 360°, 180° of it the camera is fixed and can not move.
canDestroy = false, --Can players destroy this camera?
detect = false, -- Do you want this camera to detect players?
},
["cctv2"] = { --This is the item spawn name if you use ESX/QBCore. For standalone, this will be the chat command to place cameras.
prop = "prop_cs_cctv", --The prop name.
persistent = true, --Do you want these types of cameras to be persistant (will respawn even after server restart)?
time = 10, --(in minutes) If "persistent" option above^ is disabled, after x amount of minutes, the cctv will be removed.
type = "180", --[ "360" / "180" / "fixed" ] Choose whether this camera can turn 360°, 180° of it the camera is fixed and can not move.
canDestroy = false, --Can players destroy this camera?
detect = true, -- Do you want this camera to detect players?
},
["cctv3"] = { --This is the item spawn name if you use ESX/QBCore. For standalone, this will be the chat command to place cameras.
prop = "prop_cs_cctv", --The prop name.
persistent = true, --Do you want these types of cameras to be persistant (will respawn even after server restart)?
time = 10, --(in minutes) If "persistent" option above^ is disabled, after x amount of minutes, the cctv will be removed.
type = "fixed", --[ "360" / "180" / "fixed" ] Choose whether this camera can turn 360°, 180° of it the camera is fixed and can not move.
canDestroy = false, --Can players destroy this camera?
detect = true, -- Do you want this camera to detect players?
},
}
-- ██████╗ ██████╗ ███╗ ███╗███╗ ███╗ █████╗ ███╗ ██╗██████╗ ███████╗
--██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗ ██║██╔══██╗██╔════╝
--██║ ██║ ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║ ██║███████╗
--██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║ ██║╚════██║
--╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║██║ ╚████║██████╔╝███████║
-- ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝
Config.OpenCCTVUI = {
ENABLE = true, --Do you want to allow player's open the CCTV UI via chat command?
command = 'cctvui', --The chat command.
}
-- ██████╗ ████████╗██╗ ██╗███████╗██████╗
--██╔═══██╗╚══██╔══╝██║ ██║██╔════╝██╔══██╗
--██║ ██║ ██║ ███████║█████╗ ██████╔╝
--██║ ██║ ██║ ██╔══██║██╔══╝ ██╔══██╗
--╚██████╔╝ ██║ ██║ ██║███████╗██║ ██║
-- ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
function Round(cd) return math.floor(cd+0.5) end
function Trim(cd) return cd:gsub('%s+', '') end
-- █████╗ ██╗ ██╗████████╗ ██████╗ ██████╗ ███████╗████████╗███████╗ ██████╗████████╗
--██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
--███████║██║ ██║ ██║ ██║ ██║ ██║ ██║█████╗ ██║ █████╗ ██║ ██║
--██╔══██║██║ ██║ ██║ ██║ ██║ ██║ ██║██╔══╝ ██║ ██╔══╝ ██║ ██║
--██║ ██║╚██████╔╝ ██║ ╚██████╔╝ ██████╔╝███████╗ ██║ ███████╗╚██████╗ ██║
--╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝
-----DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
if Config.Framework == 'auto_detect' then
if GetResourceState(Config.FrameworkTriggers.esx.resource_name) == 'started' then
Config.Framework = 'esx'
elseif GetResourceState(Config.FrameworkTriggers.qbcore.resource_name) == 'started' then
Config.Framework = 'qbcore'
elseif GetResourceState('vrp') == 'started' then
Config.Framework = 'vrp'
else
Config.Framework = 'standalone'
end
if Config.Framework == 'esx' or Config.Framework == 'qbcore' then
for c, d in pairs(Config.FrameworkTriggers[Config.Framework]) do
Config.FrameworkTriggers[c] = d
end
Config.FrameworkTriggers.esx, Config.FrameworkTriggers.qbcore = nil, nil
end
end
if Config.Notification == 'auto_detect' then Config.Notification = Config.Framework if Config.Notification == 'standalone' or Config.Notification == 'vrp' then Config.Notification = 'chat' end end
if GetResourceState('Badger_Discord_API') ~= 'started' then
Config.AdminAccess.Discord.ENABLE = false
Config.CCTVAccessPerms.Discord = false
end
if Config.Framework == 'esx' or Config.Framework == 'qbcore' or Config.Framework == 'other' then
Config.AdminAccess.Framework.ENABLE = true
else
Config.AdminAccess.Framework.ENABLE = false
end
if Config.Framework == 'esx' or Config.Framework == 'qbcore' or Config.Framework == 'other' then
Config.CCTVAccessPerms.Framework = true
else
Config.CCTVAccessPerms.Framework = false
end
-----DO NOT TOUCH ANYTHING ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
```
---
---
url: /paid-scripts/darts.md
description: >-
FiveM darts mini-game with multiplayer support, configurable game modes, dart
board props, chat commands, and events. Supports ESX, QBCore, and standalone
frameworks.
---
# Darts
[**Buy Here**](https://codesign.pro/product/5400662)
**FiveM Forums Post**
**YouTube Walkthrough Video**
## INSTALLATION GUIDE
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
**2.** Unzip the `cd_darts.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_darts`. 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_darts
```
### Step 1 - Configure Resource
You **MUST** read all configurable options inside the **`[cd_darts/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [commented out help text](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections at the top of the `config.lua`. Everything else is optional.**
> [**NEW: Auto Framework Detect!**](https://i.imgur.com/zNW8Kpg.png)
>
> Introducing our new 'auto\_detect' feature! It automatically identifies your framework and applies the appropriate default settings.
### HOW TO USE
This resource is very easy to install and configure. Once the steps above are complete the rest is simple:
1. Use the [#Chat Command](./#chat-commands) to open the UI to configure and start your game.
2. For configuring your game part, each option is explained on the UI. The game is made to function like a real-life game of darts.
3. It's your decision in roleplay to choose how close you want to be when throwing the darts. The key to throw darts is [#Default Key Binds](./#default-key-binds).
4. If you are unsure how to play darts, here's a quick [Online Guide](https://shotdarts.com/blogs/discover/a-starter-for-5-basic-dart-games-you-should-know) we found that may help you.
##
## INFORMATION
### Default Key Binds
*This resource does not use key mapping; these keys are hard coded.*
| Key | Description |
| ----------------------- | --------------------------------------------------------- |
| **`LEFT MOUSE BUTTON`** | When in a game of darts, this is the key to throw a dart. |
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| Command | Description |
| ------------------------ | ------------------------------------------------------------------------------------- |
| **`/darts_startgame`** | Open the UI to configure and start your game *(when close enough to a dart board)*. |
| **`/darts_giveup`** | Stop playing the game your currently in. |
| **`/darts_createboard`** | Create a dart board *(use keys displayed to move the prop to your desired location)*. |
| **`/darts_deleteboard`** | Delete the closest dart board *(within a small radius).* |
### Events
These events are completely optional; you can use them if needed.
:::tabs
\==client-side to client-side
**Start a game of darts**
Open the UI to configure and start your game (when close enough to a dart board).
```lua
TriggerEvent('cd_darts:client:startGame')
```
**Stop playing your game of darts**
```lua
TriggerEvent('cd_darts:client:giveUp')
```
**Create a dart board**
```lua
TriggerEvent('cd_darts:client:spawnBoard', 'default')
```
**Delete the closest dart board**
```lua
TriggerEvent('cd_darts:client:deleteBoard')
```
\==server-side to client-side
**Start a game of darts**
```lua
TriggerClientEvent('cd_darts:client:startGame', source)
```
**Stop playing your game of darts**
```lua
TriggerClientEvent('cd_darts:client:giveUp', source)
```
**Create a dart board**
```lua
TriggerClientEvent('cd_darts:client:spawnBoard', source, 'default')
```
**Delete the closest dart board**
```lua
TriggerClientEvent('cd_darts:client:deleteBoard', source)
```
:::
##
## COMMON ISSUES
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder either `cd_darts`.
**Encrypted Files** Do not edit the encrypted files in any way.
## ERROR CODES
If you see an error code not listed below, please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).
:::tabs
\==Server
N/A
\==Client
N/A
:::
## CHANGELOG
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
::::tabs
\==v1.0.0
**Files Changed**:
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type**:
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
\==v1.0.1
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
## :::tip Added
* **Auto Framework Detection** - We have added a new feature we are calling '**auto\_detect**', which will automatically identify your framework and apply the appropriate default settings.
* Added the option to display debug prints.
:::
## :::warning Fixed
* Fixed an issue with the esx item check.
:::
---
---
url: /paid-scripts/darts/configs-locales-and-sql.md
description: >-
Configuration, locales, and SQL setup for cd_darts. Includes framework
auto-detect, default game settings, dart board props, key bindings, and
command/event configuration.
---
# Configs, Locales & SQL
:::tabs
\==Config
```lua
Config = {}
function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
--WHAT DOES 'auto_detect' DO?
--The 'auto_detect' feature automatically identifies your framework and applies the appropriate default settings.
Config.Framework = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', only ESX, QBCore and Standalone frameworks will be detected. Use 'other' for custom frameworks.
Config.Notification = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', the default notifications for your framework will be used. Use 'other' for custom notification resources.
Config.Language = 'EN' --[ 'EN' ] You can add your own locales to Locales.lua, but be sure to update the Config.Language to match it.
Config.FrameworkTriggers = {
esx = { --If you have modified the default event names in the es_extended resource, change them here.
resource_name = 'es_extended',
main = 'esx:getSharedObject'
},
qbcore = { --If you have modified the default event names in the qb-core resource, change them here.
resource_name = 'qb-core',
main = 'QBCore:GetObject'
}
}
--██╗███╗ ███╗██████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗████████╗
--██║████╗ ████║██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝
--██║██╔████╔██║██████╔╝██║ ██║██████╔╝ ██║ ███████║██╔██╗ ██║ ██║
--██║██║╚██╔╝██║██╔═══╝ ██║ ██║██╔══██╗ ██║ ██╔══██║██║╚██╗██║ ██║
--██║██║ ╚═╝ ██║██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║██║ ╚████║ ██║
--╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
Config.Debug = false --To enable debug prints.
Config.DebugLine = false -- Show the target line increases MS.
--██████╗ ███████╗███████╗ █████╗ ██╗ ██╗██╗ ████████╗ ██████╗ ██████╗ ████████╗██╗ ██████╗ ███╗ ██╗███████╗
--██╔══██╗██╔════╝██╔════╝██╔══██╗██║ ██║██║ ╚══██╔══╝ ██╔═══██╗██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║██╔════╝
--██║ ██║█████╗ █████╗ ███████║██║ ██║██║ ██║ ██║ ██║██████╔╝ ██║ ██║██║ ██║██╔██╗ ██║███████╗
--██║ ██║██╔══╝ ██╔══╝ ██╔══██║██║ ██║██║ ██║ ██║ ██║██╔═══╝ ██║ ██║██║ ██║██║╚██╗██║╚════██║
--██████╔╝███████╗██║ ██║ ██║╚██████╔╝███████╗██║ ╚██████╔╝██║ ██║ ██║╚██████╔╝██║ ╚████║███████║
--╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════
Config.DefaultSettings = {
score = 501, -- The maximum amount to score.
double_end = false, -- End on a double or allow singles.
legs = 3 -- the amount of games you want to play.
}
--███╗ ███╗ █████╗ ██╗███╗ ██╗
--████╗ ████║██╔══██╗██║████╗ ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
--╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
Config.dartBoardProps = { --The hash names of dart board props that you can interact with.
[`prop_dart_bd_cab_01`] = true,
[`prop_dart_bd_01`] = true
}
-- ███████╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██████╗ █████╗ ██████╗ ██████╗
-- ██╔════╝██╔════╝██╔═══██╗██╔═══██╗██╔════╝██╔══██╗██╔═══██╗██╔══██╗██╔══██╗██╔══██╗
-- ███████╗██║ ██║ ██║██████╔╝█████╗ ██████╔╝██║ ██║███████║██████╔╝██║ ██║
-- ╚════██║██║ ██║ ██║██╔══██╗██╔══╝ ██╔══██╗██║ ██║██╔══██║██╔══██╗██║ ██║
-- ███████║╚██████╗╚██████╔╝██║ ██║███████╗██████╔╝╚██████╔╝██║ ██║██║ ██║██████╔╝
-- ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝
Config.dartBoard = {
ENABLE = true, --Do you want to allow players to create and place dart boards?
requiredItem = nil, -- ESX/QBCORE only; Do you want to require players to have an item in order to place a new scoreboard? If so enter the required item name here as a string.
['default'] = {
model ='prop_dart_bd_cab_01'
},
['round'] = {
model = 'prop_dart_bd_01'
}
}
Config.dartMove = { -- find your Key ID on https://docs.fivem.net/docs/game-references/controls/#controls
up = 111,
down = 112,
left = 174,
right = 175,
foward = 172,
backward = 173,
rotateLeft = 117,
rotateRight = 118,
reset = 315,
save = 201
}
--██╗ ██╗███████╗██╗ ██╗███████╗ █████╗ ███╗ ██╗██████╗ ██████╗ ██████╗ ███╗ ███╗███╗ ███╗ █████╗ ███╗ ██╗██████╗ ███████╗
--██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ██╔══██╗████╗ ██║██╔══██╗ ██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗ ██║██╔══██╗██╔════╝
--█████╔╝ █████╗ ╚████╔╝ ███████╗ ███████║██╔██╗ ██║██║ ██║ ██║ ██║ ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║ ██║███████╗
--██╔═██╗ ██╔══╝ ╚██╔╝ ╚════██║ ██╔══██║██║╚██╗██║██║ ██║ ██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║ ██║╚════██║
--██║ ██╗███████╗ ██║ ███████║ ██║ ██║██║ ╚████║██████╔╝ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║██║ ╚████║██████╔╝███████║
--╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝
Config.startGame = {
ENABLE = true, --Do you want to allow player's to start a game by keypress and chat command?
command = 'darts_startgame', --The chat command.
}
Config.giveUp = {
ENABLE = true, --Do you want to allow player's to quit a game by keypress and chat command?
command = 'darts_giveup',
}
Config.createBoard = {
ENABLE = true, --Do you want to allow player's to create dart boards by keypress and chat command?
command = 'darts_createboard'
}
Config.deleteBoard = {
ENABLE = true, --Do you want to allow player's to delete dart boards by keypress and chat command?
command = 'darts_deleteboard'
}
-- ██████╗ ████████╗██╗ ██╗███████╗██████╗
--██╔═══██╗╚══██╔══╝██║ ██║██╔════╝██╔══██╗
--██║ ██║ ██║ ███████║█████╗ ██████╔╝
--██║ ██║ ██║ ██╔══██║██╔══╝ ██╔══██╗
--╚██████╔╝ ██║ ██║ ██║███████╗██║ ██║
-- ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
function Round(cd) return math.floor(cd+0.5) end
function Trim(cd) return cd:gsub('%s+', '') end
-- █████╗ ██╗ ██╗████████╗ ██████╗ ██████╗ ███████╗████████╗███████╗ ██████╗████████╗
--██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
--███████║██║ ██║ ██║ ██║ ██║ ██║ ██║█████╗ ██║ █████╗ ██║ ██║
--██╔══██║██║ ██║ ██║ ██║ ██║ ██║ ██║██╔══╝ ██║ ██╔══╝ ██║ ██║
--██║ ██║╚██████╔╝ ██║ ╚██████╔╝ ██████╔╝███████╗ ██║ ███████╗╚██████╗ ██║
--╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝
-----DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
if Config.Framework == 'auto_detect' then
if GetResourceState(Config.FrameworkTriggers.esx.resource_name) == 'started' then
Config.Framework = 'esx'
elseif GetResourceState(Config.FrameworkTriggers.qbcore.resource_name) == 'started' then
Config.Framework = 'qbcore'
else
Config.Framework = 'standalone'
end
if Config.Framework == 'esx' or Config.Framework == 'qbcore' then
for c, d in pairs(Config.FrameworkTriggers[Config.Framework]) do
Config.FrameworkTriggers[c] = d
end
Config.FrameworkTriggers.esx, Config.FrameworkTriggers.qbcore = nil, nil
end
end
if Config.Notification == 'auto_detect' then Config.Notification = Config.Framework if Config.Notification == 'standalone' then Config.Notification = 'chat' end end
-----DO NOT TOUCH ANYTHING ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
```
---
---
url: /paid-scripts/gun-range.md
description: >-
FiveM gun range shooting range with ranked and practice modes, scoreboard,
moveable targets, and weapon-specific scoring. Supports ESX, QBCore, and
standalone frameworks.
---
# Gun Range
[**Buy Here**](https://codesign.pro/product/5382133)
**FiveM Forums Post**
[**YouTube Walkthrough Video**](https://www.youtube.com/watch?v=8xla3d0uKhM)
## INSTALLATION GUIDE
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
**2.** Unzip the `cd_gunrange.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_gunrange`. 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_gunrange
```
### Step 1 - Configure Resource
You **MUST** read all configurable options inside the **`[cd_gunrange/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [commented out help text](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections at the top of the `config.lua`. Everything else is optional.**
> [**NEW: Auto Framework Detect!**](https://i.imgur.com/zNW8Kpg.png)
>
> Introducing our new 'auto\_detect' feature! It automatically identifies your framework and applies the appropriate default settings.
### HOW TO USE
This resource is very easy to install and configure. Once the steps above are complete, the rest is simple:
1. You can move your target further away to get a higher score by using the [#Chat Command](./#chat-commands).
2. Use the [#Chat Command](./#chat-commands) to start your game and wait for the countdown to begin.
3. Try to aim for the head and centre body for the highest score. You can track where your bullets hit on the UI to the left of your screen.
4. The script will automatically recognise your weapon type and add your score to the scoreboard if high enough.
## INFORMATION
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| Command | Description |
| -------------------------- | -------------------------------------------- |
| **`/gunrange_start`** | Start a ranked shooting session. |
| **`/gunrange_movetarget`** | Open the UI to move the target. |
| **`/gunrange_scoreboard`** | Open the UI to view your servers top scores. |
| **`/gunrange_practice`** | Start a unranked practise shooting session. |
### Events
These events are completely optional; you can use them if needed.
::::tabs
\=== client-side to client-side
**Start a ranked shooting session**
Ranked sessions adds your score to your servers scoreboard.
```lua
TriggerEvent('cd_gunrange:client:Start')
```
**Open the UI to move the target**
Move the target closer or further away from you (further = higher score).
```lua
TriggerEvent('cd_gunrange:client:MoveTarget')
```
**Open the UI to view your servers scoreboard**
View the top scores from players in your server from all the different weapon categories.
```lua
TriggerEvent('cd_gunrange:client:ShowScoreBoard')
```
**Start an unranked practice shooting session**
Practice sessions do not get added to the scoreboard.
```lua
TriggerEvent('cd_gunrange:client:PracticeMode')
```
\=== server-side to client-side
**Start a ranked shooting session**
Ranked sessions adds your score to your servers scoreboard.
```lua
TriggerClientEvent('cd_gunrange:client:Start', source)
```
**Open the UI to move the target**
Move the target closer or further away from you (further = higher score).
```lua
TriggerClientEvent('cd_gunrange:client:MoveTarget', source)
```
**Open the UI to view your servers scoreboard**
View the top scores from players in your server from all the different weapon types.
```lua
TriggerClientEvent('cd_gunrange:client:ShowScoreBoard', source)
```
**Start an unranked practice shooting session**
Practice sessions do not get added to the scoreboard
```lua
TriggerClientEvent('cd_gunrange:client:PracticeMode', source)
```
::::
## COMMON ISSUES
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder either `cd_gunrange`.
**Encrypted Files** Do not edit the encrypted files in any way.
## ERROR CODES
If you see an error code not listed below, please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).
::::tabs
\=== Server
N/A
===
\=== Client
N/A
===
::::
## CHANGELOG
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
::: danger
**PLEASE READ! (JSON files)**
When updating a resource that uses JSON files as a database as this one does, **DO NOT** delete/replace the files/folders inside the **`JSON files`** folder, as this will overwrite your saved database.
:::
::::tabs
\=== v1.0.0
### 20/12/2022
**Files Changed**:
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type**:
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: tip
**STATUS**
* **Development Stage:** COMPLETE
* **Alpha Test Stage:** COMPLETE
* **Beta Test Stage:** COMPLETE
:::
\===
\=== v1.0.2
### 29/01/2023
**Files Changed**:
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type**:
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
::: tip
**Add**
* Added option to create new gun ranges anywhere.
:::
::: warning
**Fix**
* Various bug fixes.
:::
\===
\=== v1.0.3
### 12/02/2023
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
::: tip
**Add**
* **Auto Framework Detection** - We have added a new feature we are calling '**auto\_detect**', which will automatically identify your framework and apply the appropriate default settings.
* Added the option to display debug prints.
:::
\===
\=== v1.1.0
### 17/09/2024
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
::: tip
**Add**
* Added webhooks.
:::
::: info
**Edit**
* Code optimisation.
* Removed unnecessary prints.
:::
::: warning
**Fix**
* Bug fix with custom gun ranges.
:::
\===
\=== v1.1.1
### 19/02/2025
**Files Changed:**
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```lua
fxmanifest.lua
configs/config.lua
configs/server_customise_me.lua
server/server.lua
```
**Update Type:**
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
::: warning
**Fix**
* Fix for esx character names.
:::
\===
::::
---
---
url: /paid-scripts/gun-range/configs-locales-and-sql.md
description: >-
Configuration, locales, and SQL setup for cd_gunrange. Includes framework
auto-detect, weapon scoring, target settings, and scoreboard configuration.
---
# Configs, Locales & SQL
::::tabs
\=== Config
```lua
function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
--WHAT DOES 'auto_detect' DO?
--The 'auto_detect' feature automatically identifies your framework and applies the appropriate default settings.
Config.Framework = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', only ESX, QBCore and Standalone frameworks will be detected. Use 'other' for custom frameworks.
Config.Notification = 'auto_detect' --[ 'auto_detect' / 'other' ] If you select 'auto_detect', the default notifications for your framework will be used. Use 'other' for custom notification resources.
Config.Language = 'EN' --[ 'EN' / 'NL' ] You can add your own locales to Locales.lua, but be sure to update the Config.Language to match it.
Config.FrameworkTriggers = {
esx = { --If you have modified the default event names in the es_extended resource, change them here.
resource_name = 'es_extended',
main = 'esx:getSharedObject'
},
qbcore = { --If you have modified the default event names in the qb-core resource, change them here.
resource_name = 'qb-core',
main = 'QBCore:GetObject'
}
}
--██╗███╗ ███╗██████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗████████╗
--██║████╗ ████║██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝
--██║██╔████╔██║██████╔╝██║ ██║██████╔╝ ██║ ███████║██╔██╗ ██║ ██║
--██║██║╚██╔╝██║██╔═══╝ ██║ ██║██╔══██╗ ██║ ██╔══██║██║╚██╗██║ ██║
--██║██║ ╚═╝ ██║██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║██║ ╚████║ ██║
--╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
Config.Debug = {
prints = false, --To enable debug prints.
drawLines = false, --The outlines of the separate ranges.
outerLines = {
['LS'] = {
front_left = vector3(12.22,-1091.27,29.9),
front_right = vector3(20.81,-1094.38,29.9),
rear_left = vector3(13.98,-1084.10,29.9),
rear_right = vector3(23.19,-1087.49,29.9),
},
['SF'] = {
front_left = vector3(824.89,-2168.94,29.9),
front_right = vector3(815.67,-2169.01,29.9),
rear_left = vector3(825.42,-2176.50,29.9),
rear_right = vector3(815.72,-2176.58,29.9),
},
}
}
--███╗ ███╗ █████╗ ██╗███╗ ██╗
--████╗ ████║██╔══██╗██║████╗ ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
--╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
Config.timeRange = 15 --(in seconds) How many seconds does the ranked shooting session last for?
Config.waitCooldown = 5 --(in seconds) How many seconds does the countdown last for?
--██╗ ██╗███████╗██╗ ██╗███████╗ █████╗ ███╗ ██╗██████╗ ██████╗ ██████╗ ███╗ ███╗███╗ ███╗ █████╗ ███╗ ██╗██████╗ ███████╗
--██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ██╔══██╗████╗ ██║██╔══██╗ ██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗ ██║██╔══██╗██╔════╝
--█████╔╝ █████╗ ╚████╔╝ ███████╗ ███████║██╔██╗ ██║██║ ██║ ██║ ██║ ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║ ██║███████╗
--██╔═██╗ ██╔══╝ ╚██╔╝ ╚════██║ ██╔══██║██║╚██╗██║██║ ██║ ██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║ ██║╚════██║
--██║ ██╗███████╗ ██║ ███████║ ██║ ██║██║ ╚████║██████╔╝ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║██║ ╚████║██████╔╝███████║
--╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝
Config.MoveTarget = {
ENABLE = true, --Do you want to allow player's to move the gunrange targets?
command = 'gunrange_movetarget', --The chat command.
description = L('command_movetarget'), --The chat command's description.
key = 'i'
}
Config.PracticeMode = {
ENABLE = true, --Do you want to allow player's to practise in a unranked gunrange session?
command = 'gunrange_practice',
description = L('command_practice'),
key = 'u'
}
Config.Start = {
ENABLE = true, --Do you want to allow player's to start a ranked gunrange session?
command = 'gunrange_start',
description = L('command_start'),
key = 'o'
}
Config.ScoreBoard = {
ENABLE = true, --Do you want to allow player's to view the scoreboard from ranked gunrange sessions?
command ='gunrange_scoreboard',
description = L('command_scoreboard')
}
-- ██████╗ ████████╗██╗ ██╗███████╗██████╗
--██╔═══██╗╚══██╔══╝██║ ██║██╔════╝██╔══██╗
--██║ ██║ ██║ ███████║█████╗ ██████╔╝
--██║ ██║ ██║ ██╔══██║██╔══╝ ██╔══██╗
--╚██████╔╝ ██║ ██║ ██║███████╗██║ ██║
-- ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
function Round(cd) return math.floor(cd+0.5) end
function Trim(cd) return cd:gsub('%s+', '') end
Config.scoreCategory = { --⚠️PLEASE READ⚠️; DO NOT CHANGE THESE IF YOU DON'T KNOW WHAT YOUR DOING.
[1] = {
name='Special weapons',
weaponList = {
`weapon_stungun`,
`weapon_flaregun`,
`weapon_raypistol`,
},
},
[2] = {
name='Handguns',
weaponList = {
`weapon_appistol`,
`weapon_combatpistol`,
`weapon_doubleaction`,
`weapon_heavypistol`,
`weapon_revolver_mk2`,
`weapon_revolver`,
`weapon_pistol50`,
`weapon_pistol_mk2`,
`weapon_pistol`,
`weapon_snspistol_mk2`,
`weapon_snspistol`,
`weapon_vintagepistol`,
`weapon_marksmanpistol`
},
},
[3] = {
name='SMG',
weaponList = {
`weapon_machinepistol`,
`weapon_microsmg`,
`weapon_minismg`,
`weapon_smg_mk2`,
`weapon_smg`,
`weapon_assaultsmg`
}
},
[4] = {
name='Snipers',
weaponList = {
`weapon_heavysniper_mk2`,
`weapon_heavysniper`,
`weapon_marksmanrifle_mk2`,
`weapon_marksmanrifle`,
`weapon_sniperrifle`,
`weapon_musket`,
}
},
[5] = {
name='LMG',
weaponList = {
`weapon_mg`,
`weapon_gusenberg`,
`weapon_combatmg`,
`weapon_combatmg_mk2`,
}
},
[6] = {
name='Assault Rifles',
weaponList = {
`weapon_advancedrifle`,
`weapon_assaultrifle_mk2`,
`weapon_bullpuprifle_mk2`,
`weapon_bullpuprifle`,
`weapon_carbinerifle_mk2`,
`weapon_carbinerifle`,
`weapon_compactrifle`,
`weapon_specialcarbine_mk2`,
`weapon_specialcarbine`,
`weapon_assaultrifle`
}
},
[7] = {
name='Shotguns',
weaponList = {
`weapon_assaultshotgun`,
`weapon_bullpupshotgun`,
`weapon_dbshotgun`,
`weapon_heavyshotgun`,
`weapon_pumpshotgun`,
`weapon_pumpshotgun_mk2`,
`weapon_autoshotgun`,
`weapon_sawnoffshotgun`
}
},
}
Config.Scoring = { --⚠️PLEASE READ⚠️; DO NOT CHANGE THESE IF YOU DON'T KNOW WHAT YOUR DOING.
['ammunation'] = {
[1] = {
points=10,
name='headshot',
location = {
left = -3.525,
right = 5.2223,
topz = 56.0,
botz = 48.009,
}
},
[2] = {
points=10,
name='center',
location = {
left = -6.45,
right = 7.15,
topz = 6.605,
botz = -9.99,
}
},
[3] = {
points = 9,
name="inner1",
location = {
left = -13.754,
right = 15.100,
topz = 15.0644,
botz = -16.569,
}
},
[4] = {
points = 8,
name="inner2",
location = {
left = -20.5739,
right = 22.2024,
topz = 21.7667,
botz = -23.907,
}
},
[5] = {
points = 7,
name="inner3",
location = {
left = -29.8640,
right = 29.318,
topz = 31.62,
botz = -31.794,
}
},
},
['mrpd'] = {
offsetSide = -15,
offsetHeight = 82,
[1] = {
points=10,
name='headshot',
location = {
left = 5.9655,
right = -9.3481,
topz = 42.9687,
botz = 27.7698,
}
},
[2] = {
points=10,
name='center',
location = {
left = 0.4235,
right = -4.3249,
topz = 5.8239,
botz = -0.19013,
}
},
[3] = {
points = 9,
name="inner1",
location = {
left = 4.512,
right = -8.2006,
topz = 12.9612,
botz = -6.6121,
}
},
[4] = {
points = 8,
name="inner2",
location = {
left = 8.5046,
right = -11.1730,
topz = 17.6636,
botz = -11.26,
}
},
[5] = {
points = 7,
name="inner3",
location = {
left = 11.6906,
right = -14.9938,
topz = 23.3333,
botz = -16.7474,
}
},
},
}
-- █████╗ ██╗ ██╗████████╗ ██████╗ ██████╗ ███████╗████████╗███████╗ ██████╗████████╗
--██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
--███████║██║ ██║ ██║ ██║ ██║ ██║ ██║█████╗ ██║ █████╗ ██║ ██║
--██╔══██║██║ ██║ ██║ ██║ ██║ ██║ ██║██╔══╝ ██║ ██╔══╝ ██║ ██║
--██║ ██║╚██████╔╝ ██║ ╚██████╔╝ ██████╔╝███████╗ ██║ ███████╗╚██████╗ ██║
--╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝
-----DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
if Config.Framework == 'auto_detect' then
if GetResourceState(Config.FrameworkTriggers.esx.resource_name) == 'started' then
Config.Framework = 'esx'
elseif GetResourceState(Config.FrameworkTriggers.qbcore.resource_name) == 'started' then
Config.Framework = 'qbcore'
else
Config.Framework = 'standalone'
end
if Config.Framework == 'esx' or Config.Framework == 'qbcore' then
for c, d in pairs(Config.FrameworkTriggers[Config.Framework]) do
Config.FrameworkTriggers[c] = d
end
Config.FrameworkTriggers.esx, Config.FrameworkTriggers.qbcore = nil, nil
end
end
if GetResourceState('cfx-gabz-ammunation') == 'started' then
Config.UsingGabzMaps = true
else
Config.UsingGabzMaps = false
end
if Config.UsingGabzMaps then
for c, d in pairs(Config.gunRangeLocation) do
d.enabled = true
end
for c, d in pairs(Config.CustomGunrange) do
d.enabled = false
end
else
for c, d in pairs(Config.gunRangeLocation) do
d.enabled = false
end
for c, d in pairs(Config.CustomGunrange) do
d.enabled = true
end
end
if Config.Notification == 'auto_detect' then Config.Notification = Config.Framework if Config.Notification == 'standalone' then Config.Notification = 'chat' end end
-----DO NOT TOUCH ANYTHING ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
```
\===
\=== Locales
============================================================================
\=== Locales UI
==============================================================================
::::
---
---
url: /paid-scripts/terminal-hacker-minigame.md
description: >-
FiveM terminal hacking mini-game with file system exploration, score tracking,
and leaderboard. Customizable difficulty with export integration for robbery
scripts.
---
# Terminal Hacker
[**Buy Here**](https://codesign.pro/product/4206364)
[**FiveM Forums Post**](https://forum.cfx.re/t/paid-terminal-hacker-minigame-by-codesign/2071255)
[**YouTube Showcase Video**](https://youtu.be/jY3yl4cVT9Q)
## INSTALLATION GUIDE
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
**2.** Unzip the `cd_terminalhacker.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_terminalhacker`.
### Step 1 - Configure Resource
You **MUST** read all configurable options inside the **`[cd_terminalhacker/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [commented out help text](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important section is the options under the** [**Important** ](https://i.imgur.com/IVm7E8l.png)**section at the top of the `config.lua`. Everything else is optional.**
### Step 2 - Integrate Into Your Robbery Resources
This works like any other hacking mini-game for FiveM, just more interactive. You would place the export (as seen below) in a robbery script, for example, and if the player completes the hack, you can either reward the player or allow them to progress to the next stage. The scoreboard allows players to compete for the bragging rights of the best hacker.
*The code below can only be placed inside a client.lua file, not a server.lua file.*
```lua
local example = exports['cd_terminalhacker']:StartTerminalHacking()
if example.success then
print('im a winner')
print(example.time) --Returns the amount of time taken to complete (in seconds).
print(example.score) --Returns the score. (You gain a higher score from downloading more optional files).
else
print('i suck so bad')
end
```
## INFORMATION
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| **Command** | **Description** |
| --------------------- | ------------------------------------------------------------------------- |
| **`/terminalhacker`** | (Test Command) This is a test command which opens the terminal hacker UI. |
### **About The Game**
The hacking game's point is finding the proper .exe file somewhere in a remote PC's directory. Some .exe files are corrupted and will set you back. (You need to figure out which is which). Along your search path, you are supposed to download additional files from the file system and gain a score. Score and time taken to determine the leader board placement, and the server owner can set their actions based on time and score.
## COMMON ISSUES
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) 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.
## ERROR CODES
If you see an error code not listed below, please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).
::::tabs
\=== Server
N/A
===
\=== Client
N/A
===
::::
## CHANGELOG
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
::::tabs
\=== v3.0.0
### 26/12/2020 - 21/06/2021
v3.0.0 - v3.0.4
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: warning
**Fix**
* Fixed random server error on server start.
* Fixed a login bug fix.
* 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.
* Fix for terminalhacker not properly resetting after exiting.
:::
\===
\=== v4.0.0
### 02/11/2021
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: danger
**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).**
:::
\===
\=== v4.0.1
### 08/11/2021
**Files Changed:**
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```
fxmanifest.lua - (IMPORTANT)
server/main/server.lua - (IMPORTANT)
client/main/client.lua - (IMPORTANT)
html (FULL FOLDER) - (IMPORTANT)
```
**Update Type:**
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: danger
**Authentication**
* **Small authentication update to ensure stability**.
:::
\===
::::
---
---
url: /paid-scripts/terminal-hacker-minigame/configs-locales-and-sql.md
description: >-
Configuration, locales, and SQL setup for cd_terminalhacker. Includes
difficulty settings, scoring, leaderboard, and export configuration for the
terminal hacking mini-game.
---
# Configs, Locales & SQL
::::tabs
\=== Config
```lua
Config = {}
Config.UseScoreTables = true --If enabled, the script will save and display a leaderboard of the best hackers.
Config.EnableTestCommand = false --Set to true to enable the test command 'terminalhacker'.
```
\===
\=== Config/Locales UI
=======================================================================================
::::
---
---
url: /paid-scripts/spawn-select.md
description: >-
FiveM spawn selector system with customizable spawn locations, personal
spawns, and last location tracking. Supports ESX, QBCore, vRP, and standalone
frameworks.
---
# Spawn Select
[**Buy Here**](https://codesign.pro/product/4206363)
[**FiveM Forums Post**](https://forum.cfx.re/t/paid-spawn-selector-by-codesign/2030503)
[**YouTube Showcase Video**](https://youtu.be/2mIqabOUCLc)
## INSTALLATION GUIDE
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
**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 ](https://i.imgur.com/bbb0dam.png)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](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections 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 the**`READ_ME_AFTER_PURCHASING`** folder, the file is named **`SQL_main.sql`**. Watch this video if you are unsure how to do this [HeidiSQL ](https://youtu.be/s3tqlHV3yb0)/ [PHPMyAdmin](https://youtu.be/NXqmYn7bbMM).
### Step 4 - Required Changes
::::tabs
\=== ESX
There are **no required changes** you need to make. All you need to do is configure the `config.lua` correctly.
===============================================================================================================
\=== QBCore
**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:** 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.
```lua [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.
```lua:line-numbers=52 [client_customise_me.lua]
-- 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 configure the `config.lua` correctly.
\=== vRP
There are **no required changes** you need to make. All you need to do is configure the `config.lua` correctly.
\=== No-framework
There are **no required changes** you need to make. All you need to do is configure the `config.lua` correctly.
\=== Other (custom framework)
There are **no required changes** you need to make. All you need to do is configure the `config.lua` correctly.
::::
## 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`.
::: code-group
```lua [client-side to client-side]
TriggerEvent('cd_spawnselect:OpenUI')
```
```lua [From server to client]
TriggerClientEvent('cd_spawnselect:OpenUI', source)
```
:::
## INFORMATION
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| **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. |
## COMMON ISSUES
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) 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](https://docs.codesign.pro/paid-scripts/spawn-select#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](https://discord.gg/codesign).
::::tabs
\=== Server
N/A
===
\=== Client
**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.
::::
## CHANGELOG
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
::::tabs
\=== v3.0.0
### 26/12/2020 - 19/10/2021
v3.0.0 - v3.1.2
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: tip
**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.
:::
::: info
**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.
:::
::: warning
**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.
:::
\===
\=== v4.0.0
### 03/11/2021
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
Update Type:
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: danger
**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).**
:::
::: tip
**Add**
* Added compatibility for oxmysq
:::
\===
\=== v4.0.1
### 08/11/2021
**Files Changed:**
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```lua
fxmanifest.lua - (IMPORTANT)
server/main/server.lua - (IMPORTANT)
client/main/client.lua - (IMPORTANT)
html (FULL FOLDER) - (IMPORTANT)
```
**Update Type:**
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: danger
**Authentication**
* **Small authentication update to ensure stability**.
:::
\===
\=== v4.0.2
### 22/04/2022
**Files Changed:**
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```lua
fxmanifest.lua - (IMPORTANT)
server/server.lua
configs/client_customise_me.lua
```
**Update Type:**
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
::: tip
**Add**
* Added compatibility with latest oxmysql.
:::
::: warning
**Fix**
* Fixed an issue where the UI would open before the script has fully loaded.
:::
\===
\=== v4.0.3
### 09/08/2022
**Files Changed:**
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```lua
fxmanifest.lua - (IMPORTANT)
html (FULL FOLDER) - (IMPORTANT)
```
**Update Type:**
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
::: tip
**Add**
* Added the ability for users to zoom and scroll on the spawnselect map UI (same as dispatch).
:::
\===
::::
---
---
url: /paid-scripts/spawn-select/configs-locales-and-sql.md
description: >-
Configuration, locales, and SQL setup for cd_spawnselect. Includes framework
auto-detect, spawn locations, personal spawns, and last location settings.
---
# Configs, Locales & SQL
::::tabs
\=== Config
```lua
Config = {}
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
Config.Database = 'mysql' --[ 'mysql' / 'ghmattimysql' / 'oxmysql' ] Choose your sql database script.
Config.Framework = 'esx' ---[ 'esx' / 'qbcore' / 'vrp' / 'none' / 'other' ] Choose your framework.
Config.Language = 'EN' --[ 'EN' / 'BG' / 'DE' / 'CZ' / 'ES' / 'FI' / 'FR' / 'NL' / 'SE' / 'SK' ] You can add your own locales to the Locales.lua. But make sure to change the Config.Language to match it.
Config.FrameworkTriggers = { --You can change the esx/qbcore events (IF NEEDED).
main = 'esx:getSharedObject', --ESX = 'esx:getSharedObject' QBCORE = 'QBCore:GetObject'
load = 'esx:playerLoaded', --ESX = 'esx:playerLoaded' QBCORE = 'QBCore:Client:OnPlayerLoaded'
job = 'esx:setJob', --ESX = 'esx:setJob' QBCORE = 'QBCore:Client:OnJobUpdate'
resource_name = 'es_extended' --ESX = 'es_extended' QBCORE = 'qb-core'
}
Config.NotificationType = { --[ 'esx' / 'qbcore' / 'mythic_old' / 'mythic_new' / 'chat' / 'other' ] Choose your notification script.
server = 'esx',
client = 'esx'
}
--██╗███╗ ███╗██████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗████████╗
--██║████╗ ████║██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝
--██║██╔████╔██║██████╔╝██║ ██║██████╔╝ ██║ ███████║██╔██╗ ██║ ██║
--██║██║╚██╔╝██║██╔═══╝ ██║ ██║██╔══██╗ ██║ ██╔══██║██║╚██╗██║ ██║
--██║██║ ╚═╝ ██║██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║██║ ╚████║ ██║
--╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
Config.SpawnOptions = {
last = true, --Do you want to allow players to spawn in their last saved position (this requires either esx, qbcore or you can edit the code and use your own framework).
job = true, --Do you want to allow players with defined jobs to spawn at their workplace (this requires either esx, qbcore or you can edit the code and use your own framework).
personal = true, --Do you want to allow a player to set and choose their own personal spawn location (this requires either esx, qbcore or you can edit the code and use your own framework).
personal_command = 'personalspawn' --Set the name of the command to show/set/delete your personal spawn location.
}
--███╗ ███╗ █████╗ ██╗███╗ ██╗
--████╗ ████║██╔══██╗██║████╗ ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
--╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
Config.EnableTestCommand = false --Set to true to enable the test command '/openspawnselect'.
Config.BuggedSpawnCoords = {x = 314.86, y = -213.28, z = 54.09, h = 44.56} --If there is an error or the database coords are nil, this will be a backup spawn location.
Config.DayHours = {[1] = 6, [2] = 22} --If the game time is between 6am (6) to 10pm (22) then dark mode will be enabled, else lightmode will be enabled (using 24 hour clock).
Config.JobSpawnsCoords = { --If Config.Job_Spawns is enabled then you can customise which jobs are eligable and where they spawn.
['ambulance'] = {x = 296.09, y = -601.04, z = 43.35, h = 93.08, name = 'LSFD'},
['mechanic'] = {x = 949.64, y = -986.29, z = 39.83, h = 110.17, name = 'Mechanic'},
['police'] = {x = 435.48, y = -975.08, z = 30.72, h = 83.66, name = 'Police'},
['cardealer'] = {x = -815.98, y = -194.89, z = 37.52, h = 115.08, name = 'Car Dealer'},
['taxi'] = {x = 907.01, y = -164.23, z = 74.12, h = 162.66, name = 'Taxi'},
--['change_me'] = {x = 00.0, y = 00.0, z = 00.0, z = 00.0, h = 00.0, name = 'change_me'},
}
Config.MainSpawns = { --The names in the mapdata.js must match with the name here to get the correct coordinates.
['The Kortz Center'] = {x = -2291.47, y = 366.14, z = 174.6, h = 27.47},
['Maze Bank Arena'] = {x = -249.82, y = -2031.23, z = 29.95, h = 230.62},
['Sandy Shores Sheriff\'s Station'] = {x = 1877.17, y = 3706.46, z = 33.19, h = 169.16},
['Bolingbroke Penitentiary'] = {x = 1852.88, y = 2581.95, z = 45.67, h = 283.87},
['Luxury Autos'] = {x = -815.98, y = -194.89, z = 37.52, h = 115.08},
['Vinewood Motel'] = {x = 436.25, y = 215.84, z = 103.17, h = 338.43},
['Mission Row Police Department'] = {x = 435.48, y = -975.08, z = 30.72, h = 83.66},
['Paleto Bay Troopers Office'] = {x = -448.05, y = 5986.79, z = 31.49, h = 20.64},
['Paleto Garage'] = {x = 101.82, y = 6617.12, z = 32.47, h = 239.29},
['Grapeseed Store'] = {x = 1692.32, y = 4917.21, z = 42.08, h = 59.45},
['Airport - LSIA'] = {x = -1036.96, y = -2736.84, z = 20.17, h = 327.0},
['Del Perro Pier'] = {x = -1691.58, y = -1099.54, z = 13.15, h = 47.01},
['Eastern Motel'] = {x = 317.9, y = 2623.21, z = 44.47, h = 292.39},
['Stab City'] = {x = 79.08, y = 3708.11, z = 41.08, h = 53.36},
['Sandy Shores Airport'] = {x = 1759.0, y = 3298.66, z = 41.74, h = 143.01},
['Vinewood Casino'] = {x = 926.66, y = 45.63, z = 80.9, h = 57.57},
['Grove Street Garage'] = {x = -78.47, y = -1832.54, z = 27.03, h = 320.42},
['Mirror Park Garage'] = {x = 1033.57, y = -768.57, z = 58.0, h = 49.98},
--['change_me'] = {x = 00.0, y = 00.0, z = 00.0, h = 00.0},
}
-- ██████╗ ████████╗██╗ ██╗███████╗██████╗
--██╔═══██╗╚══██╔══╝██║ ██║██╔════╝██╔══██╗
--██║ ██║ ██║ ███████║█████╗ ██████╔╝
--██║ ██║ ██║ ██╔══██║██╔══╝ ██╔══██╗
--╚██████╔╝ ██║ ██║ ██║███████╗██║ ██║
-- ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
function L(l) return Locales[Config.Language][l] end
if Config.Framework == 'vrp' or Config.Framework == 'none' then --if you use vrp or no framework we will disable last position, job spawns and personal spawns.
Config.SpawnOptions.last = false
Config.SpawnOptions.job = false
Config.SpawnOptions.personal = false
end
```
\===
\=== Mapdata UI
```javascript
let dotMap = {
spawns: [
{
name: "The Kortz Center",
x:-369.507,
y:2291.913,
icon:"pin",
iconSelected:"pinSel",
image:"images/kortzcenter.jpg",
description:"The Center is home to cultural foundations, research centers, and museums. It is divided into four buildings: Low Rotunda, Bell Building, Biranda Building, and Moseley Building. There are sculptures, terraces, and gardens in its area, as well as a vehicle parking and a labyrinth."
},
{
name:"Maze Bank Arena",
x:2028.35,
y:252.17,
icon:"pin",
iconSelected:"pinSel",
image:"images/mazebankarena.jpg",
description:"Home to the Los Santos Panic basketball team, auditions for the hit reality talent show Fame or Shame - hosted by the celebrity who just won't go away, Lazlow - are also being filmed at the Maze Bank Arena."
},
{
name:"Sandy Shores Sheriff's Station",
x:-3694.049,
y:-1880.583,
icon:"pin",
iconSelected:"pinSel",
image:"images/sandy.jpg",
description:"The office occupies the eastern end of the long single level rectangular building."
},
{
name:"Bolingbroke Penitentiary",
x:-2592.443,
y:-1869.958,
icon:"pin",
iconSelected:"pinSel",
image:"images/bolingbroke.jpg",
description:"It is governed by the San Andreas State Prison Authority. The prison is located on the Los Santos County side of Route 68, just down the road from Harmony. The prison's shape is that of an octagon."
},{
name: "Luxury Autos",
x:241.99,
y:809,
icon:"pin",
iconSelected:"pinSel",
image:"images/dealer.jpg",
description:"It is located on the ground floor of the multi-level Rockford Hills Valet Parking building at the intersection of Mad Wayne Thunder Drive and Eastbourne Way in Rockford Hills, Los Santos."
},{
name:"Vinewood Motel",
x:-275.875,
y:-376.42,
icon:"pin",
iconSelected:"pinSel",
image:"images/vinewoodmotel.jpg",
description:"Located in Vinewood, this motel serves as a starting ground to most Los Santos visitors, as it offers the cheapest services."
},
{
name:"Mission Row Police Department",
x:975,
y:-435,
icon:"pin",
iconSelected:"pinSel",
image:"images/mrpd.jpg",
description:"The police station is a modern three-story building, demarcated by Sinner Street, Vespucci Boulevard, Atlee Street and Little Bighorn Avenue in Mission Row, Downtown Los Santos."
},
{
name:"Paleto Bay Troopers Office",
x:-6014.541,
y:428.026,
icon:"pin",
iconSelected:"pinSel",
image:"images/paletopd.jpg",
description:"The complex consists of a large rectangular building with a smaller second story. A communications array antenna is on the roof on the west side. On the east side, a second attached brick building with barred windows houses the County Jail."
},
{
name:"Paleto Garage",
x:-6600.243,
y:-142.675,
icon:"pin",
iconSelected:"pinSel",
image:"images/paletogarage.jpg",
description:"Paleto Bay is located on the lush northern coast of Blaine County, San Andreas. Sitting at the base of the massive Mount Chiliad, Paleto Bay is a coastal town, home to the Cluckin' Bell factory farm, used to process chicken for all of San Andreas to enjoy."
},
{
name:"Grapeseed Store",
x:-4929.627,
y:-1695.409,
icon:"pin",
iconSelected:"pinSel",
image:"images/grapeseed.jpg",
description:"Located at the northeast tip of the Alamo Sea, Grapeseed is a thriving agricultural and industrial community involved in the manufacturing of high-fructose corn syrup and meth."
},
{
name:"Airport - LSIA",
x:3234.7006835938,
y:1393.119140625,
icon:"pin",
iconSelected:"pinSel",
image:"images/lsia.jpg",
description:"One of the busiest airports in the world, with nowhere near enough infrastructure to support it, Los Santos International brings third-world service to first-world travel."
},
{
name:"Del Perro Pier",
x:1067.436,
y:1678.713,
icon:"pin",
iconSelected:"pinSel",
image:"images/delperro.jpg",
description:"Del Perro Pier is, as its name suggests, located in Del Perro, Los Santos. It is mainly accessed through Red Desert Avenue. Del Perro Pier is renowned for its bright, vivid colors that shine at night, giving the surrounding beaches a sort of vibe."
},
{
name:"Eastern Motel",
x:-2620.2,
y:-329.368,
icon:"pin",
iconSelected:"pinSel",
image:"images/easternmotel.jpg",
description:"The motel located at the intersection of Senora Road and the Route 68 approach in Harmony, Blaine County. It is a large motel featuring a large parking lot which serves as a spawn point for vehicles."
},
{
name:"Stab City",
x:-3702.08,
y:-66.784,
icon:"pin",
iconSelected:"pinSel",
image:"images/stabcity.jpg",
description:"Located just off Calafia Road, Stab City is a poverty-stricken trailer park, located on the western coast of the Alamo Sea at the source of the Zancudo River. The settlement consists of numerous run-down trailers with a dirt road circling the entire trailer park."
},
{
name:"Sandy Shores Airport",
x:-3277.219,
y:-1739.426,
icon:"pin",
iconSelected:"pinSel",
image:"images/sandyairfield.jpg",
description:"The airfield consists of three unnamed and unmarked runways: two large parallel runways that run east to west and a smaller runway that runs northeast to southwest."
},
{
name:"Vinewood Casino",
x:-46.753,
y:-930.426,
icon:"pin",
iconSelected:"pinSel",
image:"images/casino.jpg",
description:"It is based on the Hollywood Park Casino in Inglewood, California. But also shows resemblance to the Garden Paddock of Santa Anita Park in Arcadia, California."
},
{
name:"Grove Street Garage",
x:1840.846,
y:54.642,
icon:"pin",
iconSelected:"pinSel",
image:"images/grovestreet.jpg",
description:"Beginning at Davis Avenue in the northwest, with exits north to Brouge Avenue and an un-named northern street and ending in a cul-de-sac in the southeast, Grove Street is occupied by the Original Covenant Ballas."
},
{
name:"Mirror Park Garage",
x:773.067,
y:-1033.638,
icon:"pin",
iconSelected:"pinSel",
image:"images/mirrorpark.jpg",
description:"Mirror Park, like the rest of East Vinewood, is home to post-ironic hipsters driving Issis and drinking Bean Machine coffee. The area is based on Echo Park and Silver Lake in Los Angeles, known for having a high concentration of hipsters in residence."
}
]
}
```
\===
\=== Locales
==================================================================================
\=== Locales UI
====================================================================================
\=== SQL
Watch this video if you are unsure how to insert an SQL Query into your database.\
[HeidiSQL ](https://youtu.be/s3tqlHV3yb0)/ [PHPMyAdmin](https://youtu.be/NXqmYn7bbMM).
```sql
CREATE TABLE IF NOT EXISTS `spawnselect` (
`identifier` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_bin',
`personal_spawn` VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci'
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
;
```
\===
::::
---
---
url: /paid-scripts/multicharacter-character-selection.md
description: >-
FiveM multicharacter selection system with full character creation, switching,
and management. Supports ESX, QBCore, vRP, and standalone frameworks with skin
integration.
---
# Multicharacter
\~**Buy Here**~
[**FiveM Forums Post**](https://forum.cfx.re/t/paid-character-selection-by-codesign/2040419)
[**YouTube Showcase Video**](https://youtu.be/-VUD_EAK0mI)
## INSTALLATION GUIDE
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
**2.** Unzip the `cd_multicharacter.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_multicharacter`. 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_multicharacter
```
### Step 1 - Fxmanifest
Depending on your framework and dependencies, you may need to make some changes inside the **`[cd_multicharacter/fxmanifest.lua]`**. We have made this easier by [commenting ](https://i.imgur.com/bbb0dam.png)on the lines you possibly need to change.
### Step 2 - Configure Resource
You **MUST** read all configurable options inside the **`[cd_multicharacter/configs/config.lua]`** file and configure them to suit your server's needs. Please read the ["commented out help text"](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections at the top of the `config.lua`. Everything else is optional.**
> [**NEW: Auto Framework Detect!**](https://i.imgur.com/zNW8Kpg.png)
>
> Introducing our new 'auto\_detect' feature! It automatically identifies your framework and applies the appropriate default settings.
### **Step 3 -** SQL Database
You **MUST** import the SQL file to your database. This SQL file is located inside the**`READ_ME_AFTER_PURCHASING`** folder; the file is named **`SQL_main.sql`**. Watch this video if you are unsure how to do this [HeidiSQL ](https://youtu.be/s3tqlHV3yb0)/ [PHPMyAdmin](https://youtu.be/NXqmYn7bbMM).
### Step 4 - Install Dependencies
**Where can I find these dependencies?**
Open the **`[cd_multicharacter/dependencies]`** folder. The folders inside are the required dependencies. You will find a text file inside each folder that includes a GitHub download link. Alternatively, they are listed in the table below.
**Where should I put these dependencies?**
These resources should be placed in your resources folder like any other, but remember, you shouldn't put them in the cd\_multicharacter folder.
**Do I need to add them to the server start config?**
No, it will start automatically because it is listed as a dependency for this resource.
| Resource Name | Download | Details |
|-------------------|----------|------------------------------------------------------------------------------------------------|
| **cd\_drawtextui** | [Github](https://github.com/dsheedes/cd_drawtextui) | REQUIRED by default for the switch character locations if enabled but can be replaced/removed. |
### Step 5 - ESX Client Edit
We need to do a small modification to stop your framework from registering our character instantly when you load into the server.
::::tabs
\===ESX version 1.1
**`essentialmode/client/main.lua/line 5`** - comment out this code.
[**View the Example here.**](https://i.imgur.com/QmMb5tM.png)
\===ESX version 1.2
::: danger
**If your fxmanifest.lua says you are using version 1.2, you need to confirm your version.**
If you think you are using esx 1.2 please double-check and compare the code from these snippets, as in both esx 1.2 and esx 1.final say version 1.2 in the fxmanifest.lua. But in fact, the 2 versions are different and will cause major problems during installation if the wrong version is chosen in the config.lua of the multicharacter.
:::
**`es_extended/client/main.lua/line 36`** - comment out this code.
[View the Example here.](https://i.imgur.com/dEbKVQV.png)
\===ESX version 1.final
::: danger
**If your fxmanifest.lua says you are using version 1.2, you need to confirm your version.**
If you think you are using esx 1.2 please double-check and compare the code from these snippets, as in both esx 1.2 and esx 1.final both say version 1.2 in the fxmanifest.lua. But in fact, the 2 versions are different and will cause major problems during installation if the wrong version is chosen in the config of the multicharacter.
:::
**`es_extended/client/main.lua/line 3`** - comment out this code.
[**View the Example here.**](https://i.imgur.com/hOpz2Rk.png)
\===Extendedmode
**`extendedmode/client/main.lua/line 3`** - comment out this code.
[**View the Example here.**](https://i.imgur.com/OXQs0zO.png)
\===ESX Legacy 1.3.x
::: warning
Make sure the **`Config.Multichar`** in es\_extended's config.lua is set to **false**.
:::
**`es_extended/client/main.lua/line 3`** - comment out this code.
[**View the Example here.**](https://i.imgur.com/cmJ0DGM.png)
\===ESX Legacy 1.6.x
::: warning
Make sure the **`Config.Multichar`** in es\_extended's config.lua is set to **false**.
:::
**`es_extended/client/main.lua/line 3`** - comment out this code.
[**View the Example here.**](https://i.imgur.com/ZzKzGnG.png)
::::
### Step 6 - Player Skin Edit
We will be setting the skin of your chosen character directly from the cd\_multicharacter or cd\_identity, so we don't need your skin creator script to do this.
::::tabs
\===esx\_skin
**Part 1:** Find the block of code that looks similar to the examples below in the client-side `main.lua` and [comment out](https://developer.roblox.com/en-us/articles/Comment) the code.
::: info
There are many different versions and not all will look the exact same.
:::
**View the examples below:**
[**Example 1**](https://i.imgur.com/uPMKfwd.png)
[**Example 2**](https://i.imgur.com/3tuL2T4.png)
\===cui\_character
**Part 1:** Find the block of code below in the client-side main.lua and hash out/delete it. This event can normally be found on line 544. **View the** [**example**](https://i.imgur.com/OIjxbdI.png)**.**
**Part 2:** Copy and paste this block of code below into your `cui_character` script, anywhere in the client-side main.lua.
```lua
AddEventHandler('cui_character:SetPedClothes_multi')
RegisterNetEvent('cui_character:SetPedClothes_multi', function(new_character, skin)
playerLoaded = true
if new_character then
oldChar = GetDefaultCharacter(true)
LoadCharacter(oldChar)
TriggerEvent('cui_character:open', { 'identity', 'features', 'style', 'apparel' }, false)
else
oldLoadout = GetLoadout()
oldChar = skin
LoadCharacter(skin)
end
preparingSkin = false
end)
```
\===betrayed\_clothing
No changes are needed.
::::
### Step 7 - Multi-Peds Skin Edit
Now we need to copy and paste some code into your character skin creation script to set the skin of the peds. Currently, we support 3 different clothing scripts. However, we have 2 different methods for esx\_skin as the first supports older versions and the second supports newer versions, but always try the older version first.
::::tabs
\=== esx\_skin (older versions)
::: info
If you use esx\_skin, use this version first.
:::
**Part 1 -** Copy and paste this export below into your **`skinchanger`** script, anywhere in the client-side main.lua.
```lua
exports('GetPedList', function()
return pedList
end)
```
**Part 2 -** Copy and paste this block of code below into your **`skinchanger`** script, at the very bottom of the client-side main.lua.
```lua
RegisterNetEvent('skinchanger:loadSkin2')
AddEventHandler('skinchanger:loadSkin2', function(multipedID, skin)
local MultiPed = {}
for i=1, #Components, 1 do
MultiPed[Components[i].name] = Components[i].value
end
for k,v in pairs(skin) do
MultiPed[k] = v
end
SetPedHeadBlendData (multipedID, MultiPed['face'], MultiPed['face'], MultiPed['face'], MultiPed['skin'], MultiPed['skin'], MultiPed['skin'], 1.0, 1.0, 1.0, true)
SetPedHairColor (multipedID, MultiPed['hair_color_1'], MultiPed['hair_color_2']) -- Hair Color
SetPedHeadOverlay (multipedID, 3, MultiPed['age_1'], (MultiPed['age_2'] / 10) + 0.0) -- Age + opacity
SetPedHeadOverlay (multipedID, 1, MultiPed['beard_1'], (MultiPed['beard_2'] / 10) + 0.0) -- Beard + opacity
SetPedEyeColor (multipedID, MultiPed['eye_color'], 0, 1) -- Eyes color
SetPedHeadOverlay (multipedID, 2, MultiPed['eyebrows_1'], (MultiPed['eyebrows_2'] / 10) + 0.0) -- Eyebrows + opacity
SetPedHeadOverlay (multipedID, 4, MultiPed['makeup_1'], (MultiPed['makeup_2'] / 10) + 0.0) -- Makeup + opacity
SetPedHeadOverlay (multipedID, 8, MultiPed['lipstick_1'], (MultiPed['lipstick_2'] / 10) + 0.0) -- Lipstick + opacity
SetPedComponentVariation (multipedID, 2, MultiPed['hair_1'], MultiPed['hair_2'], 2) -- Hair
SetPedHeadOverlayColor (multipedID, 1, 1, MultiPed['beard_3'], MultiPed['beard_4']) -- Beard Color
SetPedHeadOverlayColor (multipedID, 2, 1, MultiPed['eyebrows_3'], MultiPed['eyebrows_4']) -- Eyebrows Color
SetPedHeadOverlayColor (multipedID, 4, 1, MultiPed['makeup_3'], MultiPed['makeup_4']) -- Makeup Color
SetPedHeadOverlayColor (multipedID, 8, 1, MultiPed['lipstick_3'], MultiPed['lipstick_4']) -- Lipstick Color
SetPedHeadOverlay (multipedID, 5, MultiPed['blush_1'], (MultiPed['blush_2'] / 10) + 0.0) -- Blush + opacity
SetPedHeadOverlayColor (multipedID, 5, 2, MultiPed['blush_3']) -- Blush Color
SetPedHeadOverlay (multipedID, 6, MultiPed['complexion_1'], (MultiPed['complexion_2'] / 10) + 0.0) -- Complexion + opacity
SetPedHeadOverlay (multipedID, 7, MultiPed['sun_1'], (MultiPed['sun_2'] / 10) + 0.0) -- Sun Damage + opacity
SetPedHeadOverlay (multipedID, 9, MultiPed['moles_1'], (MultiPed['moles_2'] / 10) + 0.0) -- Moles/Freckles + opacity
SetPedHeadOverlay (multipedID, 10, MultiPed['chest_1'], (MultiPed['chest_2'] / 10) + 0.0) -- Chest Hair + opacity
SetPedHeadOverlayColor (multipedID, 10, 1, MultiPed['chest_3']) -- Torso Color
SetPedHeadOverlay (multipedID, 11, MultiPed['bodyb_1'], (MultiPed['bodyb_2'] / 10) + 0.0) -- Body Blemishes + opacity
if MultiPed['ears_1'] == -1 then
ClearPedProp(multipedID, 2)
else
SetPedPropIndex (multipedID, 2, MultiPed['ears_1'], MultiPed['ears_2'], 2) -- Ears Accessories
end
SetPedComponentVariation (multipedID, 8, MultiPed['tshirt_1'], MultiPed['tshirt_2'], 2) -- Tshirt
SetPedComponentVariation (multipedID, 11, MultiPed['torso_1'], MultiPed['torso_2'], 2) -- torso parts
SetPedComponentVariation (multipedID, 3, MultiPed['arms'], MultiPed['arms_2'], 2) -- Amrs
SetPedComponentVariation (multipedID, 10, MultiPed['decals_1'], MultiPed['decals_2'], 2) -- decals
SetPedComponentVariation (multipedID, 4, MultiPed['pants_1'], MultiPed['pants_2'], 2) -- pants
SetPedComponentVariation (multipedID, 6, MultiPed['shoes_1'], MultiPed['shoes_2'], 2) -- shoes
SetPedComponentVariation (multipedID, 1, MultiPed['mask_1'], MultiPed['mask_2'], 2) -- mask
SetPedComponentVariation (multipedID, 9, MultiPed['bproof_1'], MultiPed['bproof_2'], 2) -- bulletproof
SetPedComponentVariation (multipedID, 7, MultiPed['chain_1'], MultiPed['chain_2'], 2) -- chain
SetPedComponentVariation (multipedID, 5, MultiPed['bags_1'], MultiPed['bags_2'], 2) -- Bag
if MultiPed['helmet_1'] == -1 then
ClearPedProp(multipedID, 0)
else
SetPedPropIndex (multipedID, 0, MultiPed['helmet_1'], MultiPed['helmet_2'], 2) -- Helmet
end
if MultiPed['glasses_1'] == -1 then
ClearPedProp(multipedID, 1)
else
SetPedPropIndex (multipedID, 1, MultiPed['glasses_1'], MultiPed['glasses_2'], 2) -- Glasses
end
if MultiPed['watches_1'] == -1 then
ClearPedProp(multipedID, 6)
else
SetPedPropIndex (multipedID, 6, MultiPed['watches_1'], MultiPed['watches_2'], 2) -- Watches
end
if MultiPed['bracelets_1'] == -1 then
ClearPedProp(multipedID, 7)
else
SetPedPropIndex (multipedID, 7, MultiPed['bracelets_1'], MultiPed['bracelets_2'], 2) -- Bracelets
end
MultiPed = nil
end)
```
\=== esx\_skin (newer versions)
::: info
If you use esx\_skin and the first version showed errors in f8 from `skinchanger` related to ***blemishes***, use this version instead.
:::
**Part 1:** Copy and paste this export below into your **`skinchanger`** script, anywhere in the client-side main.lua.
```lua
exports('GetPedList', function()
return pedList
end)
```
**Part 2:** Copy and paste this block of code below into your **`skinchanger`** script, at the very bottom of the client-side main.lua.
```lua
RegisterNetEvent('skinchanger:loadSkin2')
AddEventHandler('skinchanger:loadSkin2', function(multipedID, skin)
local MultiPed = {}
for i=1, #Components, 1 do
MultiPed[Components[i].name] = Components[i].value
end
for k,v in pairs(skin) do
MultiPed[k] = v
end
SetPedHeadBlendData (multipedID, MultiPed['face'], MultiPed['face'], MultiPed['face'], MultiPed['skin'], MultiPed['skin'], MultiPed['skin'], 1.0, 1.0, 1.0, true)
SetPedHairColor (multipedID, MultiPed['hair_color_1'], MultiPed['hair_color_2']) -- Hair Color
SetPedHeadOverlay (multipedID, 3, MultiPed['age_1'], (MultiPed['age_2'] / 10) + 0.0) -- Age + opacity
SetPedHeadOverlay (multipedID, 1, MultiPed['beard_1'], (MultiPed['beard_2'] / 10) + 0.0) -- Beard + opacity
SetPedEyeColor (multipedID, MultiPed['eye_color'], 0, 1) -- Eyes color
SetPedHeadOverlay (multipedID, 2, MultiPed['eyebrows_1'], (MultiPed['eyebrows_2'] / 10) + 0.0) -- Eyebrows + opacity
SetPedHeadOverlay (multipedID, 4, MultiPed['makeup_1'], (MultiPed['makeup_2'] / 10) + 0.0) -- Makeup + opacity
SetPedHeadOverlay (multipedID, 8, MultiPed['lipstick_1'], (MultiPed['lipstick_2'] / 10) + 0.0) -- Lipstick + opacity
SetPedComponentVariation (multipedID, 2, MultiPed['hair_1'], MultiPed['hair_2'], 2) -- Hair
SetPedHeadOverlayColor (multipedID, 1, 1, MultiPed['beard_3'], MultiPed['beard_4']) -- Beard Color
SetPedHeadOverlayColor (multipedID, 2, 1, MultiPed['eyebrows_3'], MultiPed['eyebrows_4']) -- Eyebrows Color
SetPedHeadOverlayColor (multipedID, 4, 1, MultiPed['makeup_3'], MultiPed['makeup_4']) -- Makeup Color
SetPedHeadOverlayColor (multipedID, 8, 1, MultiPed['lipstick_3'], MultiPed['lipstick_4']) -- Lipstick Color
SetPedHeadOverlay (multipedID, 5, MultiPed['blush_1'], (MultiPed['blush_2'] / 10) + 0.0) -- Blush + opacity
SetPedHeadOverlayColor (multipedID, 5, 2, MultiPed['blush_3']) -- Blush Color
SetPedHeadOverlay (multipedID, 9, MultiPed['moles_1'], (MultiPed['moles_2'] / 10) + 0.0) -- Moles/Freckles + opacity
SetPedHeadOverlay (multipedID, 10, MultiPed['chest_1'], (MultiPed['chest_2'] / 10) + 0.0) -- Chest Hair + opacity
SetPedHeadOverlayColor (multipedID, 10, 1, MultiPed['chest_3']) -- Torso Color
if MultiPed['ears_1'] == -1 then
ClearPedProp(multipedID, 2)
else
SetPedPropIndex (multipedID, 2, MultiPed['ears_1'], MultiPed['ears_2'], 2) -- Ears Accessories
end
SetPedComponentVariation (multipedID, 8, MultiPed['tshirt_1'], MultiPed['tshirt_2'], 2) -- Tshirt
SetPedComponentVariation (multipedID, 11, MultiPed['torso_1'], MultiPed['torso_2'], 2) -- torso parts
SetPedComponentVariation (multipedID, 3, MultiPed['arms'], MultiPed['arms_2'], 2) -- Amrs
SetPedComponentVariation (multipedID, 10, MultiPed['decals_1'], MultiPed['decals_2'], 2) -- decals
SetPedComponentVariation (multipedID, 4, MultiPed['pants_1'], MultiPed['pants_2'], 2) -- pants
SetPedComponentVariation (multipedID, 6, MultiPed['shoes_1'], MultiPed['shoes_2'], 2) -- shoes
SetPedComponentVariation (multipedID, 1, MultiPed['mask_1'], MultiPed['mask_2'], 2) -- mask
SetPedComponentVariation (multipedID, 9, MultiPed['bproof_1'], MultiPed['bproof_2'], 2) -- bulletproof
SetPedComponentVariation (multipedID, 7, MultiPed['chain_1'], MultiPed['chain_2'], 2) -- chain
SetPedComponentVariation (multipedID, 5, MultiPed['bags_1'], MultiPed['bags_2'], 2) -- Bag
if MultiPed['helmet_1'] == -1 then
ClearPedProp(multipedID, 0)
else
SetPedPropIndex (multipedID, 0, MultiPed['helmet_1'], MultiPed['helmet_2'], 2) -- Helmet
end
if MultiPed['glasses_1'] == -1 then
ClearPedProp(multipedID, 1)
else
SetPedPropIndex (multipedID, 1, MultiPed['glasses_1'], MultiPed['glasses_2'], 2) -- Glasses
end
if MultiPed['watches_1'] == -1 then
ClearPedProp(multipedID, 6)
else
SetPedPropIndex (multipedID, 6, MultiPed['watches_1'], MultiPed['watches_2'], 2) -- Watches
end
if MultiPed['bracelets_1'] == -1 then
ClearPedProp(multipedID, 7)
else
SetPedPropIndex (multipedID, 7, MultiPed['bracelets_1'], MultiPed['bracelets_2'], 2) -- Bracelets
end
SetPedFaceFeature(multipedID, 0, MultiPed['nose_width'])
SetPedFaceFeature(multipedID, 1, MultiPed['nose_peak_hight'])
SetPedFaceFeature(multipedID, 2, MultiPed['nose_peak_lenght'])
SetPedFaceFeature(multipedID, 3, MultiPed['nose_bone_high'])
SetPedFaceFeature(multipedID, 4, MultiPed['nose_peak_lowering'])
SetPedFaceFeature(multipedID, 5, MultiPed['nose_bone_twist'])
SetPedFaceFeature(multipedID, 6, MultiPed['eyebrown_high'])
SetPedFaceFeature(multipedID, 7, MultiPed['eyebrown_forward'])
SetPedFaceFeature(multipedID, 8, MultiPed['cheeks_bone_high'])
SetPedFaceFeature(multipedID, 9, MultiPed['cheeks_bone_width'])
SetPedFaceFeature(multipedID, 10, MultiPed['cheeks_width'])
SetPedFaceFeature(multipedID, 11, MultiPed['eyes_openning'])
SetPedFaceFeature(multipedID, 12, MultiPed['lips_thickness'])
SetPedFaceFeature(multipedID, 13, MultiPed['jaw_bone_width'])
SetPedFaceFeature(multipedID, 14, MultiPed['jaw_bone_back_lenght'])
SetPedFaceFeature(multipedID, 15, MultiPed['chimp_bone_lowering'])
SetPedFaceFeature(multipedID, 16, MultiPed['chimp_bone_lenght'])
SetPedFaceFeature(multipedID, 17, MultiPed['chimp_bone_width'])
SetPedFaceFeature(multipedID, 18, MultiPed['chimp_hole'])
SetPedFaceFeature(multipedID, 19, MultiPed['neck_thikness'])
MultiPed = nil
end)
```
\===cui\_character
**Part 1 -** Copy and paste this block of code below into your `cui_character` script, at the very bottom of the client-side main.lua.
```lua
RegisterNetEvent('cui_character:MultiCharSkin')
AddEventHandler('cui_character:MultiCharSkin', function(multipedID, data)
-- Face Blend
local weightFace = data.face_md_weight / 100 + 0.0
local weightSkin = data.skin_md_weight / 100 + 0.0
SetPedHeadBlendData(multipedID, data.mom, data.dad, 0, data.mom, data.dad, 0, weightFace, weightSkin, 0.0, false)
-- Facial Features
SetPedFaceFeature(multipedID, 0, (data.nose_1 / 100) + 0.0) -- Nose Width
SetPedFaceFeature(multipedID, 1, (data.nose_2 / 100) + 0.0) -- Nose Peak Height
SetPedFaceFeature(multipedID, 2, (data.nose_3 / 100) + 0.0) -- Nose Peak Length
SetPedFaceFeature(multipedID, 3, (data.nose_4 / 100) + 0.0) -- Nose Bone Height
SetPedFaceFeature(multipedID, 4, (data.nose_5 / 100) + 0.0) -- Nose Peak Lowering
SetPedFaceFeature(multipedID, 5, (data.nose_6 / 100) + 0.0) -- Nose Bone Twist
SetPedFaceFeature(multipedID, 6, (data.eyebrows_5 / 100) + 0.0) -- Eyebrow height
SetPedFaceFeature(multipedID, 7, (data.eyebrows_6 / 100) + 0.0) -- Eyebrow depth
SetPedFaceFeature(multipedID, 8, (data.cheeks_1 / 100) + 0.0) -- Cheekbones Height
SetPedFaceFeature(multipedID, 9, (data.cheeks_2 / 100) + 0.0) -- Cheekbones Width
SetPedFaceFeature(multipedID, 10, (data.cheeks_3 / 100) + 0.0) -- Cheeks Width
SetPedFaceFeature(multipedID, 11, (data.eye_squint / 100) + 0.0) -- Eyes squint
SetPedFaceFeature(multipedID, 12, (data.lip_thickness / 100) + 0.0) -- Lip Fullness
SetPedFaceFeature(multipedID, 13, (data.jaw_1 / 100) + 0.0) -- Jaw Bone Width
SetPedFaceFeature(multipedID, 14, (data.jaw_2 / 100) + 0.0) -- Jaw Bone Length
SetPedFaceFeature(multipedID, 15, (data.chin_1 / 100) + 0.0) -- Chin Height
SetPedFaceFeature(multipedID, 16, (data.chin_2 / 100) + 0.0) -- Chin Length
SetPedFaceFeature(multipedID, 17, (data.chin_3 / 100) + 0.0) -- Chin Width
SetPedFaceFeature(multipedID, 18, (data.chin_4 / 100) + 0.0) -- Chin Hole Size
SetPedFaceFeature(multipedID, 19, (data.neck_thickness / 100) + 0.0) -- Neck Thickness
-- Appearance
SetPedComponentVariation(multipedID, 2, data.hair_1, data.hair_2, 2) -- Hair Style
SetPedHairColor(multipedID, data.hair_color_1, data.hair_color_2) -- Hair Color
SetPedHeadOverlay(multipedID, 2, data.eyebrows_1, data.eyebrows_2 / 100 + 0.0) -- Eyebrow Style + Opacity
SetPedHeadOverlayColor(multipedID, 2, 1, data.eyebrows_3, data.eyebrows_4) -- Eyebrow Color
SetPedHeadOverlay(multipedID, 1, data.beard_1, data.beard_2 / 100 + 0.0) -- Beard Style + Opacity
SetPedHeadOverlayColor(multipedID, 1, 1, data.beard_3, data.beard_4) -- Beard Color
SetPedHeadOverlay(multipedID, 0, data.blemishes_1, data.blemishes_2 / 100 + 0.0) -- Skin blemishes + Opacity
SetPedHeadOverlay(multipedID, 12, data.bodyb_3, data.bodyb_4 / 100 + 0.0) -- Skin blemishes body effect + Opacity
SetPedHeadOverlay(multipedID, 11, data.bodyb_1, data.bodyb_2 / 100 + 0.0) -- Body Blemishes + Opacity
SetPedHeadOverlay(multipedID, 3, data.age_1, data.age_2 / 100 + 0.0) -- Age + opacity
SetPedHeadOverlay(multipedID, 6, data.complexion_1, data.complexion_2 / 100 + 0.0) -- Complexion + Opacity
SetPedHeadOverlay(multipedID, 9, data.moles_1, data.moles_2 / 100 + 0.0) -- Moles/Freckles + Opacity
SetPedHeadOverlay(multipedID, 7, data.sun_1, data.sun_2 / 100 + 0.0) -- Sun Damage + Opacity
SetPedEyeColor(multipedID, data.eye_color) -- Eyes Color
SetPedHeadOverlay(multipedID, 4, data.makeup_1, data.makeup_2 / 100 + 0.0) -- Makeup + Opacity
SetPedHeadOverlayColor(multipedID, 4, 0, data.makeup_3, data.makeup_4) -- Makeup Color
SetPedHeadOverlay(multipedID, 5, data.blush_1, data.blush_2 / 100 + 0.0) -- Blush + Opacity
SetPedHeadOverlayColor(multipedID, 5, 2, data.blush_3) -- Blush Color
SetPedHeadOverlay(multipedID, 8, data.lipstick_1, data.lipstick_2 / 100 + 0.0) -- Lipstick + Opacity
SetPedHeadOverlayColor(multipedID, 8, 2, data.lipstick_3, data.lipstick_4) -- Lipstick Color
SetPedHeadOverlay(multipedID, 10, data.chest_1, data.chest_2 / 100 + 0.0) -- Chest Hair + Opacity
SetPedHeadOverlayColor(multipedID, 10, 1, data.chest_3, data.chest_4) -- Chest Hair Color
-- Clothing and Accessories
SetPedComponentVariation(multipedID, 8, data.tshirt_1, data.tshirt_2, 2) -- Undershirts
SetPedComponentVariation(multipedID, 11, data.torso_1, data.torso_2, 2) -- Jackets
SetPedComponentVariation(multipedID, 3, data.arms, data.arms_2, 2) -- Torsos
SetPedComponentVariation(multipedID, 10, data.decals_1, data.decals_2, 2) -- Decals
SetPedComponentVariation(multipedID, 4, data.pants_1, data.pants_2, 2) -- Legs
SetPedComponentVariation(multipedID, 6, data.shoes_1, data.shoes_2, 2) -- Shoes
SetPedComponentVariation(multipedID, 1, data.mask_1, data.mask_2, 2) -- Masks
SetPedComponentVariation(multipedID, 9, data.bproof_1, data.bproof_2, 2) -- Vests
SetPedComponentVariation(multipedID, 7, data.neckarm_1, data.neckarm_2, 2) -- Necklaces/Chains/Ties/Suspenders
SetPedComponentVariation(multipedID, 5, data.bags_1, data.bags_2, 2) -- Bags
if data.helmet_1 == -1 then
ClearPedProp(multipedID, 0)
else
SetPedPropIndex(multipedID, 0, data.helmet_1, data.helmet_2, 2) -- Hats
end
if data.glasses_1 == -1 then
ClearPedProp(multipedID, 1)
else
SetPedPropIndex(multipedID, 1, data.glasses_1, data.glasses_2, 2) -- Glasses
end
if data.lefthand_1 == -1 then
ClearPedProp(multipedID, 6)
else
SetPedPropIndex(multipedID, 6, data.lefthand_1, data.lefthand_2, 2) -- Left Hand Accessory
end
if data.righthand_1 == -1 then
ClearPedProp(multipedID, 7)
else
SetPedPropIndex(multipedID, 7, data.righthand_1, data.righthand_2, 2) -- Right Hand Accessory
end
if data.ears_1 == -1 then
ClearPedProp(multipedID, 2)
else
SetPedPropIndex (multipedID, 2, data.ears_1, data.ears_2, 2) -- Ear Accessory
end
end)
```
\=== betrayed\_clothing
**Part 1 -** Copy and paste this block of code below into your clothing script, at the very bottom of the client-side main.lua.
```lua
RegisterNetEvent('otherclothing:MultiCharSkin')
AddEventHandler('otherclothing:MultiCharSkin', function(ped, skin)
-----SKIN-------
if ped then
if skin then
if skin['skin'] ~= nil then
for i = 1, #drawable_names do
if skin['skin'].drawables[0] == nil then
if drawable_names[i] == "undershirts" and skin['skin'].drawables[tostring(i-1)][2] == -1 then
SetPedComponentVariation(ped, i-1, 15, 0, 2)
else
SetPedComponentVariation(ped, i-1, skin['skin'].drawables[tostring(i-1)][2], skin['skin'].drawtextures[i][2], 2)
end
else
if drawable_names[i] == "undershirts" and skin['skin'].drawables[i-1][2] == -1 then
SetPedComponentVariation(ped, i-1, 15, 0, 2)
else
SetPedComponentVariation(ped, i-1, skin['skin'].drawables[i-1][2], skin['skin'].drawtextures[i][2], 2)
end
end
end
for i = 1, #prop_names do
local propZ = (skin['skin'].drawables[0] == nil and skin['skin'].props[tostring(i-1)][2] or skin['skin'].props[i-1][2])
ClearPedProp(ped, i-1)
SetPedPropIndex(ped,i-1,propZ,skin['skin'].proptextures[i][2], true)
end
Citizen.Wait(500)
if skin['skin'].model == 1885233650 or skin['skin'].model == -1667301416 then
-----FACE-------
if skin['face'] ~= nil then
SetPedHairColor(ped, tonumber(skin['face'].hairColor[1]), tonumber(skin['face'].hairColor[2]))
SetPedHeadBlendData(ped,
tonumber(skin['face'].headBlend['shapeFirst']),
tonumber(skin['face'].headBlend['shapeSecond']),
tonumber(skin['face'].headBlend['shapeThird']),
tonumber(skin['face'].headBlend['skinFirst']),
tonumber(skin['face'].headBlend['skinSecond']),
tonumber(skin['face'].headBlend['skinThird']),
tonumber(skin['face'].headBlend['shapeMix']),
tonumber(skin['face'].headBlend['skinMix']),
tonumber(skin['face'].headBlend['thirdMix']),
false)
for i = 1, #face_features do
SetPedFaceFeature(ped, i-1, skin['face'].headStructure[i])
end
if json.encode(skin['face'].headOverlay) ~= "[]" then
for i = 1, #head_overlays do
if skin['face'].headOverlay[i].name == "eyecolor" then
SetPedEyeColor(ped, tonumber(skin['face'].headOverlay[i].val))
else
SetPedHeadOverlay(ped, i-1, tonumber(skin['face'].headOverlay[i].overlayValue), tonumber(skin['face'].headOverlay[i].overlayOpacity))
end
end
SetPedHeadOverlayColor(ped, 0, 0, tonumber(skin['face'].headOverlay[1].firstColour), tonumber(skin['face'].headOverlay[1].secondColour))
SetPedHeadOverlayColor(ped, 1, 1, tonumber(skin['face'].headOverlay[2].firstColour), tonumber(skin['face'].headOverlay[2].secondColour))
SetPedHeadOverlayColor(ped, 2, 1, tonumber(skin['face'].headOverlay[3].firstColour), tonumber(skin['face'].headOverlay[3].secondColour))
SetPedHeadOverlayColor(ped, 3, 0, tonumber(skin['face'].headOverlay[4].firstColour), tonumber(skin['face'].headOverlay[4].secondColour))
SetPedHeadOverlayColor(ped, 4, 2, tonumber(skin['face'].headOverlay[5].firstColour), tonumber(skin['face'].headOverlay[5].secondColour))
SetPedHeadOverlayColor(ped, 5, 2, tonumber(skin['face'].headOverlay[6].firstColour), tonumber(skin['face'].headOverlay[6].secondColour))
SetPedHeadOverlayColor(ped, 6, 0, tonumber(skin['face'].headOverlay[7].firstColour), tonumber(skin['face'].headOverlay[7].secondColour))
SetPedHeadOverlayColor(ped, 7, 0, tonumber(skin['face'].headOverlay[8].firstColour), tonumber(skin['face'].headOverlay[8].secondColour))
SetPedHeadOverlayColor(ped, 8, 2, tonumber(skin['face'].headOverlay[9].firstColour), tonumber(skin['face'].headOverlay[9].secondColour))
SetPedHeadOverlayColor(ped, 9, 0, tonumber(skin['face'].headOverlay[10].firstColour), tonumber(skin['face'].headOverlay[10].secondColour))
SetPedHeadOverlayColor(ped, 10, 1, tonumber(skin['face'].headOverlay[11].firstColour), tonumber(skin['face'].headOverlay[11].secondColour))
SetPedHeadOverlayColor(ped, 11, 0, tonumber(skin['face'].headOverlay[12].firstColour), tonumber(skin['face'].headOverlay[12].secondColour))
end
else
print('skin[face] is nil')
end
-----TATTOOS-------
if skin['tattoo'] ~= nil then
ClearPedDecorations(ped)
for i = 1, #skin['tattoo'] do
ApplyPedOverlay(ped, skin['tattoo'][i][1], skin['tattoo'][i][2])
end
else
print('skin[tattoo] is nil')
end
end
else
print('skin[skin] is nil')
end
else
print('skin is nil')
end
else
print('ped is nil')
end
end)
```
::::
## 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]`.
### Advanced multi-character method
::: danger
**WARNING** If you are not 100% sure what you are doing here we would not recommend doing this, but if you insist please read the information before implementing these changes. If you are unsure what this does, read more about it on our [Web Store](https://codesign.pro/package/4206340).
:::
**This is completely optional.** We do not recommend using this option unless you have basic knowledge of Lua and you understand what needs to be done from reading the instructions below. This method is more complicated and more effort to install but is far more optimized than the standard esx\_kashacters method.
**Part 1:** Set the `Config.UseAdvancedMultiCharMethod` in the `config.lua` to true.
**Part 2**: If you are switching from the standard multi-character version to the advanced multicharacter version you need to use this command in your server console below before any players join.
```lua
AdvancedMultichar
```
**Part 3:** Replace the FiveM native method of getting a players identifier (steam id, license) `GetPlayerIdentifiers(source)[1]` or `GetPlayerIdentifiers(source)[2]` with `xPlayer.identifier` for every server-side resource which uses the identifier to fetch a character's data from the database. xPlayer of course needs to be defined before using it eg., `local xPlayer = ESX.GetPlayerFromId(source)`.
[**Example 1: Do not change this.**](https://i.imgur.com/cxkAjKD.png)
[**Example 2: Change this.**](https://i.imgur.com/PmnED6q.png)
**Part 4:** Follow the guide below for your version of ESX.
::::tabs
\=== ESX version 1.1
**`essentialmode/server/main.lua/line 41`** - **replace** the existing block of code with this.
View the [**Before**](https://i.imgur.com/h9IYGsF.png) and [**After**](https://i.imgur.com/P3FQMhp.png) examples here.
```lua
RegisterServerEvent('es:firstJoinProper')
AddEventHandler('es:firstJoinProper', function(charID)
local Source = source
Citizen.CreateThread(function()
local id
for k,v in ipairs(GetPlayerIdentifiers(Source)) do
if string.match(v, 'steam:') then
id = charID..''..v:sub(7)
break
end
end
if not id then
DropPlayer(Source, "SteamID not found, please try reconnecting with Steam open.")
else
registerUser(id, Source)
justJoined[Source] = true
if(settings.defaultSettings.pvpEnabled)then
TriggerClientEvent("es:enablePvp", Source)
end
end
return
end)
end)
```
\=== ESX version 1.2
**`es_extended/server/ma.lua/line 1`** - **replace** the existing block of code with this.
View the [**Before**](https://i.imgur.com/Gakfspi.png) and [**After**](https://i.imgur.com/gazmehZ.png) examples here.
```lua
RegisterServerEvent('esx:playerJoined')
AddEventHandler('esx:playerJoined', function(charID)
onPlayerJoined(source, charID)
end)
function onPlayerJoined(playerId, charID)
local identifier
for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
if string.match(v, 'license:') then
identifier = charID..''..v:sub(9)
break
end
end
if identifier then
MySQL.Async.fetchScalar('SELECT 1 FROM users WHERE identifier = @identifier', {
['@identifier'] = identifier
}, function(result)
if result then
loadESXPlayer(identifier, playerId)
else
MySQL.Async.execute('INSERT INTO users (identifier) VALUES (@identifier)', {
['@identifier'] = identifier
}, function(rowsChanged)
loadESXPlayer(identifier, playerId)
end)
end
end)
else
DropPlayer(playerId, 'Your Rockstar license could not be found')
end
end
```
\=== ESX version 1.final
**`es_extended/server/main.lua/line 6`** - **replace** the existing block of code with this.
View the [**Before**](https://i.imgur.com/9w0S0cx.png) and [**After**](https://i.imgur.com/5Xn7OnE.png) examples here.
```lua
RegisterServerEvent('esx:onPlayerJoined')
AddEventHandler('esx:onPlayerJoined', function(charID)
onPlayerJoined(source, charID)
end)
function onPlayerJoined(playerId, charID)
local identifier
for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
if string.match(v, 'license:') then
identifier = charID..''..v:sub(9)
break
end
end
if identifier then
if ESX.GetPlayerFromIdentifier(identifier) then
DropPlayer(playerId, ('there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(identifier))
else
MySQL.Async.fetchScalar('SELECT 1 FROM users WHERE identifier = @identifier', {
['@identifier'] = identifier
}, function(result)
if result then
loadESXPlayer(identifier, playerId, false)
else createESXPlayer(identifier, playerId) end
end)
end
else
DropPlayer(playerId, 'there was an error loading your character!\nError code: identifier-missing-ingame\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.')
end
end
```
\=== Extendedmode
**`extendedmode/server/main.lua/line 1`** - **replace** the existing block of code with this.
View the [**Before**](https://i.imgur.com/7kZmeHk.png) and [**After**](https://i.imgur.com/DEpwkoD.png) examples here.
```lua
RegisterServerEvent('esx:onPlayerJoined')
AddEventHandler('esx:onPlayerJoined', function(charID)
if not ESX.Players[source] then
onPlayerJoined(source, charID)
end
end)
function onPlayerJoined(playerId, charID)
local identifier
local license
for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
if string.match(v, Config.PrimaryIdentifier) then
if Config.PrimaryIdentifier == 'steam' then
identifier = charID..''..v:sub(7)
elseif Config.PrimaryIdentifier == 'license' then
identifier = charID..''..v:sub(9)
end
end
if string.match(v, 'license:') then
license = v
end
end
if identifier then
if ESX.GetPlayerFromIdentifier(identifier) then
DropPlayer(playerId, ('there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(identifier))
else
MySQL.Async.fetchScalar('SELECT 1 FROM users WHERE identifier = @identifier', {
['@identifier'] = identifier
}, function(result)
if result then
loadESXPlayer(identifier, playerId, false)
else
local accounts = {}
for account,money in pairs(Config.StartingAccountMoney) do
accounts[account] = money
end
MySQL.Async.execute('INSERT INTO users (accounts, identifier, license) VALUES (@accounts, @identifier, @license)', {
['@accounts'] = json.encode(accounts),
['@identifier'] = identifier,
['@license'] = license,
}, function(rowsChanged)
loadESXPlayer(identifier, playerId)
end)
end
end)
end
else
DropPlayer(playerId, 'there was an error loading your character!\nError code: identifier-missing-ingame\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.')
end
end
```
\===
\===ESX Legacy 1.3.x
::: warning
Make sure the **`Config.Multichar`** in es\_extended's config.lua is set to **false**.
:::
**`es_extended/server/main.lua/line 26`** - **replace** the existing block of code with this.
View the [**Before** ](https://i.imgur.com/bh6HWvP.png)and [**After** ](https://i.imgur.com/9a5QfIy.png)examples here.
```lua
if Config.Multichar then
AddEventHandler('esx:onPlayerJoined', function(src, char, data)
if not ESX.Players[src] then
local identifier = char..':'..ESX.GetIdentifier(src)
if data then
createESXPlayer(identifier, src, data)
else
loadESXPlayer(identifier, src, false)
end
end
end)
else
RegisterServerEvent('esx:onPlayerJoined')
AddEventHandler('esx:onPlayerJoined', function(charID)
if not ESX.Players[source] then
onPlayerJoined(source, charID)
end
end)
end
function onPlayerJoined(playerId, charID)
local identifier = charID..''..ESX.GetIdentifier(playerId)
if identifier then
if ESX.GetPlayerFromIdentifier(identifier) then
DropPlayer(playerId, ('there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(identifier))
else
local result = MySQL.scalar.await('SELECT 1 FROM users WHERE identifier = ?', { identifier })
if result then
loadESXPlayer(identifier, playerId, false)
else
createESXPlayer(identifier, playerId)
end
end
else
DropPlayer(playerId, 'there was an error loading your character!\nError code: identifier-missing-ingame\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.')
end
end
```
\=== ESX Legacy 1.6.x
::: warning
Make sure the **`Config.Multichar`** in es\_extended's config.lua is set to **false**.
:::
**`es_extended/server/main.lua/line 17`** - **replace** the existing block of code with this.
View the [**Before**](https://i.imgur.com/fjqj4rM.png) and [**After**](https://i.imgur.com/gGRZT1M.png) examples here.
```lua
if Config.Multichar then
AddEventHandler('esx:onPlayerJoined', function(src, char, data)
while not next(ESX.Jobs) do Wait(50) end
if not ESX.Players[src] then
local identifier = char..':'..ESX.GetIdentifier(src)
if data then
createESXPlayer(identifier, src, data)
else
loadESXPlayer(identifier, src, false)
end
end
end)
else
RegisterServerEvent('esx:onPlayerJoined')
AddEventHandler('esx:onPlayerJoined', function(charID)
while not next(ESX.Jobs) do Wait(50) end
if not ESX.Players[source] then
onPlayerJoined(source, charID)
end
end)
end
function onPlayerJoined(playerId, charID)
local identifier = charID..''..ESX.GetIdentifier(playerId)
if identifier then
if ESX.GetPlayerFromIdentifier(identifier) then
DropPlayer(playerId, ('there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(identifier))
else
local result = MySQL.scalar.await('SELECT 1 FROM users WHERE identifier = ?', { identifier })
if result then
loadESXPlayer(identifier, playerId, false)
else
createESXPlayer(identifier, playerId)
end
end
else
DropPlayer(playerId, 'there was an error loading your character!\nError code: identifier-missing-ingame\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.')
end
end
```
::::
### Switching Characters
**Part 1:** Copy and paste this block of code below into your character skin creator script, at the very bottom of the client-side main.lua.
::::tabs
\=== skinchanger (if using esx\_skin)
```lua
RegisterNetEvent('skinchanger:ResetPlayerSkin')
AddEventHandler('skinchanger:ResetPlayerSkin', function()
Character = {}
for i=1, #Components, 1 do
Character[Components[i].name] = Components[i].value
end
TriggerEvent('skinchanger:loadSkin', {sex = 0})
end)
```
\=== cui\_character
No action needed.
\=== betrayed\_clothing
No action needed.
::::
**Part 2:** We need to add 2 events to your es\_extended resource to tell the code that we are switching characters.
::::tabs
\=== Server Side
**ESX (all versions) - `/server/main.lua`** - add this block of code at the bottom of the file.
```lua
RegisterServerEvent('esx:cd_multicharacter:SwitchCharacter')
AddEventHandler('esx:cd_multicharacter:SwitchCharacter', function(_source)
if type(_source) ~= 'number' then _source = source end
local xPlayer = ESX.GetPlayerFromId(_source)
if xPlayer then
TriggerEvent('esx:playerDropped', _source, 'multichar-switch_char')
TriggerClientEvent('esx:cd_multicharacter:SwitchCharacter', _source)
TriggerClientEvent('esx:onPlayerLogout', _source)
if Core then
Core.SavePlayer(xPlayer, function()
ESX.Players[_source] = nil
end)
else
ESX.SavePlayer(xPlayer, function()
ESX.Players[_source] = nil
end)
end
end
end)
```
\=== Client Side
**ESX (all versions) - `/client/main.lua`** - add this block of code at the bottom of the file.
```lua
RegisterNetEvent('esx:cd_multicharacter:SwitchCharacter')
AddEventHandler('esx:cd_multicharacter:SwitchCharacter', function()
ESX.PlayerLoaded = false
end)
```
::::
## INFORMATION
### Default Key Binds
These keys can be modified and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section of the `[configs/config.lua]`.
| **Key** | **Description** |
| ------------------------- | ----------------------------- |
| **`Enter / Left Mouse`** | Select a character. |
| **`Left / Right Arrows`** | Cycle through the characters. |
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| **Command** | **Description** |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`/charslots`** | (staff command) To check/add/remove a player's character slots. |
| **`/switchcharacter`** | If enabled, this will allow players to change characters in-game. |
| **`/DatabaseCleaner`** | (console command) This will remove all of the unneeded rows in your database which ESX resources unnecessarily add. Should only be needed a couple of times per month. |
| **`/SetAllMaxChars`** | (console command) This will set the max character slots for all player's in the database - if you ever need to change them all. |
| **`/AdvancedMultichar`** | (console command) [Read here before using.](./#advanced-multi-character-method) |
## COMMON ISSUES
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder is `cd_multicharacter`.
**Encrypted Files** Do not edit the encrypted files in any way.
**Always F8 Quit** Make sure you and your players fully close FiveM before reconnecting to your server by either F8 quitting or force closing FiveM; this is a known issue with FiveM, not the multicharacter.
**Always Restart Server** Never restart the resource while the server is live; always restart the server to ensure no unforeseen issues.
**SERVER-SIDE (database)**
**SQL Unknown Column Error?**
eg., if you see an SQL error in the server console similar to this example - `ER_BAD_FIELD_ERROR: Unknown colum 'max_chars' 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 OR this specific column you have entered into the Config.Database table does not exist in the DatabaseTable.
**SQL Table Doesn't Exist Error?**
eg., if you see an SQL error in the server console similar to this example - `ER_NO_SUCH_TABLE: Table 'exampletable' dosesn't exist'`.
You have added this exampletable into the Config.Database table but it does not exist in your database. Remove it from the Config.DatabaseTable.
**SQL Duplicate Entry Error? (datastore table)**
eg., if you see an SQL error saying you have a duplicate entry in the **datastore** **table** similar to this: `[ERROR] [MySQL] An error happens on MySQL for query "INSERT INTO datastore_data (name, owner, data) VALUES ('property', 'steam:111738473874', '{}')": ER_DUP_ENTRY: Duplicate entry 'property-steam:111738473874' for key 'index_datastore_data_name_owner'`.
```markdown There is a public fix for such issues on the [FiveM Forums] or this can be avoided by using the advanced method.
```
**SERVER-SIDE**
**Characters not saving after re-logging?**
eg., if your characters don't save after you create them or some data is not being saved in the database.
Then most likely the length of the columns in your database tables have not been automatically set to 50. You need to do this because if you are using the r\* license identifier type, the length of this identifier along with the extra Char1: make the total length of the identifier more than the maximum default length of 40 characters. You can manually change the length of the identifier column in your HeidiSQL/PhpMyAdmin database viewer.
**All of my characters are default peds with no character info?**
eg., if you see default peds with no character information being display when you are certain you have characters saved in the database.
This is something to do with your characters identifiers in the users table. The identifier the script is using does not match your characters identifier in the users database table, you will need to compare the 2. This usually happens when you have a modified framework which uses steamid's (Char1:110000105bdca75) for example but the default framework uses rockstar license (Char1:23498202342384729830327487320) so the script can not find the identifier in the users database table.
**UI not displaying the correct sex?**
eg., if you see "Non-Binary" on the character selection UI, this means the script could not find one of the standard sex types eg., `m, male, f, female` in the sex column for this character in the users database table. And if you see "Autosexual" that means the sex column for one of your characters is empty.
This means your identity script is not adding the correct data to the database so you should check why. But a quick fix is to manually add m into the sex column which is currently empty.
**CLIENT-SIDE**
**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).
**Ped in front of camera?**
eg., if you see your player's ped standing in front of the camera during the character selection screen.
Modify the Config.Cam x, y, z coordinates of the camera in the config.lua. This will most likely be trial and error on your side to get the correct camera position.
**No such export GetPedList in resource skinchanger?**
eg., if you see an error similar to this in the client F8 console.
This could either mean you have not complete Step 7 correctly, or the name your skinchanger script has been changed. The easy fix is to make sure the name of your skinchanger script is skinchanger Or rename the export in the client\_customise\_me.lua to the name of your renamed skinchanger script.
**Character floating in the sky**
**eg., if** your character is floating in the sky ([like this](https://imgur.com/jaXz2BC)).
Remove this line from the fxmanifest.lua in your loading screen resource -loadscreen\_manual\_shutdown 'yes'.
**Issues with skins not loading?**
eg., if your peds skins are not loading.
This is caused by low end spec PC's or server hosting. There's two working solutions to solving this issue.
Fix 1: Add a Wait prior to the event that loads the skin to give ample time for it to load in correctly. Example below from the client\_customise\_me.lua of where the wait should be added:
```lua
if Config.SkinScript == 'esx_skin' then
Wait(3000)
TriggerEvent('skinchanger:loadSkin', skin)
```
Fix 2: Remove the default ped integration within es\_extended. It should look similar to the code blocks below. Example below needs this code block hashed out/removed from the main.lua of the client of es\_extended:
```lua
if GetEntityModel(PlayerPedId()) == GetHashKey('PLAYER_ZERO') then
local defaultModel = GetHashKey('a_m_y_stbla_02')
RequestModel(defaultModel)
while not HasModelLoaded(defaultModel) do
Citizen.Wait(10)
end
SetPlayerModel(PlayerId(), defaultModel)
SetPedDefaultComponentVariation(PlayerPedId())
SetPedRandomComponentVariation(PlayerPedId(), true)
SetModelAsNoLongerNeeded(defaultModel)
end
```
**Characters not showing but blue arrows do show**
eg., if your character is not showing but the blue arrows are showing.
Replace the SetCoords function in the funtions.lua with the function below:
```lua
function SetCoords(coords)
local ped = PlayerPedId()
RequestCollisionAtCoord(coords.x, coords.y, coords.z) local timeout=0 while not HasCollisionLoadedAroundEntity(ped) and timeout <=1000 do RequestCollisionAtCoord(coords.x, coords.y, coords.z) Citizen.Wait(10) timeout=timeout+1 end
SetEntityCoords(ped, coords.x, coords.y, coords.z)
SetEntityHeading(ped, coords.h)
end
```
## ERROR CODES
If you see an error code not listed below please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).
::::tabs
\=== Server
**665** - This is because you have copied and pasted the Config.DatabaseTables from an old version or from esx\_kashacters. Use the table format from the default config and add to it.
**634** - There is an error in the `GetSkin()` function in the configs/client\_customise\_me.lua. Please try to troubleshoot this yourself before contacting support.
**778** - The sex column for one of your characters in the users database table is empty. It should contain `m, male, f, female` etc., in a string format. This means your identity script is not adding the correct data to the database so you should check why. But a quick fix is to manually add `m` into the database column which is currently empty.
**897****/****654** - The `GetIdentifier` function in the `server_customise_me.lua` is returning a nil value, when it should be returning the player's identifier as a string. This is because the string inside the `Config.ESX_version` is invalid. Only one of the following options is acceptable: *\[ '1.1' / '1.2' / '1.final' / 'exm' / 'legacy' ], or because the Config.Identifiertype has a typo in it*.
# **331****/****487**/**905** - The `GetUserInfos` function in the `server_customise_me.lua` is not returning a table. This is most likely due to an issue in the database. You can try removing the characters for the player(s) having the issue and tell them to relog. But you still need to debug this yourself.
\=== Client
**5647** - The player's maximum character amount in the `max_chars` column in the `user_lastcharacter` database table is more than the available ped spawn locations in the config.lua's `Config.PedSpawnCoords`. You need to add more locations to match with the maxium amount of characters you allow a player to have.
**6745665**\*\* /\*\***5154** - The `sex` inside the skin column in the users database table should be a number, but currently, it is not. You need to find out why esx\_skin is not saving the data correctly. A temp fix is to change the value to 0.
**6841** - The `SpawnPeds` function in the `client_customise_me.lua` is not returning a table. If the error print says that it‘s returning nill, then that means the `Config.SkinScript` is invalid. If not then you need to debug this yourself.
# **6846854** - This is because there are limits to the number of .ymt's that can be assigned to a freemode ped: build 1604‘s limit is 14, build 2189's limit is 6, build 2372's limit is 4.
::::
## FRESH TEST SERVER
::: info
**PLEASE READ**: The only purpose of the steps below is to help you debug the multicharacter script if you are having issues that are not common andunable to debug the cause of the issues.
:::
We recommend you do this on a test server/local host.
**Test Environment Setup**
* **Operating System:** Windows 10
* **MySQL Database Server:** 10.4.13-MariaDB
* **FiveM Server Artifacts:** [Latest Recommended (5562)](https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/)
* **Database Viewer:** [HeidiSQL Version 11.3.0.6295 (64 Bit)](https://www.heidisql.com/download.php)
* **FiveM MySQL Resource:** [mysql-async Version 3.3.2](https://github.com/brouznouf/fivem-mysql-async/tree/3.3.2)
* **Framework:** [ESX Legacy](https://github.com/esx-framework/esx-legacy)
* **OneSync:** Infinity
#### Guide
#### **Step 1 - Download Server Files**
Download our full FiveM Server folder from our GitHub.
Do you use **`esx_skin`**? [Download this version.](https://github.com/RampBST/Multicharacter_Test/tree/esx_skin)
Do you use **`cui_character`**? [Download this version.](https://github.com/RampBST/Multicharacter_Test/tree/cui_character)
#### Step 2 - Add License Key
Open the server.cfg and add in your [licenseKey](https://i.imgur.com/MConYlu.png).
#### Step 3 - Import Database
[**Watch this video if you are unsure how to do this.**](https://youtu.be/xBbqDLXrZGY?t=144)
#### Step 4 - Add Codesign Scripts
Make sure you download the **latest versions** of `cd_multicharacter` / `cd_spawnselect` / `cd_identity` and add them into the `[Codesign]` folder.
Now start the server, create a character, relog and choose your newly created character.
## CHANGELOG
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
::::tabs
\=== v3.0.0
### 26/12/2020 - 10/08/2021
v3.0.0 - v3.2.0
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: tip
**Add**
* Added in the "kashactersS:CharacterChosen" which will send the charid just like esx\_kashacters does so scripts that use this will not need modifying.
* Added the ability to switch characters in game using a chat command.
* Added easier to understand error handling methods.
* Added support for the use of ghmattimysql along side mysql.
* Added support EXM (essentialmode).
* Added support for modified versions of es\_extended which use a different identifier type. For example if you use esx 1.2 but you have modified it to use steamid instead of license.
* Added the ability to rename all esx events such as the setjob and playerloaded events.
* Added the option to only allow players to switch characters at set locations using a command or keypress and optional blips on the map.
* Added drag and drop support for the new esx legacy version.
* Added support for the use of ped models on the character selection screen.
* Added the ability to customize the job name which is displayed on the UI without compromising the optimization.
* Added extra checks to make sure that incompatible database tables that people add to the `Config.DatabaseTables` such as `user_lastcharacter` etc do not get ran as that would cause a script breaking problem.
:::
::: info
**Edit**
* Made modifications for this to work out of the box with "cd\_identity".
* Changed "Database cleaner" to be a command instead of being used every restart as its only really needed to be used once every week to a month.
* Modified the "Config.DatabaseTables" to be easier to understand for new people.
* Updated the codesign error handlers.
* Updated the SetAllMaxChars console command to also update the max\_chars column default value in the user\_lastcharacter database table with the new value.
* Added some extra fail-safe checks to ensure stability - If a player's maximum character limit in the user\_lastcharacter database table is larger than the maximum amount of ped coordinates that the script is currently configured for, the script will fix itself and show the default 5 characters as a temporary fix until the server devs can resolve the issue.
* Added checks so the spawnmanager exports are only triggered for certain versions of esx.
* Fixed compatibility with linden\_inventory.
* When you change the `Config.DefaultCharAmount` it will automatically modify the default maximum character value in the database.
* All of your `Config.DatabaseTables` identifier column lengths are automatically checked and set to the minimum value of 50 if needed.
* All of the code required to add compatibility with other clothing/skin resources is now available to edit.
* Your chosen characters skin data is now sent to the `CharacterHasLoaded_EXISTING` function in order to reduce SQL queries.
* Removed some config options which ask you if you are using other Codesign resources and replaced them the `GetResourceState()` FiveM native to ensure people don't misconfigure the config which would cause script breaking problems.
* Moved the code to change the location of the peds to the config to be more new developer friendly.
* Removed some unneeded config options and rewrote the config to be more "new developer friendly".
* Removed some unneeded SQL queries along with greatly optimising others such as the get character data quiey and the get skin queries.
* Rewrote huge portions of the server and the client side code to be more optimized.
:::
::: warning
**Fix**
* Fixed random server error on server start.
* Fixed the typo with the "Delete" button on the UI.
* Optimised server side.
* Fixed a typo with the "kashactersS:CharacterChosen" trigger event sending the wrong data.
* Fixed a random crash on linux servers.
* Small minor clean-ups.
* Fixed a typo causing which caused errors when using only 1 character
* Fixed a bug causing the drawtextui for the switch character to not work correctly.
* Fixed a typo causing the advanced multi character method to not work correctly.
* Test fix for a NUI state related issue.
* Fixed the trigger event to initialise esx.
* Fixed the bug where sometimes your ped would fall when first spawning.
* Added better checks to make sure your ped and other players peds are invisible during the character selection.
* Fixed the Config.Emoji not being able to be disabled.
* 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 compatibility with cui\_character (read the read me and complete the newly edited steps).
* Switching characters in game is no longer experimental and now should be fully ready to use.
* * Fixed the bug where when you switch characters in game and create a new character it would show your previous characters clothes instead of a default ped.
* Hide the esx hud during the character selection screen when switching character in game.
* Fixed the screen fade not fully disabling when switching character in game
* Force save the coords of your previous character when you switch character in game.
* Fixed the "xPlayer is nil" errors in external resources such as cd\_spawnselect or cd\_identity etc when triggering events from the multicharacter after the player chosen their character, as now these events will only be triggered after ESX has fully loaded a players character data.
* Re-added and improved the code to shut down the loading screen early to avoid seeing the bridge as long.
:::
\===
\=== v4.0.0
### 05/11/2021
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: danger
**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).**
:::
::: tip
**Add**
* Added compatibility for oxmysql
:::
\===
\=== v4.0.1
### 08/11/2021
**Files Changed:**
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
```lua
fxmanifest.lua - (IMPORTANT)
server/main/server.lua - (IMPORTANT)
client/main/client.lua - (IMPORTANT)
html (FULL FOLDER) - (IMPORTANT)
```
**Update Type:**
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: danger
**Authentication**
* **Small authentication update to ensure stability**.
:::
\=== v4.1.0
### 25/04/2022
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
::: tip
**Add**
* Added a new config option for ESX legacy 1.6.x.
* Added support for the latest oxymysql.
:::
::: info
**Edit**
* Automated one of the installation steps (database tables) to ensure an easier installation.
* Added more fail-safe checks to warn you of typos you made in the config which could break the script.
:::
::::
[^1]: [https://forum.cfx.re/t/mysql-error-duplicate-entry-er-dup-entry/1024249]\(https://forum.cfx.re/t/mysql-error-duplicate-entry-er-dup-entry/1024249\)
---
---
url: /paid-scripts/multicharacter-character-selection/configs-locales-and-sql.md
description: >-
Configuration, locales, and SQL setup for cd_multicharacter. Includes
framework auto-detect, character slots, spawn settings, and database schema
for character management.
---
# Configs, Locales & SQL
::::tabs
\=== Config
```lua
Config = {}
Config.Keys={['ESC']=322,['F1']=288,['F2']=289,['F3']=170,['F5']=166,['F6']=167,['F7']=168,['F8']=169,['F9']=56,['F10']=57,['~']=243,['1']=157,['2']=158,['3']=160,['4']=164,['5']=165,['6']=159,['7']=161,['8']=162,['9']=163,['-']=84,['=']=83,['BACKSPACE']=177,['TAB']=37,['Q']=44,['W']=32,['E']=38,['R']=45,['T']=245,['Y']=246,['U']=303,['P']=199,['[']=39,[']']=40,['ENTER']=18,['CAPS']=137,['A']=34,['S']=8,['D']=9,['F']=23,['G']=47,['H']=74,['K']=311,['L']=182,['LEFTSHIFT']=21,['Z']=20,['X']=73,['C']=26,['V']=0,['B']=29,['N']=249,['M']=244,[',']=82,['.']=81,['LEFTCTRL']=36,['LEFTALT']=19,['SPACE']=22,['RIGHTCTRL']=70,['HOME']=213,['PAGEUP']=10,['PAGEDOWN']=11,['DELETE']=178,['LEFTARROW']=174,['RIGHTARROW']=175,['TOP']=27,['DOWNARROW']=173,['NENTER']=201,['N4']=108,['N5']=60,['N6']=107,['N+']=96,['N-']=97,['N7']=117,['N8']=61,['N9']=118,['UPARROW']=172,['INSERT']=121}
function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
Config.Database = 'mysql' --[ 'mysql' / 'ghmattimysql' / 'oxmysql' ] Choose your sql database script.
Config.Language = 'EN' --[ 'EN' / 'BG' / 'DE' / 'CZ' / 'ES' / 'FI' / 'FR' / 'NL' / 'SE' / 'SK' ] You can add your own locales to the Locales.lua. But make sure to change the Config.Language to match it.
Config.ESX_version = 'legacy 1.6.x' --[ '1.1' / '1.2' / '1.final' / 'exm' / 'legacy 1.3.x' / 'legacy 1.6.x' ] Choose the version of ESX you are using.
Config.FrameworkTriggers = { --You can change the esx events (IF NEEDED).
main = 'esx:getSharedObject',
load = 'esx:playerLoaded',
job = 'esx:setJob',
resource_name = 'es_extended'
}
Config.NotificationType = { --[ 'esx' / 'mythic_old' / 'mythic_new' / 'chat' / 'other' ] Choose your notification script.
server = 'esx',
client = 'esx'
}
--██╗███╗ ███╗██████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗████████╗
--██║████╗ ████║██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝
--██║██╔████╔██║██████╔╝██║ ██║██████╔╝ ██║ ███████║██╔██╗ ██║ ██║
--██║██║╚██╔╝██║██╔═══╝ ██║ ██║██╔══██╗ ██║ ██╔══██║██║╚██╗██║ ██║
--██║██║ ╚═╝ ██║██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║██║ ╚████║ ██║
--╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
Config.SkinScript = 'esx_skin' --[ 'esx_skin' / 'cui_character' / 'betrayed_clothing_1' / 'betrayed_clothing_2' / 'other' ] Choose the clothing script you use.
--ADVANCED
Config.UseAdvancedMultiCharMethod = false --DO NOT ENABLE THIS UNLESS YOU HAVE READ THE DOCUMENTATION AND YOU UNDERSTAND WHAT YOU ARE DOING. [https://docs.codesign.pro/paid-scripts/multicharacter-character-selection/#advanced-multi-character-method].
Config.IdentifierType = 'NULL' --[ 'NULL' / 'steamid' / 'license' ] --This is ONLY needed if you have modified your es_extended to use a different identifier type. For example if you use esx 1.final but you have modified it to use steamid instead of license.
Config.DatabaseTables = {
Additional = {--This is optional, you can add more database tables and columns here if needed.
--{table_name = 'CHANGE_ME', column_name = 'CHANGE_ME'},
--{table_name = 'CHANGE_ME', column_name = 'CHANGE_ME'},
},
Blacklisted = { -- We don't want any of the database tables below to be used by the multicharacter; because we want players to have access the data in these database tables on all of their characters. Basically, none of the players identifiers will have "Char:" infront of them.
['user_lastcharacter'] = true,
['phone_numbers'] = true,
['cd_donatorshop'] = true,
['cd_donatorshop_logs'] = true,
}
}
Config.PedSpawnCoords = { --The coordinates where each ped will spawn. IMPORTANT: If you want to add more character slots, you MUST add more PedSpawnCoords to the table below.
[1] = {x = -458.8, y = 1601.1, z = 358.22, h = 180.72},
[2] = {x = -457.9, y = 1601.3, z = 358.25, h = 167.72},
[3] = {x = -457.0, y = 1601.5, z = 358.23, h = 158.72},
[4] = {x = -456.0, y = 1601.7, z = 358.21, h = 148.72},
[5] = {x = -455.0, y = 1601.9, z = 358.18, h = 140.72},
--[6] = {x = 0.0, y = 0.0, z = 0.0, h = 0.0},
}
--███╗ ███╗ █████╗ ██╗███╗ ██╗
--████╗ ████║██╔══██╗██║████╗ ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
--╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
Config.DefaultSpawn = {x = -457.0, y = 1601.5, z = 358.23, h = 158.72} --The default spawn location while creating a new character.
Config.Emoji = '⬇️' --Choose the emoji above the characters head, i guess you can use text here also (https://emojipedia.org/) - (set to 'FALSE' to disable).
Config.SpotLight = true --Do you want to enable the spotlight abov the peds?
Config.PedWalk = {
type = 'SELECTED', --[ 'ALL' / 'SELECTED' / 'RANDOM' / 'NONE' ] 'ALL' = All peds exept the selected ped will move towards the camera. 'SELECTED' = Only the selected ped will move towards the camera. 'RANDOM' = 50/50 chance for selected and all. 'NONE' = None will move after selecting.
speed = 1.0, --Choose how fast the peds walk away if Config.PedWalk.TYPE is not set to 'NONE'. (0.1 - 10.0 or 'RANDOM' for random values each time).
--These are the coords that each ped will walk towards when selected.
--IMPORTANT : If you want to add more character slots, you MUST add more coords to the table below.
coords = {
[1] = {x = -456.0, y = 1596.8, z = 358.22, h = 180.72},
[2] = {x = -456.8, y = 1597.1, z = 358.22, h = 180.72},
[3] = {x = -455.9, y = 1597.3, z = 358.25, h = 167.72},
[4] = {x = -455.0, y = 1597.5, z = 358.23, h = 158.72},
[5] = {x = -457.9, y = 1590.61, z = 359.55, h = 148.72},
--[6] = {x = 0.0, y = 0.0, z = 0.0, h = 0.0},
}
}
Config.JobLabels = { --You can configure this table to replace the job name from the database with a job label (this job label will be displayed on ui).
['police'] = 'Police',
['ambulance'] = 'Ambulance',
['mechanic'] = 'Mechanic',
--['CHANGE_ME'] = 'CHANGE_ME',
}
--██╗ ██╗███████╗██╗ ██╗███████╗
--██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝
--█████╔╝ █████╗ ╚████╔╝ ███████╗
--██╔═██╗ ██╔══╝ ╚██╔╝ ╚════██║
--██║ ██╗███████╗ ██║ ███████║
--╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝
Config.Keys_left = Config.Keys['LEFTARROW'] --Left arrow
Config.Keys_right = Config.Keys['RIGHTARROW'] --Right arrow
Config.Keys_select = Config.Keys['ENTER'] --Enter / Left mouse click
-- ██████╗██╗ ██╗ █████╗ ██████╗ █████╗ ██████╗████████╗███████╗██████╗ ███████╗██╗ ██████╗ ████████╗███████╗
--██╔════╝██║ ██║██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔══██╗ ██╔════╝██║ ██╔═══██╗╚══██╔══╝██╔════╝
--██║ ███████║███████║██████╔╝███████║██║ ██║ █████╗ ██████╔╝ ███████╗██║ ██║ ██║ ██║ ███████╗
--██║ ██╔══██║██╔══██║██╔══██╗██╔══██║██║ ██║ ██╔══╝ ██╔══██╗ ╚════██║██║ ██║ ██║ ██║ ╚════██║
--╚██████╗██║ ██║██║ ██║██║ ██║██║ ██║╚██████╗ ██║ ███████╗██║ ██║ ███████║███████╗╚██████╔╝ ██║ ███████║
-- ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚══════╝
Config.DefaultCharAmount = 5 --The amount of characters a player can have by default (MINIMUM = 1).
Config.CharacterSlotCommand = {
ENABLE = true, --Do you want to staff to use the chat command to add/remove/check the max character amount of a player?
chat_command = 'charslots', --The chat command.
Perms = {'superadmin', 'admin', 'mod'} --You decide which permission groups can use the staff command.
}
--███████╗██╗ ██╗██╗████████╗ ██████╗██╗ ██╗ ██████╗██╗ ██╗ █████╗ ██████╗ █████╗ ██████╗████████╗███████╗██████╗
--██╔════╝██║ ██║██║╚══██╔══╝██╔════╝██║ ██║ ██╔════╝██║ ██║██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔══██╗
--███████╗██║ █╗ ██║██║ ██║ ██║ ███████║ ██║ ███████║███████║██████╔╝███████║██║ ██║ █████╗ ██████╔╝
--╚════██║██║███╗██║██║ ██║ ██║ ██╔══██║ ██║ ██╔══██║██╔══██║██╔══██╗██╔══██║██║ ██║ ██╔══╝ ██╔══██╗
--███████║╚███╔███╔╝██║ ██║ ╚██████╗██║ ██║ ╚██████╗██║ ██║██║ ██║██║ ██║██║ ██║╚██████╗ ██║ ███████╗██║ ██║
--╚══════╝ ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
Config.SwitchCharacter = {
ENABLE = true, --Do you want to allow players to switch characters in game?
Command = {
ENABLE = true, ---Do you want to allow players to use a chat command to switch characters.
chat_command = 'switchcharacter', --The chat command.
distance_check = false --If the command is enabled above ^^, players need to go to to certain locations and use the chat command to switch characters.
},
KeyPress = {
ENABLE = true, --Do you want to allow players to go to certain locations and press a key to switch characters.
key = Config.Keys['E'] --The key used to switch characters.
},
Locations = {
{ Name = ''..L('switch_char_title')..'
'..L('switch_char_text'), --You dont need to change this.
x = -219.07, y = -1044.86, z = 30.14, --This is the location where players can press e to switch characters in game.
Dist = 10, --The distance that you can interact.
EnableBlip = true, --If disabled, this locations blip will not show on the map.
},
--[[ --You can add more here.
{ Name = ''..L('switch_char_title')..''..L('switch_char_text'),
x = 0.0, y = 0.0, z = 0.0,
Dist = 10,
EnableBlip = true,
},
--]]
},
Blip = {
sprite = 304, --Icon of the blip. (you can find more here - https://docs.fivem.net/docs/game-references/blips/)
scale = 0.6, --Size of the blip.
colour = 0, --Colour of the blip.
name = L('switch_char_title'), --You dont need to change this.
}
}
-- ██████╗ █████╗ ███╗ ███╗███████╗██████╗ █████╗
--██╔════╝██╔══██╗████╗ ████║██╔════╝██╔══██╗██╔══██╗
--██║ ███████║██╔████╔██║█████╗ ██████╔╝███████║
--██║ ██╔══██║██║╚██╔╝██║██╔══╝ ██╔══██╗██╔══██║
--╚██████╗██║ ██║██║ ╚═╝ ██║███████╗██║ ██║██║ ██║
-- ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝
Config.CameraType = 'FIXED' --[ 'FIXED' / 'FOCUS' ] 'FIXED' = The camera will not move when choosing a charatcer. 'FOCUS' = The camera will move and focus on the ped you are hovering over.
Config.Cam = { --Settings for the camera when viewing your characters.
camName = 'DEFAULT_SCRIPTED_CAMERA',
posX = -458.29,
posY = 1598.0,
posZ = 359.90, --All options below this line will only work if the Config.CameraType is set to 'FIXED'.
rotX = 0.0,
rotY = 0.0,
rotZ = -22.0,
fov = 70.0,
p8 = false,
p9 = 0,
}
-- █████╗ ███╗ ██╗██╗███╗ ███╗ █████╗ ████████╗██╗ ██████╗ ███╗ ██╗███████╗
--██╔══██╗████╗ ██║██║████╗ ████║██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║██╔════╝
--███████║██╔██╗ ██║██║██╔████╔██║███████║ ██║ ██║██║ ██║██╔██╗ ██║███████╗
--██╔══██║██║╚██╗██║██║██║╚██╔╝██║██╔══██║ ██║ ██║██║ ██║██║╚██╗██║╚════██║
--██║ ██║██║ ╚████║██║██║ ╚═╝ ██║██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║███████║
--╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝
Config.PedAnimations = true --Do you want to allow the peds to do animations when you hover over them before selecting?
Config.AnimationList = { --Ramdom animations the selected ped will play when you hover over them.
[1] = {anim_dict = 'friends@frj@ig_1', anim_name = 'wave_a'},
[2] = {anim_dict = 'anim@mp_player_intcelebrationfemale@wave', anim_name = 'wave'},
[3] = {anim_dict = 'friends@fra@ig_1', anim_name = 'over_here_idle_a'},
[4] = {anim_dict = 'random@mugging5', anim_name = '001445_01_gangintimidation_1_female_idle_b'},
[5] = {anim_dict = 'friends@frj@ig_1', anim_name = 'wave_b'},
[6] = {anim_dict = 'friends@frj@ig_1', anim_name = 'wave_c'},
[7] = {anim_dict = 'friends@frj@ig_1', anim_name = 'wave_d'},
[8] = {anim_dict = 'friends@frj@ig_1', anim_name = 'wave_e'},
[9] = {anim_dict = 'gestures@m@standing@casual', anim_name = 'gesture_hello'},
[10] = {anim_dict = 'anim@arena@celeb@podium@no_prop@', anim_name = 'flip_off_a_1st'},
[11] = {anim_dict = 'mp_player_int_uppergang_sign_a', anim_name = 'mp_player_int_gang_sign_a'},
[12] = {anim_dict = 'mp_player_int_uppergang_sign_b', anim_name = 'mp_player_int_gang_sign_b'},
[13] = {anim_dict = 'anim@arena@celeb@flat@solo@no_props@', anim_name = 'giggle_a_player_b'},
[14] = {anim_dict = 'anim@mp_player_intupperair_shagging', anim_name = 'idle_a'},
[15] = {anim_dict = 'anim@arena@celeb@flat@solo@no_props@', anim_name = 'flip_a_player_a'},
[16] = {anim_dict = 'anim@arena@celeb@flat@solo@no_props@', anim_name = 'cap_a_player_a'},
[17] = {anim_dict = 'anim@arena@celeb@flat@solo@no_props@', anim_name = 'slide_a_player_a'},
[18] = {anim_dict = 'anim@arena@celeb@flat@solo@no_props@', anim_name = 'slide_b_player_a'},
[19] = {anim_dict = 'anim@arena@celeb@flat@solo@no_props@', anim_name = 'slide_c_player_a'},
[20] = {anim_dict = 'anim@arena@celeb@flat@solo@no_props@', anim_name = 'slugger_a_player_a'},
--[21] = {anim_dict = 'CHANGE_ME', anim_name = 'CHANGE_ME'},
}
-- ██████╗ ████████╗██╗ ██╗███████╗██████╗
--██╔═══██╗╚══██╔══╝██║ ██║██╔════╝██╔══██╗
--██║ ██║ ██║ ███████║█████╗ ██████╔╝
--██║ ██║ ██║ ██╔══██║██╔══╝ ██╔══██╗
--╚██████╔╝ ██║ ██║ ██║███████╗██║ ██║
-- ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
```
\===
\=== Config UI
```javascript
//--------------------------------------CONFIG--------------------------------------------//
let config = {
show_delete_button:true
}
```
\===
\=== Locales
=====================================================================================
\=== Locales UI
=======================================================================================
\=== SQL
Watch this video if you are unsure how to insert an SQL Query into your database.\
[HeidiSQL ](https://youtu.be/s3tqlHV3yb0)/ [PHPMyAdmin](https://youtu.be/NXqmYn7bbMM).
```sql
CREATE TABLE IF NOT EXISTS `user_lastcharacter` (
`steamid` VARCHAR(50) NOT NULL COLLATE 'latin1_swedish_ci',
`charid` INT(11) NOT NULL,
`max_chars` INT(10) NULL DEFAULT '5'
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;
ALTER TABLE `user_lastcharacter` ADD COLUMN IF NOT EXISTS `max_chars` INT(10) NULL DEFAULT '5';
ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `phone_number` VARCHAR(10) NULL DEFAULT NULL COLLATE 'utf8mb4_bin';
```
\===
::::
---
---
url: /paid-scripts/player-hud-smart-watch.md
description: >-
FiveM player HUD and smart watch system with health, hunger, thirst, stress
tracking, and customizable UI. Supports ESX, QBCore, vRP, and standalone
frameworks.
---
# Player HUD
[**Buy Here**](https://codesign.pro/product/4184067)
[**FiveM Forums Post**](https://forum.cfx.re/t/release-paid-smartwatch-player-hud/1878537)
[**YouTube Showcase Video**](https://youtu.be/NmixlPnuTuk)
## INSTALLATION GUIDE
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
**2.** Unzip the `cd_playerhud.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_playerhud`. 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_playerhud
```
### Step 1 - Fxmanifest
Depending on your framework and dependencies, you may need to make some changes inside the **`[cd_playerhud/fxmanifest.lua]`**. We have made this easier by [commenting ](https://i.imgur.com/bbb0dam.png)on the lines you possibly need to change.
### Step 2 - Configure Resource
You **MUST** read all configurable options inside the **`[cd_playerhud/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [commented out help text](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections 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 the**`READ_ME_AFTER_PURCHASING`** folder; the file is named **`SQL_main.sql`**. Watch this video if you are unsure how to do this [HeidiSQL ](https://youtu.be/s3tqlHV3yb0)/ [PHPMyAdmin](https://youtu.be/NXqmYn7bbMM).
### Step 4 - Configure Key Binds
Before starting this resource on your main/live server, we highly advise configuring your key binds because this resource uses [Fivem's Key Mapping](../../helpful-guides/register-key-mapping.md).
**Where can I configure my key binds?**
You can configure key binds in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section near the bottom of the **`[cd_playerhud/configs/config.lua]`**.
> **Why do I need to do this?**
>
> Well long story short;- once a player has joined your server with this resource running you can no longer force change their key binds for this resource through the config.lua, only they can change it in the in-game [pause menu settings](https://imgur.com/GRWKelR). Although it will change for the players who join after you have changed it.
>
> The benefit of this system is that it's much more optimised and players can easily change their key binds on keyboards or controllers. You can also check out the [Default Keybinds](./#default-keybinds) for this resource.
### Step 4 - Basic Needs & Status
::::tabs
\==ESX
::: danger Important
**Note:** In version 3.1.0+ esx\_basicneeds and esx\_status are **not compatible**. You must remove these resources as everything you need is built into cd\_playerhud.
:::
## **Basic Needs**
### **Do you want to use the built-in basic needs system (hunger & thirst)?**
**No?** Then set the `Config.BasicNeeds.ENABLE` in the config.lua to **false.**
**Yes?** Then set the `Config.BasicNeeds.ENABLE` in the config.lua to **true** and configure the Config.BasicNeeds config options. You must also add your usable food & drink items to the `Config.BasicNeeds.Items` config table.
### **Do you want to save hunger & thirst in the database?**
**No?** Then set the `Config.BasicNeeds.save_in_database` in the config.lua to **false.**
**Yes?** Then set the `Config.BasicNeeds.save_in_database` in the config.lua to **true** and import the SQL file which is located inside the`READ_ME_AFTER_PURCHASING` folder, the file is named **`SQL_main.sql`**. Watch this video if you are unsure how to do this [HeidiSQL ](https://youtu.be/s3tqlHV3yb0)/ [PHPMyAdmin](https://youtu.be/NXqmYn7bbMM).
## **Stress**
### **Do you want to use the built-in stress system?**
**No?** Then set the `Config.Stress.ENABLE` in the config.lua to **false.**
**Yes?** Then set the `Config.Stress.ENABLE` in the config.lua to **true** and configure the Config.Stress config options.
### **Do you want to save stress in the database?**
**No?** Then set the `Config.Stress.save_in_database` in the config.lua to **false.**
**Yes?** Then set the `Config.Stress.save_in_database` in the config.lua to **true** and import the SQL file which is located inside the`READ_ME_AFTER_PURCHASING` folder, the file is named **`SQL_main.sql`**. Watch this video if you are unsure how to do this [HeidiSQL ](https://youtu.be/s3tqlHV3yb0)/ [PHPMyAdmin](https://youtu.be/NXqmYn7bbMM).
\==QBCore
## **Basic Needs**
::: warning Important
We **DO NOT** recommend you use the built-in basic needs (hunger & thirst) system in cd\_playerhud. Instead, we **recommend you use the basic needs (hunger & thirst) system** built into the QBCore base.
**Note:** Yes, you can remove the default QBCore hud script, as we don't need that; the framework handles the basic needs system, not the hud script.
:::
So set the **`Config.BasicNeeds.ENABLE`** in the config.lua to **false**. You **do not need** to make any additional changes; it comes pre-configured to use the QBCore basic needs (hunger & thirst) metadata.
## **Stress**
### **Do you want to use the built-in stress system?**
**No?** Then set the `Config.Stress.ENABLE` in the config.lua to **false.**
**Yes?** Then set the `Config.Stress.ENABLE` in the config.lua to **true** and configure the Config.Stress config options.
### **Do you want to save stress in the database?**
::: warning Important
We recommend enabling this option as this comes pre-configured to save the data to the QBCore metadata.
:::
So set the `Config.Stress.save_in_database` in the config.lua to **true.**
## ::: info Disclaimer
When we recommend something, this does not mean these things are impossible; we say this as we recommend the easiest installation method. If you have the knowledge you can do almost anything with this resource as it is highly versatile.
:::
\==vRP
## **Basic Needs**
## ::: warning Important
We **DO NOT** recommend you use the built-in basic needs (hunger & thirst) system in cd\_playerhud. Instead. We recommend you use the basic needs (hunger & thirst) system built into the vRP base.
:::
So set the **`Config.BasicNeeds.ENABLE`** in the config.lua to **false**. You **do not need** to make any additional changes; it comes pre-configured to use the vRP basic needs (hunger & thirst) system.
## **Stress**
### **Do you want to use the built-in stress system?**
**No?** Then set the `Config.Stress.ENABLE` in the config.lua to **false.**
**Yes?** Then set the `Config.Stress.ENABLE` in the config.lua to **true** and configure the Config.Stress config options.
### **Do you want to save stress in the database?**
## ::: warning Important
We **DO NOT** recommend saving the stress in the database from cd\_playerhud.
:::
So make sure the `Config.Stress.save_in_database` in the config.lua to **false.** This is because as far as we know vRP does not by default support saving stress to the database.
## ::: info Disclaimer
When we recommend something, this does not mean these things are impossible; we say this as we recommend the easiest installation method. If you have the knowledge you can do almost anything with this resource as it is highly versatile.
:::
\==No framework
## **Basic Needs**
## ::: warning Important
We **DO NOT** recommend you use the built-in basic needs system for cd\_playerhud.
:::
So make sure **`Config.BasicNeeds.ENABLE`** is set to **false**. This is because you would need a framework to have usable food & drink items.
## **Stress**
### **Do you want to use the built-in stress system?**
**No?** Then set the `Config.Stress.ENABLE` in the config.lua to **false.**
**Yes?** Then set the `Config.Stress.ENABLE` in the config.lua to **true** and configure the Config.Stress config options.
### **Do you want to save stress in the database?**
::: warning Important
We **DO NOT** recommend saving the stress in the database from cd\_playerhud.
:::
So make sure the `Config.Stress.save_in_database` in the config.lua to **false.** This is because you would need a database to save data to the database.
\==Other (custom framework)
::: danger Important
---------------------
We **CAN NOT** offer installation support when implanting this resource into your custom framework. But all of the code required to convert this resource into other frameworks is open source to you.
:::
::::
### Create your own apps
**Tips for creating Your own app screens**
The position in the screens.list array determines the order of displaying the screens. Do not change screens.current unless you want a different screen to display first (screens.current goes from 0 to screens.list.length-1)
Currently, the screens.list.name value has no use; however, it is reserved for future use, such as setting options for certain apps. // The screens.list.id is the id of the element containing the app screen. It will be displayed once it is cycled.
To make your app functional you would either need to create another JavaScript file and include it through the HTML or add inline JavaScript to the index.html file itself.
To place the screen in the correct position, use the .app-screen class on your HTML element.
The existing apps are not editable; however, you can change their order if you wish.
##
## INFORMATION
### Default Key Binds
These keys can be modified and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) section of the `[configs/config.lua]`.
Please make sure you understand how [Key Mapping](https://docs.codesign.pro/coding-information/register-key-mapping) works.
| **Key** | **Description** |
| ------------------------- | -------------------------- |
| **`I`** | Toggle the watch UI. |
| **`K`** | Toggle move mode. |
| **`Right Click`** | Disable move mode. |
| **`Left / Right Arrows`** | Cycle through the screens. |
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| **Command** | **Description** |
| ------------------ | ----------------------------------------------------------------------- |
| **`/watchhud`** | Toggle the watch UI. |
| **`/resetstatus`** | (Staff Only) Reset a player's hunger, thirst, stress, and oxygen stats. |
### Events
These events are completely optional; you can use them if needed.**Here is some information about this event.**
:::tabs
\==Add Status
| **Event Name** | **Description** | **Event Type** |
| -------------------------------------------------------------------- | --------------------------------------- | -------------- |
| TriggerEvent('cd\_playerhud:status:add', **Status\_Type, Amount`)`** | Add a status to a player. | client |
**What does `Status_Type` and `Amount` mean?**
| **Status\_Type (string)** | **Amount (number)** |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 'hunger' | 0 - 100 (0 is empty and 100 is full) |
| 'thirst' | 0 - 100 (0 is empty and 100 is full) |
| 'stress | 0 - 100 (0 is empty and 100 is full) |
| 'oxygen' | 0 - ∞ (You can add any amount, this is to support the use of diving gear, etc. But be sure to set a player's oxygen back to the maximum default value of **30** when the diving gear has been removed) |
**Do you need an example?**
The example below will add 20 'hunger' to a player when being triggered from the **client-side to the client-side.**
```lua
TriggerEvent('cd_playerhud:status:add', 'hunger', 20)
```
The example below will add 20 'hunger' to a player when being triggered from the **server-side to the client-side.**
```lua
TriggerClientEvent('cd_playerhud:status:add', source, 'hunger', 20)
```
\==Remove Status
**Here is some information about this event.**
| **Event Name** | **Description** | **Event Type** |
| --------------------------------------------------------------------- | -------------------------------------------- | -------------- |
| TriggerEvent('cd\_playerhud:status:remove', **Status\_Type, Amount)** | Remove a status from a player. | client |
**What does `Status_Type` and `Amount` mean?**
| **Status\_Type (string)** | **Amount (number)** |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| 'hunger' | 0 - 100 (0 is empty and 100 is full) |
| 'thirst' | 0 - 100 (0 is empty and 100 is full) |
| 'stress | 0 - 100 (0 is empty and 100 is full) |
| 'oxygen' | 0 - ∞ (You can remove any amount, this is to support the use of diving gear, etc. The maximum default value is **30**) |
**Do you need an example?**
The example below will remove 20 'stress' from a player when being triggered from the **client-side to the client-side.**
```lua
TriggerEvent('cd_playerhud:status:remove', 'stress', 40)
```
The example below will remove 20 'stress' from a player when being triggered from the **server-side to the client-side.**
```lua
TriggerClientEvent('cd_playerhud:status:remove', source, 'stress', 40)
```
\==Set Status
**Here is some information about this event.**
| **Event Name** | **Description** | **Event Type** |
| ------------------------------------------------------------------ | ------------------------------------ | -------------- |
| TriggerEvent('cd\_playerhud:status:set', **Status\_Type, Amount)** | Set a player's status. | client |
**What does `Status_Type` and `Amount` mean?**
| **Status\_Type (string)** | **Amount (number)** |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 'hunger' | 0 - 100 (0 is empty and 100 is full) |
| 'thirst' | 0 - 100 (0 is empty and 100 is full) |
| 'stress | 0 - 100 (0 is empty and 100 is full) |
| 'oxygen' | 0 - ∞ (You can set any amount, this is to support the use of diving gear, etc. But be sure to set a player's oxygen back to the maximum default value of **30** when the diving gear has been removed) |
**Do you need an example?**
The example below will set a player's 'oxygen' to 30 when being triggered from the **client-side to the client-side.**
```lua
TriggerEvent('cd_playerhud:status:set', 'oxygen', 30)
```
The example below will set a player's 'oxygen' to 30 when being triggered from the **server-side to the client-side.**
```lua
TriggerClientEvent('cd_playerhud:status:set', source, 'oxygen', 30)
```
\== Reset Status
**Here is some information about this event.**
| **Event Name** | **Description** | **Event Type** |
| ----------------------------------------------- | ----------------------------------------------------------- | -------------- |
| TriggerServerEvent('cd\_playerhud:ResetStatus') | Reset a player's status to the default values | server |
**Do you need an example?**
The example below reset a player's statuses to the default values when being triggered from the **client-side to the server-side.**
```lua
TriggerServerEvent('cd_playerhud:ResetStatus')
```
\==Toggle Watch UI
**Here is some information about this event.**
| **Event Name** | **Description** | **Event Type** |
| ----------------------------------------------------- | ------------------------------------------------------------ | -------------- |
| TriggerEvent('cd\_playerhud:OpenWatchUI', **Action)** | Open or close the watch UI from other scripts. | client |
**What does `Action` mean?**
| **Action** | **Description** |
| ---------- | ---------------------------------------------------- |
| 'open' | Open the watch UI. |
| 'close' | Close the watch UI. |
| nil | If the Action is nil, this will toggle the watch UI. |
**Do you need an example?**
The example below will show a players watch when being triggered from the **client-side to the client-side.**
```lua
TriggerEvent('cd_playerhud:OpenWatchUI', 'open')
```
The example below will show a players watch when being triggered from the **server-side to the client-side.**
```lua
TriggerClientEvent('cd_playerhud:OpenWatchUI', source, 'open')
```
:::
### Exports
These exports are completely optional; you can use them if needed.
:::tabs
\==client-side exports
**Get Status**
```lua [Returns the hunger, thirst, stress, and oxygen stats (table).]
exports['cd_playerhud']:GetStatus()
```
:::
## Common Issues
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder is `cd_playerhud`.
**Encrypted Files** Do not edit the encrypted files in any way.
> **Money/Hunger etc is not being updated on the UI?**
>
> eg., if certain things like your hunger/thirst/stress/money are not **being updat**ed, that most likely means your framework has renamed the events.
>
> ```
> We can not directly offer support with this, we create compatibility for default versions of frameworks. But what you need to do is change the event names in the client_customise_me.lua to the ones that currently work for your framework.
> ```
## Error Codes
If you see an error code not listed below, please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).
:::tabs
\==Server
N/A
\==Client
**8846** - You are sending the wrong data in the `cd_playerhud:status:set` event. The first argument should be the status and the 2nd argument should be a number, refer to this for how this event should be formatted [#Events](./#events).
:::
## CHANGELOG
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
### v3.0.0 - v3.1.1
**Changelog:**
## ::: tip Added
* Added config options for framework version.
* Added the ability to rename all esx events such as the setjob and playerloaded events.
* Added drag-and-drop compatibility for QBCore.
* Added 2 new files (stress and underwater\_oxygen) to make them open-source and editable.
* Added a new config option to save the hunger/thirst/stress to the database without needing to use esx\_status. This is more optimized than how esx\_status saves to the database as now this data is only saved when a player exits the server or switches character.
* Added a new config option so you can choose the effect when a player's hunger/thirst is empty. By default, you can choose between slowly losing health or blurring the screen.
* Added a new system where if the usable food/drink items are spammed, they will get added to a queue and the animations will execute one at a time
* Added a staff command to reset a players status.
* Added the ability to set the under water oxygen from other scripts to support diving gear etc.
* Added support for cd\_multicharacter when switching characters in game to reset the cached client side status data and re cache the new characters status data since you are able to save a characters data in the database now.
* Added the ability for customers to make their own apps.
:::
## ::: info Updated
* Changed disable move mode to right click instead of K.
* Updated the codesign error handlers.
* Allowed the stress value to be changed even tho config.stress is disabled.
* Added the oxygen (in water) to the GetStatus() export.
* Re-wrote and updated parts of the code.
* Reworked the logic behind getting a players money to be **far** more optimized so it does not need to get the data from the server-side anymore.
:::
## ::: warning Fixed
* Fixed having to re-configure the hunger/thirst alert every time you relog.
* Fixed random server error on server start.
* Minor bug fixes.
* Fixed the scale locale on the UI.
* 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 a typo which caused removing a status to only remove 1.
:::
### v4.0.0
**Changelog:**
::: danger Important
**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).**
:::
## ::: tip Added
* Added compatibility for oxmysq
:::
### v4.0.1
```bash [Files Changed]
fxmanifest.lua - (IMPORTANT)
server/main/server.lua - (IMPORTANT)
client/main/client.lua - (IMPORTANT)
html (FULL FOLDER) - (IMPORTANT)
```
**Changelog:**
::: danger Important
**Authentication**
* **Small authentication update to ensure stability**.
:::
### v4.0.2
## ::: tip Added
* Added compatibility with new oxmysql version.
* Added compatibility with new qbcore permission changes.
:::
## ::: info Updated
* Added some extra checks to make sure important config options have been set correctly.
:::
::: warning Fixed
Fix
* Fixed issue with blurred screen not resetting when setting or adding hunger/thirst using the /resetstatus command and other similar issues.
:::
---
---
url: /paid-scripts/player-hud-smart-watch/configs-locales-and-sql.md
description: >-
Configuration, locales, and SQL setup for cd_playerhud. Includes framework
auto-detect, basic needs, stress system, and smart watch UI settings.
---
# Configs, Locales & SQL
:::tabs
\==Config
```lua
Config = {}
Config.Keys={['ESC']=322,['F1']=288,['F2']=289,['F3']=170,['F5']=166,['F6']=167,['F7']=168,['F8']=169,['F9']=56,['F10']=57,['~']=243,['1']=157,['2']=158,['3']=160,['4']=164,['5']=165,['6']=159,['7']=161,['8']=162,['9']=163,['-']=84,['=']=83,['BACKSPACE']=177,['TAB']=37,['Q']=44,['W']=32,['E']=38,['R']=45,['T']=245,['Y']=246,['U']=303,['P']=199,['[']=39,[']']=40,['ENTER']=18,['CAPS']=137,['A']=34,['S']=8,['D']=9,['F']=23,['G']=47,['H']=74,['K']=311,['L']=182,['LEFTSHIFT']=21,['Z']=20,['X']=73,['C']=26,['V']=0,['B']=29,['N']=249,['M']=244,[',']=82,['.']=81,['LEFTCTRL']=36,['LEFTALT']=19,['SPACE']=22,['RIGHTCTRL']=70,['HOME']=213,['PAGEUP']=10,['PAGEDOWN']=11,['DELETE']=178,['LEFTARROW']=174,['RIGHTARROW']=175,['TOP']=27,['DOWNARROW']=173,['NENTER']=201,['N4']=108,['N5']=60,['N6']=107,['N+']=96,['N-']=97,['N7']=117,['N8']=61,['N9']=118,['UPARROW']=172,['INSERT']=121}
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
Config.Database = 'mysql' --[ 'mysql' / 'ghmattimysql' / 'oxmysql' ] Choose your sql database script.
Config.Framework = 'esx' ---[ 'esx' / 'qbcore' / 'vrp' / 'none' / 'other' ] Choose your framework.
Config.Language = 'EN' --[ 'EN' / 'BG' / 'DE' / 'CZ' / 'ES' / 'FI' / 'FR' / 'NL' / 'SE' / 'SK' ] You can add your own locales to the Locales.lua. But make sure to change the Config.Language to match it.
Config.ESX_version = '1.1' --[ '1.1' / '1.2' / '1.final' / 'exm' / 'legacy' ] "IF" you are using esx, choose the version you are using.
Config.FrameworkTriggers = { --You can change the esx/qbcore events (IF NEEDED).
main = 'esx:getSharedObject', --ESX = 'esx:getSharedObject' QBCORE = 'QBCore:GetObject'
load = 'esx:playerLoaded', --ESX = 'esx:playerLoaded' QBCORE = 'QBCore:Client:OnPlayerLoaded'
job = 'esx:setJob', --ESX = 'esx:setJob' QBCORE = 'QBCore:Client:OnJobUpdate'
resource_name = 'es_extended' --ESX = 'es_extended' QBCORE = 'qb-core'
}
Config.NotificationType = { --[ 'esx' / 'qbcore' / 'mythic_old' / 'mythic_new' / 'chat' / 'other' ] Choose your notification script.
server = 'esx',
client = 'esx'
}
--███╗ ███╗ █████╗ ██╗███╗ ██╗
--████╗ ████║██╔══██╗██║████╗ ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
--╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
Config.LoopWait = 500 --(in ms) The refresh timer for updating the values on the UI. (a lower number will use more ms in resmon and a higher number will use less).
Config.PlaySound = true --Do you want to use the sounds when using the watch?
Config.StaffCommands = {
ResetStatus = 'resetstatus', --The command for staff to reset their hunger/thirst/stress stats.
Perms = { --You decide which permission groups can use the staff command ^.
['esx'] = {'superadmin', 'admin', 'mod'},
['qbcore'] = {'god', 'admin'},
['other'] = {'change_me', 'change_me'}
}
}
--██╗ ██╗███████╗██╗ ██╗███████╗ █████╗ ███╗ ██╗██████╗ ██████╗ ██████╗ ███╗ ███╗███╗ ███╗ █████╗ ███╗ ██╗██████╗ ███████╗
--██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ██╔══██╗████╗ ██║██╔══██╗ ██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗ ██║██╔══██╗██╔════╝
--█████╔╝ █████╗ ╚████╔╝ ███████╗ ███████║██╔██╗ ██║██║ ██║ ██║ ██║ ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║ ██║███████╗
--██╔═██╗ ██╔══╝ ╚██╔╝ ╚════██║ ██╔══██║██║╚██╗██║██║ ██║ ██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║ ██║╚════██║
--██║ ██╗███████╗ ██║ ███████║ ██║ ██║██║ ╚████║██████╔╝ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║██║ ╚████║██████╔╝███████║
--╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚══════╝
Config.Keys = {
move_mode = Config.Keys['K'], --Key to activate move mode. (K by default and right mouse click to disable).
next_screen = Config.Keys['RIGHTARROW'], --This is the key to cycle to the next screen. (RIGHT ARROW by default).
previous_screen = Config.Keys['LEFTARROW'], --If Config.ToggleMode is set to double, then this is the key to move back to the previous screen. (LEFT ARROW by default).
}
Config.OpenWatch = {
key_mapping = {
ENABLE = true, --If this is disabled, none of the options below in this table will not used.
command = 'watchhud', --Customise the chat command.
key = 'i', --Customise the key.
description = 'Open the watch UI', --Customise the description for the chat message.
},
usable_item = {
ENABLE = true, --If this is disabled, none of the options below in this table will not used.
item_name = 'watch', --Customise the item name.
}
}
--██████╗ █████╗ ███████╗██╗ ██████╗ ███╗ ██╗███████╗███████╗██████╗ ███████╗
--██╔══██╗██╔══██╗██╔════╝██║██╔════╝ ████╗ ██║██╔════╝██╔════╝██╔══██╗██╔════╝
--██████╔╝███████║███████╗██║██║ ██╔██╗ ██║█████╗ █████╗ ██║ ██║███████╗
--██╔══██╗██╔══██║╚════██║██║██║ ██║╚██╗██║██╔══╝ ██╔══╝ ██║ ██║╚════██║
--██████╔╝██║ ██║███████║██║╚██████╗ ██║ ╚████║███████╗███████╗██████╔╝███████║
--╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝╚══════╝╚═════╝ ╚══════╝
--NOTE: The built in basic needs system will only work on ESX servers; unless you change the code.
Config.BasicNeeds = {
ENABLE = true, --Do you want to use the built in hunger & thirst basic needs system?
save_in_database = true, --Do you want the hunger & thirst to be saved in the database?
cache_status_timer = 10, --(in minutes) Every x amount of minutes a player's hunger & thirst will be cached in the server side. (it will only be saved to the database when a player exits the server).
timer = 1, --(in minutes) Every x amount of minutes a player's hunger & thirst will be decreased by 1. (100 is full and 0 is empty).
EmptyEffect = {
screenblur = false, --When a player's hunger or thirst is 0 their screen will blur.
healthloss = false, --When a player's hunger or thirst is 0 their health will start to decrease.
healthloss_timer = 5, --(in seconds) Every x amount of seconds a player's health will decrease by 1. (max health is 200, 0 means they will die).
},
Items = { --A list of usable food/drink items for the built in basic needs system.
[1] = {
item_name = 'bread', --The usable item spawn name.
item_label = 'Sandwich', --The label of the usable item.
item_type = 'food', --[ 'food' / 'drink' ]
StatusInfo = {
hunger = 20, --20 will add 20 hunger. -20 will remove 20 hunger. 0 will not add/remove anything. (100 is full hunger and 0 is empty).
thirst = 0, --20 will add 20 thirst. -20 will remove 20 thirst. 0 will not add/remove anything. (100 is full thirst and 0 is empty).
stress = 0 --20 will add 20 stress. -20 will remove 20 stress. 0 will not add/remove anything. (100 is full stress and 0 is empty).
},
PropInfo = {
hash = `prop_sandwich_01`, --The spawn name of the prop.
anim_dict = 'mp_player_inteat@burger', --An eating animation.
anim_name = 'mp_player_int_eat_burger_fp', --An eating animation.
duration = 5000, --How long the animation will last.
x = 0.13, y = 0.05, z = 0.02, pitch = 50.0, roll = 50.0, yaw = 60.0, bone = 18905 --Position of the prop on the player. (DON'T CHANGE THIS IF YOU DONT KNOW WHAT YOUR DOING).
}
},
[2] = {
item_name = 'water',
item_label = 'Water',
item_type = 'drink',
StatusInfo = {
hunger = 0,
thirst = 20,
stress = 0
},
PropInfo = {
hash = `prop_ld_flow_bottle`,
anim_dict = 'mp_player_intdrink', --A drinking animation.
anim_name = 'loop_bottle', --A drinking animation.
duration = 5000,
x = 0.10, y = -0.03, z = 0.03, pitch = -100.0, roll = 0.0, yaw = -10.0, bone = 18905
}
},
--[[ YOU CAN ADD MORE USABLE FOOD/DRINK ITEMS HERE BY COPY AND PASTING THIS TABLE.
[3] = {
item_name = 'bread',
item_label = 'Sandwich',
item_type = 'food',
StatusInfo = {
hunger = 20,
thirst = 0,
stress = 0
},
PropInfo = {
hash = `prop_sandwich_01`,
anim_dict = 'mp_player_inteat@burger',
anim_name = 'mp_player_int_eat_burger_fp',
duration = 5000,
x = 0.13, y = 0.05, z = 0.02, pitch = 50.0, roll = 50.0, yaw = 60.0, bone = 18905
}
},
]]
}
}
--███████╗████████╗██████╗ ███████╗███████╗███████╗
--██╔════╝╚══██╔══╝██╔══██╗██╔════╝██╔════╝██╔════╝
--███████╗ ██║ ██████╔╝█████╗ ███████╗███████╗
--╚════██║ ██║ ██╔══██╗██╔══╝ ╚════██║╚════██║
--███████║ ██║ ██║ ██║███████╗███████║███████║
--╚══════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
Config.Stress = {
ENABLE = true, --Do you want to use our built in stress system?
save_in_database = true, --Do you want the stress to be saved in the database? NOTE: Stress will only save to the database on ESX/QBCore servers; unless you change the code.
cache_status_timer = 10, --(in minutes) Every x amount of minutes a player's stress will be cached in the server side. (it will only be saved to the database when a player exits the server). (if 'Config.BasicNeeds.ENABLE' is enabled, the timer from that table will overwrite this timer).
health_decrease_amount = 5, --If your stress is high you will loose health slowly.
Values = { --0 is no stress and 100 stress is max stress.
Bike = {
GainStress = true, --Do you want player's to gain stress when on motorcycles.
IncreaseSpeed = 150, --If you are above 150mph you will gain stress.
IncreaseAmount = 5, --Stress will increase by this amount (out of 100) if your speed is above the amount set above.
LowerSpeed_min = 20,
LowerSpeed_max = 70, --Stress will decrease if your speed in mph is between the min and max ^.
LowerAmount = 2, --Stress will decrease by this amount (out of 100) if your speed is between the min and max.
},
Car = {
GainStress = true,
IncreaseSpeed = 150,
IncreaseAmount = 2,
LowerSpeed_min = 20,
LowerSpeed_max = 60,
LowerAmount = 1,
},
Plane = {
GainStress = true,
IncreaseSpeed = 150,
IncreaseAmount = 2,
},
Swimming = {
LowerStress = true,
LowerAmount = 3,
},
Combat = {
GainStress = true,
MeleeAmount = 1,
FirearmAmount = 2,
},
Yoga = {
LowerStress = true,
LowerAmount = 1,
},
Damage = {
GainStress = true,
IncreaseAmount = 2,
}
}
}
--██╗ ██╗ █████╗ ████████╗███████╗██████╗ ██████╗ ██╗ ██╗██╗ ██╗ ██████╗ ███████╗███╗ ██╗
--██║ ██║██╔══██╗╚══██╔══╝██╔════╝██╔══██╗ ██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝██╔════╝ ██╔════╝████╗ ██║
--██║ █╗ ██║███████║ ██║ █████╗ ██████╔╝ ██║ ██║ ╚███╔╝ ╚████╔╝ ██║ ███╗█████╗ ██╔██╗ ██║
--██║███╗██║██╔══██║ ██║ ██╔══╝ ██╔══██╗ ██║ ██║ ██╔██╗ ╚██╔╝ ██║ ██║██╔══╝ ██║╚██╗██║
--╚███╔███╔╝██║ ██║ ██║ ███████╗██║ ██║ ╚██████╔╝██╔╝ ██╗ ██║ ╚██████╔╝███████╗██║ ╚████║
-- ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝
Config.WaterOxygen = {
ENABLE = true,
--Note: After a player's oxygen reaches 0, the player will start to slowly die as they would normally. This will take around 15 extra seconds.
underwater_decrease = 5, --Every 1 second the player will loose x amount of oxygen when under water. (0 is empty and 100 is full).
underwater_recovery = 5, --Every 1 second the player will regain x amount of oxygen when NOT under water. (0 is empty and 100 is full).
}
-- ██████╗ ████████╗██╗ ██╗███████╗██████╗
--██╔═══██╗╚══██╔══╝██║ ██║██╔════╝██╔══██╗
--██║ ██║ ██║ ███████║█████╗ ██████╔╝
--██║ ██║ ██║ ██╔══██║██╔══╝ ██╔══██╗
--╚██████╔╝ ██║ ██║ ██║███████╗██║ ██║
-- ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
function Round(cd, debug) return math.floor(cd+0.5) end
function Trim(cd) return cd:gsub('%s+', '') end
if Config.Framework ~= 'esx' then
Config.BasicNeeds.ENABLE = false --NOTE: The built in basic needs system will only work on ESX servers; unless you change the code.
end
if Config.Framework ~= 'esx' and Config.Framework ~= 'qbcore' then
Config.Stress.save_in_database = false --NOTE: Stress will only save to the database on ESX/QBCore servers; unless you change the code.
end
```
\==Config UI
```javascript
CONFIG_CURRENCY = "$"; // Currency
CONFIG_BANK = "Provided by Fleeca"; // Text on the bottom of the bank screen
CONFIG_LOCALE = "EN"; // "EN" / "ES" / "DE" / "CZ" / "CUSTOM"
moment.locale('en'); // The locale of the moment.js message ( example: 1 mins ago ) - https://momentjs.com/docs/#/i18n/changing-locale/
CONFIG_INVERT_HUNGER_THIRST = false; // IF SET TO TRUE - HUNGER AND THIRST WILL GO FROM 0 TO 100, REVERSED IF FALSE
```
\==Custom Apps
```javascript
// Tips for creating Your own app screens
// The position in the screens.list array determines the order of displaying the screens.
// Do not change screens.current unless you want a different screen to display first (screens.current goes from 0 to screens.list.length-1)
// Currently the screens.list.name value has no use, however it is reserved for future use such as setting options for certain apps.
// The screens.list.id is the id of the element containing the app screen. It will be displayed once it is cycled to.
// In order to make your app functional you would either need to create another javascript file and include it through the html or add inline javascript to the index.html file itself.
// To place the screen on the correct position simply use the .app-screen class on your html element.
// The existing apps are not editable, however you can change their order if you wish to do so.
let screens = {
current: 0,
list: [
{
name:"Clock",
id:"clock"
},{
name:"Main",
id:"main"
},{
name:"Bank",
id:"money"
},{
name:"Job",
id:"job"
},{
name:"Settings",
id:"settings"
}]
}
```
\==Locales
\==Locales UI
\==SQL
Watch this video if you are unsure how to insert an SQL Query into your database.\
[HeidiSQL ](https://youtu.be/s3tqlHV3yb0)/ [PHPMyAdmin](https://youtu.be/NXqmYn7bbMM).
```sql
ALTER TABLE `users` ADD COLUMN `status` LONGTEXT NULL;
```
:::
---
---
url: /paid-scripts/identity.md
description: >-
FiveM identity card system with customizable ID cards, mugshot support, and
chat commands for showing ID to nearby players. Supports ESX, QBCore, and
standalone frameworks.
---
# Identity
[**Buy Here**](https://codesign.pro/product/4298442)
[**FiveM Forums Post**](https://forum.cfx.re/t/paid-codesign-identity/2511866)
[**YouTube Showcase Video**](https://youtu.be/JOvw3kGiIgk)
## INSTALLATION GUIDE
### Step 0 - First Steps
**1.** Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
**2.** Unzip the `cd_identity.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_identity`. 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_identity
```
### Step 1 - Fxmanifest
Depending on your framework and dependencies, you may need to make some changes inside the **`[cd_identity/fxmanifest.lua]`**. We have made this easier by [commenting ](https://i.imgur.com/bbb0dam.png)on the lines you possibly need to change.
### Step 2 - Configure Resource
You **MUST** read all configurable options inside the **`[cd_identity/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [commented out help text](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
**The most important sections are the options under the** [**Framework** ](https://i.imgur.com/4ukCTZr.png)**and** [**Important** ](https://i.imgur.com/IVm7E8l.png)**sections at the top of the `config.lua`. Everything else is optional.**
### **Step 3 -** SQL Database
::: warning
You **MUST** import the SQL file to your database. This SQL file is located inside the**`READ_ME_AFTER_PURCHASING`** folder; the file is named **`SQL_main.sql`**. Watch this video if you are unsure how to do this [HeidiSQL ](https://youtu.be/s3tqlHV3yb0)/ [PHPMyAdmin](https://youtu.be/NXqmYn7bbMM).
**DO NOT SKIP THIS STEP, OR THE SCRIPT WILL NOT FUNCTION CORRECTLY!**
:::
## INFORMATION
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| **Command** | **Description** |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`/idcard`** | If enabled, this will allow you to show your id card to the closest player by. If no players are nearby, you will see your own id card. |
| **`/idcard_outside`** | This will show your id card to the closest player who NOT in a vehicle (useful in traffic stops for when you want to show your id card to an officer outside your vehicle instead of your passenger). |
| **`/identitytest`** | (Test Command) This is a test command which opens the passport UI. |
## COMMON ISSUES
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
**Folder Name** Make sure the name of the folder is `cd_identity`.
**Encrypted Files** Do not edit the encrypted files in any way.
> **SQL Default Value?**
>
> eg., if you see an error similar to this example when inserting an SQL query into your database - `BLOB/TEXT column 'cd_identity' 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 'cd_identity' 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.
> ```
## ERROR CODES
If you see an error code not listed below, please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).
::::tabs
\=== Server
**021454** - The server event (`cd_identity:CacheIdentityData`) which caches a player's data for the id card has not been triggered.
====================================================================================================================================
\=== Client
**465144** - There is an error in the `client_customise_me.lua` in the `IdentitySaved()` function. Please attempt to debug this yourself before contacting the Codesign Team.
# **3216354** - You are attempting to close the identity card UI but its already closed. this error code will not break anything in the resource, it's more of a warning.
::::
## CHANGELOG
> **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_identity` folder, download and add in the latest version, reconfigure the configs folder and restart your server.
* **All Files Except config.lua -** This means you should do all of the above (in the All Files section) but additionally **make a backup of the `config.lua`** file and replace the new config.lua file with the one you made a backup of.
* **Specific Files -** This means you can 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 it's 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.
::: warning
**Skipping Updates**
If you are attempting to update to the latest version but have skipped previous updates, you should update all files just to be safe. For example., let's say you are currently on v4.0.1, you did not update when v4.0.2 was released, and now v4.0.3 is released, and you want to update; you should always use the All Files update method.
:::
::::tabs
\=== v1.0.2
### 03/03/2021 - 27/07/2021
v1.0.2 - v1.0.7
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
::: tip
**Add**
* Added the ability to rename all esx events such as the setjob and playerloaded events.
* Added support for CUI\_character script.
* Added a new config option to auto close the id card after x amount of seconds.
* Added the ability to set a minimum age.
:::
::: info
**Edit**
* Updated the codesign error handlers.
* Removed the dependency for screenshot basic as its not longer needed.
* The resource is now **drag-and-drop compatible with any multicharcter resource** without having to make changes to external scripts.
:::
::: warning
**Fix**
* Fixed a bug with the id card not showing your mugshot when showing your id card to another player.
* Identity passport input field now support UTF-8 characters for languages other than English.
* Fixed a issue where identity data did not load when creating a new character.
* Fixed a typo when using the id card as an item which caused it to error.
* Fixed the xPlayer.getName() returning the steam name instead of the characters roleplay name.
* 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 the bug where id card date of issue and date of expiry only showed default values.
* Fixed the bug where if you switch to female character then back to male, the female photo would still be showing.
:::
\===
\=== v4.0.0
### 08/11/2021
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: danger
**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).**
:::
\===
\=== v4.0.1
### 24/04/2022
**Files Changed:**
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type:**
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
::: tip
**Add**
* Added compatibility with the latest oxmysql.
* When using esx\_skin the default ped model will change depending on the sex you chose when you created your character.
* Added the default events to open the esx\_skin menu.
:::
\===
\=== v4.0.2
### 12/08/2024
**Files Changed:**
* \[ ] All Files
* \[ ] All Files Except config.lua
* \[x] Specific Files
> client/client.lua\
> html/js/script.js
**Update Type:**
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: warning
**Fix**
* Fixed a found exploit
:::
\===
::::
---
---
url: /paid-scripts/identity/configs-locales-and-sql.md
description: >-
Configuration, locales, and SQL setup for cd_identity. Includes framework
auto-detect, ID card settings, and database schema for player identity data.
---
# Configs, Locales & SQL
::::tabs
\=== Config
```lua
Config = {}
Config.Keys={['ESC']=322,['F1']=288,['F2']=289,['F3']=170,['F5']=166,['F6']=167,['F7']=168,['F8']=169,['F9']=56,['F10']=57,['~']=243,['1']=157,['2']=158,['3']=160,['4']=164,['5']=165,['6']=159,['7']=161,['8']=162,['9']=163,['-']=84,['=']=83,['BACKSPACE']=177,['TAB']=37,['Q']=44,['W']=32,['E']=38,['R']=45,['T']=245,['Y']=246,['U']=303,['P']=199,['[']=39,[']']=40,['ENTER']=18,['CAPS']=137,['A']=34,['S']=8,['D']=9,['F']=23,['G']=47,['H']=74,['K']=311,['L']=182,['LEFTSHIFT']=21,['Z']=20,['X']=73,['C']=26,['V']=0,['B']=29,['N']=249,['M']=244,[',']=82,['.']=81,['LEFTCTRL']=36,['LEFTALT']=19,['SPACE']=22,['RIGHTCTRL']=70,['HOME']=213,['PAGEUP']=10,['PAGEDOWN']=11,['DELETE']=178,['LEFTARROW']=174,['RIGHTARROW']=175,['TOP']=27,['DOWNARROW']=173,['NENTER']=201,['N4']=108,['N5']=60,['N6']=107,['N+']=96,['N-']=97,['N7']=117,['N8']=61,['N9']=118,['UPARROW']=172,['INSERT']=121}
function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
Config.Database = 'mysql' --[ 'mysql' / 'ghmattimysql' / 'oxmysql' ] Choose your sql database script.
Config.Language = 'EN' --[ 'EN' / 'BG' / 'DE' / 'CZ' / 'ES' / 'FI' / 'FR' / 'NL' / 'PT' / 'SE' / 'SK' ] You can add your own locales to the Locales.lua. But make sure to change the Config.Language to match it.
Config.FrameworkTriggers = { --You can change the esx events (IF NEEDED).
main = 'esx:getSharedObject',
load = 'esx:playerLoaded',
job = 'esx:setJob',
}
Config.NotificationType = { --[ 'esx' / 'mythic_old' / 'mythic_new' / 'chat' / 'other' ] Choose your notification script.
server = 'esx',
client = 'esx',
}
--██████╗ ███████╗ ██████╗ ██╗███████╗████████╗███████╗██████╗ ██████╗██╗ ██╗ █████╗ ██████╗ █████╗ ██████╗████████╗███████╗██████╗
--██╔══██╗██╔════╝██╔════╝ ██║██╔════╝╚══██╔══╝██╔════╝██╔══██╗ ██╔════╝██║ ██║██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔══██╗
--██████╔╝█████╗ ██║ ███╗██║███████╗ ██║ █████╗ ██████╔╝ ██║ ███████║███████║██████╔╝███████║██║ ██║ █████╗ ██████╔╝
--██╔══██╗██╔══╝ ██║ ██║██║╚════██║ ██║ ██╔══╝ ██╔══██╗ ██║ ██╔══██║██╔══██║██╔══██╗██╔══██║██║ ██║ ██╔══╝ ██╔══██╗
--██║ ██║███████╗╚██████╔╝██║███████║ ██║ ███████╗██║ ██║ ╚██████╗██║ ██║██║ ██║██║ ██║██║ ██║╚██████╗ ██║ ███████╗██║ ██║
--╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
Config.PassportRegisteringTime = 5 --(in seconds) How long should we wait after creating your identity until the random mesages stop and the passport UI closes.
Config.SpawnPosition = vector4(-206.24, -1013.56, 30.14, 341.3) --This is the location where players will be teleported to after they have created their identity.
Config.UseNationality = true --If enabled, the nationality of players will be saved into the database when they create a new character and can be displayed on the id cards.
Config.UsePlaceOfBirth = true --If enabled, the place of birth of players will be saved into the database when they create a new character and can be displayed on the id cards.
--██╗██████╗ ███████╗███╗ ██╗████████╗██╗███████╗██╗ ██████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ██╗ ██████╗ █████╗ ██████╗ ██████╗
--██║██╔══██╗██╔════╝████╗ ██║╚══██╔══╝██║██╔════╝██║██╔════╝██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║ ██╔════╝██╔══██╗██╔══██╗██╔══██╗
--██║██║ ██║█████╗ ██╔██╗ ██║ ██║ ██║█████╗ ██║██║ ███████║ ██║ ██║██║ ██║██╔██╗ ██║ ██║ ███████║██████╔╝██║ ██║
--██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ██║██╔══╝ ██║██║ ██╔══██║ ██║ ██║██║ ██║██║╚██╗██║ ██║ ██╔══██║██╔══██╗██║ ██║
--██║██████╔╝███████╗██║ ╚████║ ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║ ╚██████╗██║ ██║██║ ██║██████╔╝
--╚═╝╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝
Config.IDcard = {
ENABLE = true, --Do you want to allow players to use the id card? (if disabled, none of the options below will be used).
use_licenses = true, --Do you want to display the players licenses on the id card?
close_key = Config.Keys['BACKSPACE'], --The key to close the id card.
close_timer = nil, --(in seconds) The id card will automatically close after x amount of seconds. (This is disabled by default; to enable this replace nil with a number eg., 10).
Usage = {
item = true, --Do you want to allow players to show their id card to players by using a usable item.
item_name = 'idcard', --The spawn name of the usable item.
command = true, --Do you want to allow players to show their id card to other players by using a command?
command_itemcheck = false, --Do you want to make players be required to have the id card item in their inventory? (the 'item_name' above will be the item we are checking for ^^^).
command_name_1 = 'idcard', --Name of the chat command.
distance_1 = 5, --Gets the closest player within this distance to show your id card to.
description_1 = L('command_description_1'), --The description for the chat message.
--This 2nd command will show your id card to the closest player who is NOT in a vehicle (useful in traffic stops for when you want to show your id card to an officer outside your vehicle instead of your passenger).
command_name_2 = 'idcard_outside',
distance_2 = 5,
description_2 = L('command_description_2'),
},
ESX_LicenseLabels = { --If you are using esx_license, add your license types into this table and then set alabel for it. (this label will be displayed on the id card).
['dmv'] = 'Theory',
['drive'] = 'Vehicle',
['drive_bike'] = 'Motorcycle',
['drive_truck'] = 'Trucking',
['weapon'] = 'Weapon',
}
}
-- ██████╗ ████████╗██╗ ██╗███████╗██████╗
--██╔═══██╗╚══██╔══╝██║ ██║██╔════╝██╔══██╗
--██║ ██║ ██║ ███████║█████╗ ██████╔╝
--██║ ██║ ██║ ██╔══██║██╔══╝ ██╔══██╗
--╚██████╔╝ ██║ ██║ ██║███████╗██║ ██║
-- ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
Config.EnableTestCommand = false ---The test command is 'identitytest'.
```
\===
\=== Locales
===============================================================================
\=== Locales UI
[https://github.com/RampBST/Codesign\_Locales/blob/main/cd\_identity/locale\_ui.js](https://github.com/RampBST/Codesign_Locales/blob/main/cd_identity/locales_ui.js)
====================================================================================================================================================================
\=== SQL
Watch this video if you are unsure how to insert an SQL Query into your database.\
[HeidiSQL ](https://youtu.be/s3tqlHV3yb0)/ [PHPMyAdmin](https://youtu.be/NXqmYn7bbMM).
```sql
-- Most likely you will already have the users table, so this will create it if it dosn't exist.
CREATE TABLE IF NOT EXISTS `users` (
`firstname` VARCHAR(50) NULL DEFAULT '' COLLATE 'utf8mb4_bin',
`lastname` VARCHAR(50) NULL DEFAULT '' COLLATE 'utf8mb4_bin',
`dateofbirth` VARCHAR(25) NULL DEFAULT '' COLLATE 'utf8mb4_bin',
`sex` VARCHAR(10) NULL DEFAULT '' COLLATE 'utf8mb4_bin',
`cd_identity` LONGTEXT NULL DEFAULT '{"placeofbirth":"Los Santos","dateofissue":"01/01/2021","dateofexpiry":"01/01/2031","nationality":"USA"}' COLLATE 'utf8mb4_bin'
)
COLLATE='utf8mb4_bin'
ENGINE=InnoDB
;
-- If you already have the users table, we will add these new columns to it.
ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `firstname` VARCHAR(50) NULL DEFAULT '' COLLATE 'utf8mb4_bin';
ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `lastname` VARCHAR(50) NULL DEFAULT '' COLLATE 'utf8mb4_bin';
ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `dateofbirth` VARCHAR(25) NULL DEFAULT '' COLLATE 'utf8mb4_bin';
ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `sex` VARCHAR(10) NULL DEFAULT '' COLLATE 'utf8mb4_bin';
ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `cd_identity` LONGTEXT NULL DEFAULT '{"placeofbirth":"Los Santos","dateofissue":"01/01/2021","dateofexpiry":"01/01/2031","nationality":"USA"}' COLLATE 'utf8mb4_bin';
```
\===
::::
---
---
url: /free-scripts/easytime-time-and-weather-management.md
description: >-
A FiveM time and weather management script with real-time and real-weather
support via OpenWeatherMap. Includes dynamic weather, game time sync, tsunami
warnings, and shell support.
---
# Easytime
[**Download Here**](https://github.com/dsheedes/cd_easytime)
[**FiveM Forums Post**](https://forum.cfx.re/t/release-free-easytime-time-and-weather-management-by-codesign/1790503/)
[**YouTube Showcase Video**](https://youtu.be/-7SMZLyZWcY)
## Installation gude
### Step 1 - Download
**1.** Download your resource from [GitHub](https://github.com/dsheedes/cd_easytime).
**2.** Unzip the `cd_easytime.zip` folder and place this folder in your server's resource folder.
**3.** Add the resource to your server start config (server.cfg). Make sure `cd_easytime` is listed below your framework resource e.g., es\_extended, not above it.
```
ensure es_extended
ensure cd_easytime
```
### Step 2 - Fxmanifest
Depending on your framework and dependencies, you may need to make some changes inside `[cd_easytime/fxmanifest.lua]`. We have simplified this process by [commenting](https://i.imgur.com/bbb0dam.png) on the lines that you may need to modify.
### Step 3 - Configure Resource
You **must** read all configurable options inside `[cd_easytime/configs/config.lua]` and adjust them to fit your server's needs. Please pay attention to the ["commented out help text"](https://i.imgur.com/QCja8UZ.png) at the end of each line to understand the purpose of each config option.
The most important sections are those under the [**Framework**](https://i.imgur.com/4ukCTZr.png) and [**Important**](https://i.imgur.com/IVm7E8l.png) categories at the top of the `config.lua`. Everything else is optional.
### Step 4 - How Do I Use It?
* **Open the User Interface**:
* To access the UI, use the command: `/easytime`.
* **Permissions**:
* The script comes pre-configured to work with several frameworks, including ESX, QBCore, QBox, vRP, ACE permissions, and specific user identifiers for flexible permission management.
* To set up the desired permission groups:
1. Open the `[cd_easytime/configs/config.lua]`.
2. Find the line that says `Config.Permissions`.
3. Add the permission groups you want to allow access to the UI.
### Step 5 - Real Time & Weather
::: warning Open Weather Map
Easytime **does not require** a paid plan on Open Weather Map!
It is designed with the free plan in mind.
:::
1. Go to [https://openweathermap.org](https://openweathermap.org/) and create an account.
2. The API key should be automatically generated after account creation. \
To access it click on your profile name > [My API Keys](https://home.openweathermap.org/api_keys)\
Double click the key and copy it.
3. Paste this API key into `Config.APIKey`.
4. Set `Config.Time.METHOD` and/or `Config.Weather.METHOD` to **"game"** and configure to suit your servers needs.
::: info Limitations
The free limit on OpenWeatherMap is
* 60 requests per second
* 1 million requests per month
Easytime should never exceed these limits, since by default it only makes 1 request every 30 minutes.
:::
## COMMON ISSUES
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
🔔 **Folder Name** Make sure the name of the folder is `cd_easytime`.
🔔 **Encrypted Files** Do not edit the encrypted files in any way.
### Screen Flickering?
eg., if your screen is flickering while using cd\_easytime.
This issue is caused by having multiple time or weather synchronization scripts running simultaneously, which conflict with each other (e.g., vSync or vMenu). To resolve this, please disable the other time or weather synchronization script that is causing the conflict.
### Permission Checks Error?
eg., if you are having errors related to the permission checks for the /easytime command.
If you are experiencing errors related to permission checks for the /easytime command, ensure that the appropriate permission groups are correctly configured in the Config.Command.Perms in the config.lua file. Or check the PermissionsCheck function in the server.lua.
### Footprints?
eg., if players are seeing footprints when the weather is not snowing (e.g., during summer or clear weather).
This is due to a conflict with a script you are using called fanox-hunting. To resolve this issue, remove the following two lines from the client-side of the script:
```lua
if Config.EnableFootprints then
SetForcePedFootstepsTracks(true)
end
```
## CHANGELOG
**Files Changed**
Not every update requires replacing the entire folder, as we understand it’s a hassle to redo configs for each update.
* **All Files:** Delete the old `cd_easytime` folder, download the latest version, reconfigure the configs folder, and restart your server.
* **All Files Except config.lua:** Follow the steps above, but first back up your existing `config.lua` file. After downloading, replace the new `config.lua` with your backup.
* **Specific Files:** Simply copy and paste the specific updated files over the old ones, then restart your server.
::: warning ** Skipping Updates**
If you’ve skipped previous updates, it’s best to update all files to ensure compatibility. For example, if you're on v4.0.1, skipped v4.0.2, and now want to update to v4.0.3, use the "All Files" method for safety.
:::
::::tabs
\== v2.0.1
**Files Changed:**
* \[x] All files
* \[ ] Specific Files
**Changelog:**
::: warning Fixed
* Fixed time and weather syncing issues.
:::
\== 2.0.0
### 31/7/2025
**Files Changed:**
* \[x] All files
* \[ ] Specific Files
**Changelog:**
::: tip Added
* Added **Real Time** and **Real Weather**. The can be used together or independently, such as game time but real life weather.
* Added auto detect for framework and notification resources.
* Added discord roles as a permission method.
* Added QBox compatibiliy.
:::
::: info Edit
* Time changes (minute to minute) are much smother now.
:::
\== 1.3.7
### **15**/02/2023
**Files Changed:**
* \[x] All files
* \[ ] Specific Files
**Changelog:**
::: warning **Fixed**
* Fixed esx depreciated event warnings.
* Fix the issue with dynamic weather not loading correctly if false. Credits - JanBlk.
* Re-enable driveby after menu access and set clock speed for time sync. Credits - elenawinters.
:::
::::
---
---
url: /free-scripts/easytime-time-and-weather-management/keys-chat-events-exports.md
description: >-
Developer reference for cd_easytime including chat commands, triggerable
events, and exports for retrieving weather, time, and synchronization data on
both client and server sides.
---
# Keys/Chat/Events/Exports
## Chat Commands
* You can rename or disable these chat commands in the `[configs/config.lua]`.
| **Command** | **Description** |
| --------------- | ------------------------------------- |
| **`/easytime`** | The command for staff to open the UI. |
## Events
* These events are entirely optional and can be used as needed.
:::tabs
\== client-side to client-side
**Open UI**
*This event opens the UI, enabling players to access its features. A permissions check ensures that only authorized players can trigger it.*
```lua
TriggerServerEvent('cd_easytime:OpenUI')
```
\== server-side to server-side
**Open UI**
*This event opens the UI, enabling players to access its features. A permissions check ensures that only authorized players can trigger it.*
```lua
TriggerEvent('cd_easytime:OpenUI', source)
```
:::
## Exports
These exports are entirely optional and can be used as needed.
:::tabs
\== client-side exports
### **Get All Data**
*This export retrieves detailed weather, time and settings data from cd\_easytime.*
```lua
local data = exports['cd_easytime']:GetAllData()
print(data.weather) -- "EXTRASUNNY" [string]
print(data.hours) -- 08 [number]
print(data.mins) -- 00 [number]
print(data.freeze) -- true/false [boolean)
print(data.dynamic) -- true/false [boolean)
print(data.blackout) -- true/false [boolean)
print(data.tsunami) -- true/false [boolean)
print(data.timemethod) -- "realtime"/"gametime" [string]
print(data.weathermethod) -- "realweather"/"gameweather" [string]
```
Explanation
This export returns a table containing the following information:
* `data.weather`: The current in-game weather condition (string).
* `data.hours`: The current hour (number).
* `data.mins`: The current minutes (number).
* `data.freeze`: Indicates if time/weather synchronization is frozen (boolean).
* `data.dynamic`: Indicates if the weather is dynamic (boolean).
* `data.blackout`: Indicates if a blackout is in effect (boolean).
* `data.tsunami`: Indicates if a tsunami warning is active (boolean).
* `data.timemethod`: The method of tracking time, either "realtime" or "gametime" (string).
* `data.weathermethod`: The method of tracking weather, either "realweather" or "gameweather" (string).
### **Get Pause Sync State**
*This export returns a boolean indicating whether time and weather synchronization is paused, such as when a player has entered a shell.*
```lua
local pause_sync = exports['cd_easytime']:GetPauseSyncState()
print(pause_sync) -- true/false [boolean]
```
\== server-side exports
### **Get All Data**
*This export retrieves detailed weather, time and settings data from cd\_easytime.*
```lua
local data = exports['cd_easytime']:GetAllData()
print(data.weather) -- "EXTRASUNNY" [string]
print(data.hours) -- 08 [number]
print(data.mins) -- 00 [number]
print(data.freeze) -- true/false [boolean)
print(data.dynamic) -- true/false [boolean)
print(data.blackout) -- true/false [boolean)
print(data.tsunami) -- true/false [boolean)
print(data.instantweather) -- true/false [boolean)
print(data.instanttime) -- true/false [boolean)
print(data.timemethod) -- "realtime"/"gametime" [string]
print(data.weathermethod) -- "realweather"/"gameweather" [string]
```
Explanation
This export returns a table containing the following information:
* `data.weather`: The current in-game weather condition (string).
* `data.hours`: The current hour (number).
* `data.mins`: The current minutes (number).
* `data.freeze`: Indicates if time/weather synchronization is frozen (boolean).
* `data.dynamic`: Indicates if the weather is dynamic (boolean).
* `data.blackout`: Indicates if a blackout is in effect (boolean).
* `data.tsunami`: Indicates if a tsunami warning is active (boolean).
* `data.instantweather`: Indicates if the weather changes are instant (boolean).
* `data.instanttime`: Indicates if the time changes are instant (boolean).
* `data.timemethod`: The method of tracking time, either "realtime" or "gametime" (string).
* `data.weathermethod`: The method of tracking weather, either "realweather" or "gameweather" (string).
### **Get Real Time & Weather Data**
*The export retrieves real-time and weather data from cd\_easytime:*
```lua
local data = exports['cd_easytime']:GetRealData()
print(data.hours) -- 08 [number]
print(data.mins) -- 08 [number]
print(data.gta_weather) -- "EXTRASUNNY" [string]
print(data.real_weather) -- "Clear" [string]
print(data.real_weather_description) -- "clear sky" [string]
print(data.country) -- "GB" [string]
print(data.city) -- "London" [string]
```
Explanation
This export returns a table containing the following information:
* `data.hours`: The current hour (number).
* `data.mins`: The current minutes (number).
* `data.gta_weather`: The in-game weather condition (string).
* `data.real_weather`: The actual weather condition (string).
* `data.real_weather_description`: A description of the real weather (string).
* `data.country`: The country code (string).
* `data.city`: The city name (string).
:::
---
---
url: /free-scripts/easytime-time-and-weather-management/optional-features.md
description: >-
Optional features for cd_easytime including persistent weather settings, shell
support, tsunami warning system, real-time and weather setup with
OpenWeatherMap, and vMenu compatibility.
---
# Optional Features
## Persistent Weather Settings
#### **Overview**:
The weather settings configured in the in-game UI are saved in the `settings.txt` file and applied when the server starts or when the script is restarted.
#### **Ways to Save the Settings**:
There are three methods to save your weather settings:
1. **Using the UI**:
* Staff members with the appropriate permissions can select the "Save Settings" option in the UI while in-game.
2. **Automatic Saving on Script Restart**:
* The settings will automatically be saved whenever the script is stopped or restarted.
3. **Triggering a Server Event**:
* You can also save the settings by triggering the specified server event at least **30 seconds** before a server restart.
:::tabs
\== client-side to server-side
```lua
TriggerServerEvent('cd_easytime:SaveSettings')
```
\== server-side to server-side
```lua
TriggerEvent('cd_easytime:SaveSettings')
```
:::
## Shell Support
::: warning
**Note**: If you do not use shells, you can ignore this step.
:::
When a player enters or exits a shell, you need to trigger the following client-side event. This will set the time to **11 PM** and change the weather to **CLEAR** for the player's client. This ensures there are no visual anomalies, such as shadows or rain/snow, inside the shell.
:::tabs
\== When entering a shell
*This is a client-sided event.*
```lua
TriggerEvent('cd_easytime:PauseSync', true)
```
\== When exiting a shell
*This is a client-sided event.*
```lua
TriggerEvent('cd_easytime:PauseSync', false)
```
:::
## **Tsunami Warning**
1. **Configure the Tsunami Warning Duration**:
* Set the `Config.TsunamiWarning.time` to define how long the tsunami warning should last.
2. **Triggering the Server Event**:
* This server event needs to be triggered a specified number of minutes before a server restart.
* **Example**: If you set `Config.TsunamiWarning.time` to **2 minutes**, you must trigger the event **2 minutes** prior to the restart.
* The Halloween weather will begin to change immediately, and the blackout and tsunami warning sound will activate **90 seconds** later.
3. **Notes**:
* The blackout and tsunami warning will start when **3/4** of the `Config.TsunamiWarning.time` has expired.
* If you use **txAdmin's** scheduled restart feature, you only need to configure `Config.TsunamiWarning.time`. The event will be triggered automatically, so manual triggering is not necessary.
:::tabs
\== client-side to client-side
*boolean = true or false.*
```lua
TriggerEvent('cd_easytime:StartTsunamiCountdown', boolean)
```
\== client-side to server-side
*boolean = true or false.*
```lua
TriggerServerEvent('cd_easytime:StartTsunamiCountdown', -1, boolean)
```
:::
## Using Real-Time and Weather
> **Understanding the Real-Time Weather and Time Feature**
>
> The real-time and weather data feature allows your server to access up-to-date atmospheric conditions and accurate time information. It can operate in two ways:
>
> * **Independent Use**: You can configure the system to utilize either real-time weather data or real-time clock data separately, depending on your needs.
> * **Simultaneous Use**: Alternatively, both features can be activated simultaneously to provide players with a fully immersive experience that reflects current weather and time conditions in the real world.
>
> This flexibility enables you to tailor the environment to enhance gameplay and realism.
To use real-time and weather, follow these steps:
1. Set the `Config.APIKey` with your API key from [OpenWeatherMap](https://openweathermap.org/api).
2. Update the configuration settings:
* Set `Config.Weather.METHOD` to `'real'`.
* Set `Config.Time.METHOD` to `'real'`.
3. Specify your city:
* Set `Config.Time.RealTime.city` to your city of choice.
* Set `Config.Weather.RealWeather.city` to the same city or your preferred location.
## **Disable vMenu**
The time and weather sync in vMenu must be disabled. To do this make sure your permissions.cfg of vMenu for the time and weather looks like [**this**](https://i.imgur.com/LaBJ8jk.png).
*credits to joe\_mama6969.*
---
---
url: /free-scripts/easytime-time-and-weather-management/configs-and-locales.md
description: >-
Configuration options, locale settings, and framework auto-detection setup for
cd_easytime. Includes permission groups, weather settings, time methods, and
API key configuration.
---
# Configs & Locales
:::tabs
\== Config
```lua:line-numbers
Config = {}
function L(cd) if Locales[Config.Language][cd] then return Locales[Config.Language][cd] else print('Locale is nil ('..cd..')') end end
--███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
--██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
--█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
--██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
--██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
--╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
--WHAT DOES 'auto_detect' DO?
--The 'auto_detect' feature automatically identifies the resources you have and applies the appropriate default settings accordingly.
Config.Framework = 'auto_detect' --[ 'auto_detect' / 'other' ]
--If you select 'auto_detect', only ESX, QBCore and Qbox frameworks will be detected. Use 'other' for custom frameworks.
Config.Notification = 'auto_detect' --[ 'auto_detect' / 'other' ]
--If you select 'auto_detect', only ESX, QBCore, Qbox, cd_notifications, okokNotify, ps-ui and ox_lib notifications will be detected. Use 'other' for custom notification resources.
Config.Language = 'EN' --[ 'EN' / 'FR' / 'ES' ]
--You can add your own locales to Locales.lua, but be sure to update the Config.Language to match it.
Config.FrameworkTriggers = {
esx = { --If you have modified the default event names in the es_extended resource, change them here.
resource_name = 'es_extended',
main = 'esx:getSharedObject',
load = 'esx:playerLoaded'
},
qbcore = { --If you have modified the default event names in the qb-core resource, change them here.
resource_name = 'qb-core',
main = 'QBCore:GetObject',
load = 'QBCore:Client:OnPlayerLoaded'
},
qbox = { --If you have modified the default event names in the qbx-core resource, change them here.
resource_name = 'qbx_core'
}
}
Config.Permissions = { --Define which players can access the cd_easytime features.
Framework = { --Ignore this section if you're not using a framework.
['esx'] = {'superadmin', 'admin', 'mod', },
['qbcore'] = {'god', 'admin', },
['qbox'] = {'god', 'admin', },
},
Identifiers = {
ENABLE = false, --Allow players with specific identifiers to access cd_easytime?
identifier_list = {'steam:xxxxx', 'license:xxxxx', 'fivem:xxxxx', } --List player identifiers (Steam, license, or FiveM ID).
},
AcePerms = {
ENABLE = false, --Allow players with specific ACE permissions to access cd_easytime?
aceperms_list = {'command', 'easytime.staff', } --Ensure your ACE permissions are set up in server.cfg.
},
Discord = { --This feature requires the Badger Discord API resource.
ENABLE = false, --Allow players with specific Discord roles to access cd_easytime?
discord_list = {'xxxxx', 'xxxxx', } --Enter the role IDs from your Discord (see https://www.itgeared.com/how-to-get-role-id-on-discord).
}
}
--██╗███╗ ███╗██████╗ ██████╗ ██████╗ ████████╗ █████╗ ███╗ ██╗████████╗
--██║████╗ ████║██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝
--██║██╔████╔██║██████╔╝██║ ██║██████╔╝ ██║ ███████║██╔██╗ ██║ ██║
--██║██║╚██╔╝██║██╔═══╝ ██║ ██║██╔══██╗ ██║ ██╔══██║██║╚██╗██║ ██║
--██║██║ ╚═╝ ██║██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║██║ ╚████║ ██║
--╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
Config.Debug = false -- Set to true to enable debug prints for troubleshooting.
--███╗ ███╗ █████╗ ██╗███╗ ██╗
--████╗ ████║██╔══██╗██║████╗ ██║
--██╔████╔██║███████║██║██╔██╗ ██║
--██║╚██╔╝██║██╔══██║██║██║╚██╗██║
--██║ ╚═╝ ██║██║ ██║██║██║ ╚████║
--╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝
Config.Command = 'easytime' --The command for staff to open the UI.
Config.APIKey = 'CHANGE_ME' --You need this when using real time or weather. Get your free API key from https://openweathermap.org/api.
Config.ConsolePrints = false --Do you want the console to print the weather changes?
Config.VehicleBlackoutEffect = false --Do you want the lights on vehicles to be turned off during blackouts?
Config.TsunamiWarning = {
ENABLE = true, --Do you want to enable the tsunami warning countdown just before a server restart?
time = 2 --(in minutes) How long the tsunami warning should last. Read the docs for more info.
}
Config.Weather = {
METHOD = 'game', --Choose between 'game' (GTA weather) or 'real' (real-world weather).
GameWeather = { --If you chose 'game', you have the following configurable options:
dynamic_weather_time = 10, --How often (in minutes) should the weather change?
rain_chance = 10, --Chance of rain (0-100%).
thunder_chance = 20, --Chance of thunder during rain (0-100%).
snow_chance = 1, --Chance of snow (0-100%).
WeatherGroups = { --Different weather groups to cycle through.
[1] = {'CLEAR', 'CLOUDS','EXTRASUNNY', 'OVERCAST'},--Clear weather
[2] = {'CLEARING', 'RAIN', 'NEUTRAL', 'THUNDER'},--Rainy weather
[3] = {'SMOG', 'FOGGY'},--Foggy weather
[4] = {'SNOWLIGHT', 'SNOW', 'BLIZZARD', 'XMAS'}--Snowy weather
}
},
RealWeather = { --If you chose 'real', you have the following configurable options:
city = 'London', --The city from which you want to fetch the weather, e.g., London, Miami, Dubai, or Paris.
weather_check = 30, --How often (in minutes) to check for weather changes.
weather_types = { ['CLEAR'] = {802}, ['CLOUDS'] = {803}, ['EXTRASUNNY'] = {800,801}, ['OVERCAST'] = {804}, ['CLEARING'] = {300,301,310,311,313,321}, ['RAIN'] = {501,502,503,504,511,522,531}, ['NEUTRAL'] = {302,312,314,500,520,521}, ['THUNDER'] = {200,201,202,210,211,212,221,230,231,232}, ['SMOG'] = {701,711,721,731,771}, ['FOGGY'] = {741,751,761,762,781}, ['SNOWLIGHT'] = {611,615,616}, ['SNOW'] = {600,620}, ['BLIZZARD'] = {612,613,620,621,622}, ['XMAS'] = {601,602} } --Weather types and their codes (do not change this).
}
}
Config.Time = {
METHOD = 'game', --Choose between 'game' (GTA time) or 'real' (real-world time).
GameTime = { --If you chose 'game', you have the following configurable options:
time_cycle_speed = 2, --The day/night cycle duration. By default, setting it to **2** means a full day/night cycle lasts 48 real-life minutes (same as in GTA). Decreasing the value slows the cycle down, while increasing it speeds it up.
},
RealTime = { --If you chose 'real', you have the following configurable options:
city = 'London', --The city from which you want to fetch the time, e.g., London, Miami, Dubai, or Paris.
manual_UTC_offset = 0, --Manually set the time zone offset (in hours) if automatic detection is inaccurate. For example, use 3 for UTC+3 or -2 for UTC-2. Set to nil to disable this feature.
time_cycle_speed = 60, --The day/night time cycle duration. By default, 60 means a full day/night cycle lasts 24 real-life hours (same as in reality). Decreasing the value slows the cycle down, while increasing it speeds it up.
}
}
-- █████╗ ██╗ ██╗████████╗ ██████╗ ██████╗ ███████╗████████╗███████╗ ██████╗████████╗
--██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
--███████║██║ ██║ ██║ ██║ ██║ ██║ ██║█████╗ ██║ █████╗ ██║ ██║
--██╔══██║██║ ██║ ██║ ██║ ██║ ██║ ██║██╔══╝ ██║ ██╔══╝ ██║ ██║
--██║ ██║╚██████╔╝ ██║ ╚██████╔╝ ██████╔╝███████╗ ██║ ███████╗╚██████╗ ██║
--╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝
-----DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
if Config.Framework == 'auto_detect' then
if GetResourceState(Config.FrameworkTriggers.esx.resource_name) == 'started' then
Config.Framework = 'esx'
elseif GetResourceState(Config.FrameworkTriggers.qbcore.resource_name) == 'started' then
Config.Framework = 'qbcore'
elseif GetResourceState(Config.FrameworkTriggers.qbox.resource_name) == 'started' then
Config.Framework = 'qbox'
end
if Config.Framework == 'esx' or Config.Framework == 'qbcore' or Config.Framework == 'qbox' then
for c, d in pairs(Config.FrameworkTriggers[Config.Framework]) do
Config.FrameworkTriggers[c] = d
end
Config.FrameworkTriggers.esx, Config.FrameworkTriggers.qbcore, Config.FrameworkTriggers.qbox = nil, nil, nil
Config.Permissions.Framework.ENABLE = true
else
Config.Permissions.Framework.ENABLE = false
end
end
if GetResourceState('Badger_Discord_API') ~= 'started' then
if Config.Permissions.Discord.ENABLE and Config.Debug then
print('^1Error: Badger_Discord_API_not_started.^0')
end
Config.Permissions.Discord.ENABLE = false
end
if Config.Notification == 'auto_detect' then
if GetResourceState('cd_notifications') == 'started' then
Config.Notification = 'cd_notifications'
elseif GetResourceState('okokNotify') == 'started' then
Config.Notification = 'okokNotify'
elseif GetResourceState('ps-ui') == 'started' then
Config.Notification = 'ps-ui'
elseif GetResourceState('ox_lib') == 'started' then
Config.Notification = 'ox_lib'
else
if Config.Framework == 'esx' or Config.Framework == 'qbcore' or Config.Framework == 'qbox' then
Config.Notification = Config.Framework
else
Config.Notification = 'chat'
end
end
end
-----DO NOT TOUCH ANYTHING ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING.-----
```
---
---
url: /free-scripts/drawtext-ui.md
description: >-
A lightweight FiveM draw text UI resource for displaying on-screen interaction
text. Includes installation guide, code examples for single and multi-location
setups, and troubleshooting tips.
---
# Drawtext UI
[**Download Here**](https://github.com/dsheedes/cd_drawtextui)
[**FiveM Forums Post**](https://forum.cfx.re/t/release-free-draw-text-ui/1885313)
#### Translate
* [Click here to translate this page.](https://docs-codesign-pro.translate.goog/free-scripts/drawtext-ui?_x_tr_sl=en&_x_tr_tl=es&_x_tr_hl=en-GB&_x_tr_pto=nui)
* [How do I change language?](https://gyazo.com/38606313ac9a7c290dc2c72b6793bde6)
## INSTALLATION GUIDE
**1.** Unzip the `cd_drawtextui.zip` folder and place this folder in your server's resource folder.
**2.** Add the resource to your server start config: `ensure cd_drawtextui`. The name of the folder must not be changed or the resource will not function correctly.
### How to use it?
* This can be triggered from the server or client. But this is a client event.
* Multiple examples are posted below, choose one best suited to your experience level. The easiest way for you to implement this into your resources would be to use one of the examples below as a template and copy and paste your code into it.
| Show the UI | Hide the UI |
| --------------------------------------------------------- | -------------------------------------- |
| `TriggerEvent('cd_drawtextui:ShowUI', 'show', TEXT_HERE)` | `TriggerEvent('cd_drawtextui:HideUI')` |
> **Example 1 : This is how to implement the UI for a single location.**
```lua
Citizen.CreateThread(function()
local alreadyEnteredZone = false
local text = 'Title[E] Press E to be bald'
while true do
wait = 5
local ped = PlayerPedId()
local inZone = false
local dist = #(GetEntityCoords(ped)-vector3(0,0,0))
if dist <= 5.0 then
wait = 5
inZone = true
if IsControlJustReleased(0, 38) then
TriggerEvent('add your event here')
end
else
wait = 1000
end
if inZone and not alreadyEnteredZone then
alreadyEnteredZone = true
TriggerEvent('cd_drawtextui:ShowUI', 'show', text)
end
if not inZone and alreadyEnteredZone then
alreadyEnteredZone = false
TriggerEvent('cd_drawtextui:HideUI')
end
Citizen.Wait(wait)
end
end)
```
> **Example 2 : This is how to implement the UI while doing a for loop for multiple locations in 1 thread.**
```lua
Config = {}
Config.Example = {
[1] = vector3(1.1, 1.1, 1.1),
[2] = vector3(2.2, 2.2, 2.2),
[3] = vector3(3.3, 3.3, 3.3),
}
Citizen.CreateThread(function()
local alreadyEnteredZone = false
local text = 'Title[E] Press E to be bald'
while true do
wait = 5
local ped = PlayerPedId()
local inZone = false
for cd = 1, #Config.Example do
local dist = #(GetEntityCoords(ped)-vector3(Config.Example[cd].x, Config.Example[cd].y, Config.Example[cd].z))
if dist <= 5.0 then
wait = 5
inZone = true
if IsControlJustReleased(0, 38) then
TriggerEvent('add your event here')
end
break
else
wait = 2000
end
end
if inZone and not alreadyEnteredZone then
alreadyEnteredZone = true
TriggerEvent('cd_drawtextui:ShowUI', 'show', text)
end
if not inZone and alreadyEnteredZone then
alreadyEnteredZone = false
TriggerEvent('cd_drawtextui:HideUI')
end
Citizen.Wait(wait)
end
end)
```
> **Example 3 : This is a more advanced method of the `example 2` above. This is more customisable and can handle all of the keypresses in said resource in a single thread.**
```lua
Config = {}
Config.Example = {
[1] = {coords = vector3(1.1, 1.1, 1.1), distance = 5, key = 38, eventname = 'example:testevent', text = 'Title[E] Press E to be bald'},
[2] = {coords = vector3(2.2, 2.2, 2.2), distance = 5, key = 47, eventname = 'example:testevent', text = 'Title[E] Press E to be bald'},
[3] = {coords = vector3(3.3, 3.3, 3.3), distance = 5, key = 74, eventname = 'example:testevent', text = 'Title[E] Press E to be bald'},
}
Citizen.CreateThread(function()
local alreadyEnteredZone = false
local text = nil
while true do
wait = 5
local ped = PlayerPedId()
local inZone = false
for cd = 1, #Config.Example do
local dist = #(GetEntityCoords(ped)-vector3(Config.Example[cd].coords.x, Config.Example[cd].coords.y, Config.Example[cd].coords.z))
if dist <= Config.Example[cd].distance then
wait = 5
inZone = true
text = Config.Example[cd].text
if IsControlJustReleased(0, Config.Example[cd].key) then
TriggerEvent(Config.Example[cd].eventname)
end
break
else
wait = 2000
end
end
if inZone and not alreadyEnteredZone then
alreadyEnteredZone = true
TriggerEvent('cd_drawtextui:ShowUI', 'show', text)
end
if not inZone and alreadyEnteredZone then
alreadyEnteredZone = false
TriggerEvent('cd_drawtextui:HideUI')
end
Citizen.Wait(wait)
end
end)
```
### Is the resource not working as expected?
* Make sure the name of the folder is `cd_drawtextui`.
* Check the server console and the in-game F8 console for errors.
* If all else fails, contact the Codesign Team in the [Codesign Discord](https://discord.gg/HmDFGp62Tr).
---
---
url: /free-scripts/notifications.md
description: >-
A fully customizable FiveM notification system with basic, intermediate, and
advanced notification options. Supports progress bars, sounds, icons,
stacking, HTML content, and CSS styling.
---
# Notifications
[**Download Here**](https://github.com/dsheedes/cd_notifications/releases/tag/v1.0.0)
[**FiveM Forums Post**](https://forum.cfx.re/t/codesign-notifications/5368446)
## INSTALLATION GUIDE
### Step 0 - First Steps
::: warning
**1.** Download your resource from Our Website or GitHub.
**2.** Unzip the `cd_notifications.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_notifications`.
:::
### Step 1 - Configure Resource
::: warning
You **MUST** read all configurable options inside the **`[cd_notifications/configs/config.lua]`** file and configure them to suit your server's needs. Please read the [”commented out help text”](https://i.imgur.com/QCja8UZ.png) at the end of each line so you can understand what each config option does.
:::
### Step 2 - Adding Notifications
:::: warning
**Basic Notification**
> **What are basic notifications?**
>
> Basic notifications require only the essential data to be filled in.
:::tabs
\== client-side to client-side
```lua:line-numbers
TriggerEvent('cd_notifications:Add', {
title = 'Title',
message = 'Message',
type = 'success', --'success | warning | error | info | dark'.
options = {
duration = 5, --(in seconds) How long should the notification last?
}
})
```
\== server-side to client-side
```lua:line-numbers
TriggerClientEvent('cd_notifications:Add', source, {
title = 'Title',
message = 'Message',
type = 'success', --'success | warning | error | info | dark'.
options = {
duration = 5, --(in seconds) How long should the notification last?
}
})
```
:::
::::
:::: warning
**Intermediate Notification**
> **What are intermediate notifications?**
>
> Intermediate notifications provide more customizability, but for newer developers, they can be confusing.
:::tabs
\== client-side to client-side
```lua:line-numbers
TriggerEvent('cd_notifications:Add', {
title = 'Title',
message = 'Message',
type = 'success', --'success | warning | error | info | dark'.
options = {
duration = 5, --(in seconds) How long should the notification last?
use_progress = true, --Do you want a progress bar on the notification?
stack = true, --Do you want this notification to stack?
sound = 'notification.ogg', --Choose a sound file name from the [sound] folder.
icon = 'fas fa-bell', --The icon displayed on the notification.
use_html = true, --Do you want to allow the use of HTML in the title and message?
fields = {
use_icon = true, --Do you want the icon to be visible on the notification?
use_title = true, --Do you want the title to be visible on the notification?
use_message = true, --Do you want the message to be visible on the notification?
},
}
})
```
\== server-side to client-side
```lua:line-numbers
TriggerClientEvent('cd_notifications:Add', source, {
title = 'Title',
message = 'Message',
type = 'success', --'success | warning | error | info | dark'.
options = {
duration = 5, --(in seconds) How long should the notification last?
use_progress = true, --Do you want a progress bar on the notification?
stack = true, --Do you want this notification to stack?
sound = 'notification.ogg', --Choose a sound file name from the [sound] folder.
icon = 'fas fa-bell', --The icon displayed on the notification.
use_html = true, --Do you want to allow the use of HTML in the title and message?
fields = {
use_icon = true, --Do you want the icon to be visible on the notification?
use_title = true, --Do you want the title to be visible on the notification?
use_message = true, --Do you want the message to be visible on the notification?
},
}
})
```
:::
::::
:::: warning
**Advanced Notification**
> **What are advanced notifications?**
>
> Advanced notifications provide complete customizability, but only experienced developers should use these.
:::tabs
\== client-side to client-side
```lua:line-numbers
TriggerEvent('cd_notifications:Add', {
title = 'Title',
message = 'Message',
type = 'success', --'success | warning | error | info | dark'.
options = {
duration = 5, --(in seconds) How long should the notification last?
use_progress = true, --Do you want a progress bar on the notification?
stack = true, --Do you want this notification to stack?
sound = 'notification.ogg', --Choose a sound file name from the [sound] folder.
icon = 'fas fa-bell', --The icon displayed on the notification.
use_html = true, --Do you want to allow the use of HTML in the title and message?
fields = {
use_icon = true, --Do you want the icon to be visible on the notification?
use_title = true, --Do you want the title to be visible on the notification?
use_message = true, --Do you want the message to be visible on the notification?
},
style = { --You can customise the notification style in CSS.
class = 'string | JSON',
background = 'rgb(255,0,0)',
title = 'color: #333333; font-size: 18px; font-weight: bold',
message = 'color: white; font-size:16px',
icon = 'font-size:16px',
}
}
})
```
\== server-side to client-side
```lua:line-numbers
TriggerClientEvent('cd_notifications:Add', source, {
title = 'Title',
message = 'Message',
type = 'success', --'success | warning | error | info | dark'.
options = {
duration = 5, --(in seconds) How long should the notification last?
use_progress = true, --Do you want a progress bar on the notification?
stack = true, --Do you want this notification to stack?
sound = 'notification.ogg', --Choose a sound file name from the [sound] folder.
icon = 'fas fa-bell', --The icon displayed on the notification.
use_html = true, --Do you want to allow the use of HTML in the title and message?
fields = {
use_icon = true, --Do you want the icon to be visible on the notification?
use_title = true, --Do you want the title to be visible on the notification?
use_message = true, --Do you want the message to be visible on the notification?
},
on_create = { --When a notification is created, you have the ability to send data to a nui callback.
location = {
resource = 'cd_garage', --The resource name where the nui callback is located.
destination = 'notification_created', --The nui callback name.
},
data = 'console.log("Notification created.")' --The data that's been sent to the nui callback in any script.
},
on_click = { --When a notification is clicked, you have the ability to send data to a nui callback in any script.
location = {
resource = 'cd_garage', --The resource name where the nui callback is located.
destination = 'notification_clicked', --The nui callback name.
},
data = 'console.log("Notification clicked.")' --The data thats been sent to the nui callback.
},
style = { --You can customise the notification style in CSS.
notification = {
class = 'string',
border = 'string',
background = 'string',
title = {
title_color = 'string',
size = 'string'
},
message = {
message_color = 'string',
size = string
},
icon = {
fill = 'string',
size = 'string',
},
},
stack = {
primary_color = 'string',
secondary_color = 'string'
}
}
}
})
```
:::
::::
## INFORMATION
### Chat Commands
These chat commands can be renamed and/or disabled in the [Keys and Commands](https://i.imgur.com/bTvuXLZ.png) 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.
| Command | Description |
| -------------------- | ---------------------------------------------------------------- |
| **`/notifsettings`** | Open the notification's settings UI. |
| **`/notif_test`** | (Test Command) This is a test command to test the notifications. |
### Events
These events are completely optional; you can use them if needed.
:::tabs
\== client-side to client-side
**Remove a Notification**
*The 1st argument \[id] is the unique id for that notification.*
```lua
TriggerEvent('cd_notifications:Remove', id)
```
**Show Notifications**
*Allows notifications to be displayed on your screen. This is to be used after you disable them.*
```lua
TriggerEvent('cd_notifications:ShowNotifications')
```
**Hide Notifications**
*Disables notifications from being displayed on your screen. This can be useful for cutscenes or minigames.*
```lua
TriggerEvent('cd_notifications:HideNotifications')
```
**Show Settings UI**
*Opens the notification's settings UI.*
```lua
TriggerEvent('cd_notifications:ShowSettings')
```
**Hide Settings UI**
*Hides the notification's settings UI.*
```lua
TriggerEvent('cd_notifications:HideSettings')
```
\== server-side to client-side
**Remove a Notification**
*The 1st argument \[id] is the unique id for that notification.*
```lua
TriggerClientEvent('cd_notifications:Remove', source, id)
```
**Show Notifications**
*Allows notifications to be displayed on your screen. This is to be used after you disable them.*
```lua
TriggerClientEvent('cd_notifications:ShowNotifications', source)
```
**Hide Notifications**
*Disables notifications from being displayed on your screen. This can be useful for cutscenes or minigames.*
```lua
TriggerClientEvent('cd_notifications:HideNotifications', source)
```
**Show Settings UI**
*Opens the notification's settings UI.*
```lua
TriggerClientEvent('cd_notifications:ShowSettings', source)
```
**Hide Settings UI**
*Hides the notification's settings UI.*
```lua
TriggerClientEvent('cd_notifications:HideSettings', source)
```
:::
## COMMON ISSUES
Please check out our [**Troubleshooting Guide**](https://docs.codesign.pro/coding-information/self-debugging#troubleshooting) before contacting our support.
🔔 **Folder Name** Make sure the name of the folder is `cd_notifications`.
## ERROR CODES
If you see an error code not listed below, please open a script support ticket in the [Codesign Discord](https://discord.gg/codesign).
:::tabs
\== Server
N/A
\== Client
N/A
:::
## CHANGELOG
> **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_notifications` folder, download and add in the latest version, reconfigure the configs folder and restart your server.
* **All Files Except config.lua -** This means you should do all of the above (in the All Files section) but additionally **make a backup of the `config.lua`** file and replace the new config.lua file with the one you made a backup of.
* **Specific Files -** This means you can 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 it's 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.
::: warning
**Skipping Updates**
If you are attempting to update to the latest version but have skipped previous updates, you should update all files just to be safe. For example., let's say you are currently on v4.0.1, you did not update when v4.0.2 was released, and now v4.0.3 is released, and you want to update; you should always use the “All Files” update method.
:::
::::tabs
\== v1.0.0
### 01/06/2023
**Files Changed**:
* \[x] All Files
* \[ ] All Files Except config.lua
* \[ ] Specific Files
**Update Type**:
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: tip
**STATUS**
* **Development Stage:** COMPLETE
* **Alpha Test Stage:** IN-PROGRESS
* **Beta Test Stage:** NOT STARTED
:::
::::
---
---
url: /free-scripts/devtools.md
description: >-
A Lua table viewer and developer tool for FiveM servers. Features a NUI-based
table viewer, quick resource restart, and key bindings for debugging in dev
environments.
---
# Devtools
[**Download Here**](https://github.com/dsheedes/cd_devtools)
[**FiveM Forums Post**](https://forum.cfx.re/t/free-release-devtools-lua-json-table-viewer-by-codesign/3951738)
[**YouTube Showcase Video**](https://youtu.be/7iClw0DqVUU)
#### Translate
* [Click here to translate this page.](https://docs-codesign-pro.translate.goog/free-scripts/devtools?_x_tr_sl=en&_x_tr_tl=es&_x_tr_hl=en-GB&_x_tr_pto=nui)
* [How do I change language?](https://gyazo.com/38606313ac9a7c290dc2c72b6793bde6)
## INSTALLATION GUIDE
**1.** Unzip the `cd_devtools.zip` folder and place this folder in your server's resource folder.
**2.** Before starting the script, please read the `config.lua` (this is located inside the main cd\_devtools folder) and configure the script to suit your server's needs.
**3.** Add the resource to your server start config: `ensure cd_devtools`. The name of the folder must not be changed or the resource will not function correctly.
### Step 1 - Table Viewer
Simply trigger the event below, sending an LUA table in the first argument. The UI will only open when you trigger the event. This event can be placed in while loops and the displayed table will be updated.
**Notes**
* You can disable the NUI focus by clicking `middle mouse button` while the UI is still open, and the UI will stay on your screen even while you are triggering the event so you can see the table being updated live.
* You can reopen the UI and display the last table by pressing `numpad enter` while the UI is closed.
* Yes, it will be high ms on resmon when being triggered from a loop but this is a developer resource for dev servers only.
:::tabs
\== From server to client
```lua
TriggerClientEvent('table', source, TABLE_HERE)
```
\== From client to client
```lua
TriggerEvent('table', TABLE_HERE)
```
:::
### Step 2 - Quick Resource Restart
The purpose of this feature is to be able to quickly restart scripts when developing and debugging. To save a script to restart you can use the chat command below to save your chosen script.
Use the chat command `/restart_script "resource_name"` to save the name of your chosen resource in the `restart_script.txt` file and cache it in the server side. Now when you start your server or restart the resource you can simply press the `(numpad +)` key to restart the resource.
### Chat commands
| **Command** | **Example** | **Description** |
| ---------------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| /restart\_script | /restart\_script cd\_garage | Save the name of a resource to use in the quick restart keypress. The example command will save the resource "cd\_garage". |
### Default Key Binds
| **Key** | **Description** |
| ------------------- | --------------------------------------------------------------------------- |
| Middle Mouse Button | While the UI is opened, this will toggle the NUI focus *(mouse on screen).* |
| Escape | Close the UI. |
| NUMPAD + | Quickly restart your chosen script. |
| Numpad Enter | Reopen the UI and display the last table. |
## SCRIPT NOT WORKING?
### Common Issues
🔔 **Folder Name** Make sure the name of the folder is `cd_devtools.`
### **Troubleshooting**
**1.** Check for obvious error prints in the server console and the client F8 console. If you don't see any obvious errors make sure to restart the script while the server is live and check again.
**2.** If none of the above worked, have a second read through the installation guide above, you may have missed something - you are only human.
*If all else fails, contact the Codesign Team in the* [*Codesign Discord*](https://discord.gg/codesign)*.*
## CONFIGS & LOCALES
:::tabs
\== Config
```lua
Config = {}
Config.Keys={['ESC']=322,['F1']=288,['F2']=289,['F3']=170,['F5']=166,['F6']=167,['F7']=168,['F8']=169,['F9']=56,['F10']=57,['~']=243,['1']=157,['2']=158,['3']=160,['4']=164,['5']=165,['6']=159,['7']=161,['8']=162,['9']=163,['-']=84,['=']=83,['BACKSPACE']=177,['TAB']=37,['Q']=44,['W']=32,['E']=38,['R']=45,['T']=245,['Y']=246,['U']=303,['P']=199,['[']=39,[']']=40,['ENTER']=18,['CAPS']=137,['A']=34,['S']=8,['D']=9,['F']=23,['G']=47,['H']=74,['K']=311,['L']=182,['LEFTSHIFT']=21,['Z']=20,['X']=73,['C']=26,['V']=0,['B']=29,['N']=249,['M']=244,[',']=82,['.']=81,['LEFTCTRL']=36,['LEFTALT']=19,['SPACE']=22,['RIGHTCTRL']=70,['HOME']=213,['PAGEUP']=10,['PAGEDOWN']=11,['DELETE']=178,['LEFTARROW']=174,['RIGHTARROW']=175,['TOP']=27,['DOWNARROW']=173,['NENTER']=201,['N4']=108,['N5']=60,['N6']=107,['N+']=96,['N-']=97,['N7']=117,['N8']=61,['N9']=118,['UPARROW']=172,['INSERT']=121,['MMB']=27}
Config.Keys = {
open_ui = Config.Keys['NENTER'], --(numpad enter)
toggle_nuifocus = Config.Keys['MMB'], --(middle mouse button)
restart_script = Config.Keys['N+'], --(numpad +)
}
```
:::
## CHANGELOG
**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_devtools` 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.
::::tabs
\== v1.0.0
### 11/07/2021
**Files Changed**:
* \[x] All files
* \[ ] Specific Files
**Update Type**:
* \[x] Mandatory
* \[ ] Optional
**Changelog:**
::: tip
**STATUS**
* **Development Stage:** COMPLETE
* **Alpha Test Stage:** COMPLETE
* **Beta Test Stage:** COMPLETE
:::
\== v1.0.1
### 14/07/2021
**Files Changed**:
* \[x] All files
* \[ ] Specific Files
**Update Type**:
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
::: tip
**Add**
* Added version check
:::
::: info
**Edit**
* Minor code clean-up
* Enable NUI focus be default when opening the table viewer UI
* Shortened the event to open the table viewer UI for quality of life
:::
::: warning
**Fix**
* Fix for the UI not opening after you closed it when the previous table is the same as the current one
:::
\== v1.0.2
### 19/12/2021
**Files Changed**:
* \[x] All files
* \[ ] Specific Files
**Update Type**:
* \[ ] Mandatory
* \[x] Optional
**Changelog:**
::: tip
**Add**
* Added a small quality of life feature - the ability to reopen the UI and view the last table after it has been closed.
:::
---
---
url: /free-scripts/keymaster-minigame.md
description: >-
A FiveM key-press minigame with customizable difficulty settings. Includes
installation guide, export examples with custom parameters, and
troubleshooting tips.
---
# Keymaster - Minigame
[**Download Here**](https://github.com/dsheedes/cd_keymaster)
[**FiveM Forums Post**](https://forum.cfx.re/t/release-keymaster-minigame-by-codesign/1790624)
[**YouTube Showcase Video**](https://youtu.be/hQwINGRIIyo)
## INSTALLATION GUIDE
**1.** Unzip the `cd_keymaster.zip` folder and place this folder in your server's resource folder.
**2.** Before starting the script, please read the `config.lua` (this is located inside the main cd\_keymaster folder) and configure the script to suit your server's needs.
### How do I use it?
#### Example 1
You can start the minigame by using the default settings.
```lua
local example = exports['cd_keymaster']:StartKeyMaster()
if example then
print('im a winner)
else
print('i suck so bad)
end
```
#### Example 2
Or you can use the start the minigame by sending customized settings in a table.
```lua
local CustomSettings = {
settings = {
handleEnd = true; --Send a result message if true and callback when message closed or callback immediately without showing the message
speed = 10; --pixels / second
scoreWin = 1000; --Score to win
scoreLose = -150; --Lose if this score is reached
maxTime = 60000; --sec
maxMistake = 5; --How many missed keys can there be before losing
speedIncrement = 1; --How much should the speed increase when a key hit was successful
},
keys = {"a", "w", "d", "s", "g"}; --You can hash this out if you want to use default keys in the java side.
}
local example = exports['cd_keymaster']:StartKeyMaster(CustomSettings)
if example then
print('im a winner)
else
print('i suck so bad)
end
```
### Is the resource not working as expected?
* Make sure the name of the folder is `cd_keymaster`.
* Check the server console and the in-game F8 console for errors.
* If all else fails, contact the Codesign Team in the [Codesign Discord](https://discord.gg/HmDFGp62Tr).
---
---
url: /free-scripts/staff-support.md
description: >-
A FiveM staff moderation tool with chat commands for staff sits, staff
jailing, and moderation actions. Includes configurable permissions and
changelog history.
---
# Staff Support
[**Download Here**](https://github.com/dsheedes/cd_staffsupport)
[**FiveM Forums Post**](https://forum.cfx.re/t/release-free-easytime-time-and-weather-management-by-codesign/1790503/)
## INSTALLATION GUIDE
**1.** Unzip the `cd_staffsupport.zip` folder and place this folder in your server's resource folder.
**2.** Before starting the script, please read the `config.lua` (this is located inside the main cd\_staffsupport folder) and configure the script to suit your server's needs.
**3.** Add the resource to your server start config: `ensure cd_staffsupport` (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 resource will not function correctly.
### Step 1 - How do I use it?
This resource is very simple and only uses chat commands. The chat suggestions of each chat command will explain what each option does.
## INFORMATION
### Chat commands
All of these chat commands can be renamed and disabled/enabled in the config.lua.
| **Command** | **Description** |
| ---------------------- | ----------------------------------------------------------------- |
| **`/staffsit_start`** | Staff Only: Start a staff sit |
| **`/staffsit_end`** | Staff Only: End a staff sit |
| **`/staffsit_reset`** | Staff Only: Reset the staff sit location back to default location |
| **`/staffsit_endall`** | Staff Only: End all active staff sits |
| **`/staffjail_start`** | Staff Only: Send a player to staff jail |
| **`/staffjail_end`** | Staff Only: End a players staff jail time |
| **`/staffjail_goto`** | Staff Only: Teleport to one of the staff jails |
| **`/staffjail_lion`** | Staff Only: Spawn an angry lion into a staff jail |
| **`/holytroll`** | Staff Only: Be judged by the holy one |
## SCRIPT NOT WORKING?
### Common Issues
🔔 **Folder Name** Make sure the name of the folder is `cd_staffsupport.`
**Troubleshooting**
**1.** Check for obvious error prints in the server console and the client F8 console. If you don't see any obvious errors make sure to restart the script while the server is live and check again.
**2.** If none of the above worked, have a second read through the installation guide above, you may have missed something - you are only human.
*If all else fails, contact the Codesign Team in the* [*Codesign Discord*](https://discord.gg/codesign)*.*
## CHANGELOG
**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_staffsupport` 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.
::::tabs
\== v1.0.0
### 29/04/2022
**Files Changed:**
* \[x] All files
* \[ ] Specific Files
**Changelog:**
::: tip
**STATUS**
* **Development Stage:** COMPLETE
* **Alpha Test Stage:** COMPLETE
* **Beta Test Stage:** COMPLETE
:::
\== v1.0.2
### 08/08/2022
**Files Changed:**
* \[x] All files
* \[ ] Specific Files
**Changelog:**
::: warning
**Fixed**
* Fixed the typos causing the identifiers option to not work.
* Fixed staff sit command perms checking perms for the staff jail.
:::
::::
---
---
url: /paid-scripts/garage/developer-api.md
---
# Developer API
* [chat-commands.md](chat-commands.md)
* [events.md](events.md)
* [exports.md](exports.md)
* [keys.md](keys.md)
* [items.md](items.md)
---
---
url: /paid-scripts/door-lock.md
description: >-
FiveM door lock system with full door management, import/export, migration
from ox_doorlock and qb-doorlock, MLO support for Gabz, G&N's Studio, Kiiya,
and more.
---
# Door Lock
[**Buy Here**](https://codesign.pro/package/5315701)
[**FiveM Forums Post**](https://forum.cfx.re/t/paid-codesign-door-lock/5005862)
[**YouTube Walkthrough Video**](https://www.youtube.com/watch?v=2m4pLPK2X0E)
## 📘 Start Here
* [**Installation Guide**](https://docs.codesign.pro/paid-scripts/door-lock/installation-guide)\
Step-by-step setup and configuration.
* [**Configuration**](https://docs.codesign.pro/paid-scripts/door-lock/optional-features)\
All optional features that can be enabled in config explained.
* [**Compatibility**](https://docs.codesign.pro/paid-scripts/door-lock/doorlock-import)\
What’s built-in vs needs changes.
### 🔧 Developer Reference
* [**Chat Commands**](https://docs.codesign.pro/paid-scripts/door-lock/developer-api/chat-commands)\
Player & staff commands with usage examples.
* [**Events**](https://docs.codesign.pro/paid-scripts/door-lock/developer-api/events)\
Triggerable events (client/server) with Lua examples.
* [**Exports**](https://docs.codesign.pro/paid-scripts/door-lock/developer-api/exports)\
Optional functions to integrate cd\_doorlock with other scripts.
* [**Keys & Controls**](https://docs.codesign.pro/paid-scripts/door-lock/developer-api/keys)\
Default keybinds and interaction methods.
* [Items](https://docs.codesign.pro/paid-scripts/door-lock/developer-api/items)\
Default items and item-based interaction methods.
### 🧠 Need Help?
* [**Troubleshooting Guide**](https://docs.codesign.pro/paid-scripts/door-lock/troubleshooting-guide)\
Common issues and error codes.
* **Support:** Join our Discord –
### 💡 Developer Notes
* Keep integrations simple: use provided **Exports** and **Events**.
* All code samples are **Lua**, beginner-friendly, and copy/paste ready.
* Prefer **auto-detect** config options where available.
---
---
url: /parts/changelog-key.md
---
::: info **Files Changed**
Not every update requires replacing the entire folder. To avoid redoing your configs, use the option that applies
:::
| Key | Meaning |
|-|-|
| **Full Re-Download Required** | Delete the old folder and replace it with the latest version. Reuse your `config.lua` unless told otherwise. |
| **Update Specific Files** | Only the files listed below need to be replaced. |
| **Config Update Required** | Your `config.lua` must be updated for this version.|
| **Requires Auto SQL Enabled** | Enable `Config.AutoInsertSQL` in `config.lua` to apply required database updates. |
::: danger ** 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.
:::
---
---
url: /parts/compatibility-key.md
---
| Status | Description |
| --- | --- |
| **Built-In (script)** | Fully integrated into the script and auto-detected, no modifications or configuration needed. |
| **Built-In (creator)** | Fully integrated by the resource creator, no modifications required. |
| **Built-In (cd\_bridge)** | Fully integrated through cd\_bridge and auto-detected, no extra changes needed in the supported resource. |
| **Minor Changes Required** | Small, simple edits such as adding or copying a single line of code. |
| **Moderate Changes Required** | Involves replacing existing logic or functions with the versions provided by Codesign. |
| **Major Changes Required** | Extensive modifications across multiple files or large code sections. |
---
---
url: /parts/migration-key.md
---
**Migration Type Key**
| State | Description |
| --- | --- |
| Built-in Migration | Automatically supported with no SQL changes, code changes, or manual setup required. |
| Minor Migration Required | Requires a simple command, SQL query, or small code change. All required queries or code are provided. Usually completed in minutes. |
| Moderate Migration Required | Requires provided SQL queries and some code changes across a few files. Usually completed in 5–15 minutes. |
| Major Migration Required | Requires multiple SQL queries and larger code changes across several files. Usually takes 1+ hours. |