Configuration
Configure the FiveNet FiveM plugin so it can connect to your FiveNet instance and integrate with your framework, dispatch, and tracking setup.
Before You Start
Before adjusting the plugin configuration, make sure:
- your FiveNet instance is reachable from the gameserver
- the Sync API token is configured in FiveNet
- you know which framework the server is using, such as
esxorqbcore
Minimum Required Settings
At a minimum, review these values before starting the plugin:
Config.WebURLinconfig/client.luaConfig.Frameworkinconfig/server.luaConfig.API.Hostinconfig/server.luaConfig.API.Tokeninconfig/server.lua
If these values are wrong, the in-game tablet or plugin integration will not work correctly.
Configuration Reference
Client Side
The client-side configuration is located in config/client.lua.
| Option | Default Value | Description |
|---|---|---|
Config.WebURL | 'https://demo.fivenet.app' | Your FiveNet URL without a trailing slash. |
Config.Hotkey.Enable | true | If the tablet hotkey should be registered. |
Config.Hotkey.Key | 'F5' | The key used for the tablet hotkey. |
Config.PostalCommand | 'plz' | Command to mark the postal code on the player's map. |
Server-Side
The server-side configuration is located in config/server.lua.
| Option | Default Value | Description |
|---|---|---|
Config.Framework | 'esx' | The framework being used. Can be esx or qbcore. |
Config.API.Host | 'demo.fivenet.app:443' | The FiveNet Hostname, must include port if not 443, requires HTTPS. |
Config.API.Token | 'YOUR_SYNC_API_TOKEN' | The API token for FiveNet. |
Config.API.Insecure | false | Whether to allow insecure connections. |
Config.TrackCharIDs | true | Whether to record the last character ID. |
Config.Tracking.Enable | true | Enable or disable player tracking. |
Config.Tracking.Jobs | { ['ambulance'] = true, ['doj'] = true, ['police'] = true } | Jobs that will be tracked. |
Config.Tracking.Item | 'radio' | Players without this item will be marked as 'hidden'. |
Config.Tracking.Interval | 3000 | Interval in milliseconds for updating positions. |
Config.TimeclockJobs | { ['ambulance'] = true, ['doj'] = true, ['police'] = true } | Jobs that will be tracked for timeclock purposes. |
Config.Events.BillingJobs | { ['doj'] = true, ['police'] = true } | Jobs that will trigger user activity for billing cycle events. |
Config.Discord.ConnectOnJoin | true | Automatically create Discord OAuth2 connections when a player joins with a Discord ID. |
Config.Discord.OAuth2Provider | 'discord' | Name of the Discord OAuth2 provider from the FiveNet server config. |
Config.Dispatches.CivilProtectionJobs | { ['police'] = true } | Jobs that will receive dispatches created via the createCivilProtectionJobDispatch function. |
Config.Dispatches.PanicButtonTitle | 'Panikknopf ausgelöst' | Title for the panic button dispatch. |
Config.UserProps.SetBloodType | true | Enable setting the blood type for a user on "join/loaded" event. |
Config.UserProps.BloodTypes | { 'A+', 'A-', 'B+', 'B-', 'AB+', 'AB-', 'O+', 'O-' } | Blood types to assign to users if not already set. |
Functions
Some plugin integrations depend on the Functions definitions in the config files. These functions act as integration points for voice systems, inventory systems, duty checks, and similar framework-specific behavior.
Make sure the required functions are implemented for the resources your server uses.
Below are examples for client-side and server-side functions.
Client-Side
When using pma-voice, implement SetRadioFrequency in your client-side script. This function is responsible for setting the radio frequency for the player.
-- Set radio frequency
Functions.SetRadioFrequency = function(frequency --[[number]])
-- This is for pma-voice
local currentChannel = exports['pma-voice']:getRadioChannel()
if currentChannel ~= frequency then
TriggerEvent('tgiann-radio:t', frequency)
end
end
Server-Side
When using esx or qbcore, implement CheckIfPlayerHidden in your server-side script. This function checks whether a player should be hidden based on duty state and whether they have the required tracking item in their inventory.
-- Player tracker - Check if hidden function
Functions.CheckIfPlayerHidden = function(xPlayer)
if Config.Framework == 'esx' then
-- ESX
return not xPlayer.job.onDuty or (Config.Tracking.Item and not xPlayer.getInventoryItem(Config.Tracking.Item))
elseif Config.Framework == 'qbcore' then
-- QBCore
return not xPlayer.PlayerData.job.onduty or (Config.Tracking.Item and not exports['qb-inventory']:HasItem(xPlayer.PlayerData.source, Config.Tracking.Item))
else
-- Fallback
return false
end
end
Notes
- Treat the plugin config as environment-specific and review it whenever you change your FiveNet URL, API token, framework, or voice/inventory resources.
- If tracking, dispatches, or activity events do not behave as expected, review both the config values and the required custom
Functions.
