FiveM OneSync Setup – Infinity vs Legacy & server.cfg Guide
Configure FiveM OneSync correctly: Infinity vs Legacy mode, 32+ players, server.cfg settings & fix common OneSync errors step by step.
Quick answer: Enable OneSync in server.cfg for 32+ players – use Infinity for new RP servers, Legacy for older scripts. Set onesync on and pick the right mode.
OneSync is FiveM's synchronization system that increases the player count beyond the original 32 slots and improves network performance. This guide explains the different modes, their advantages and disadvantages, and how to set them up optimally for your server.
Note: More guides on server optimization and troubleshooting can be found in the left navigation.
What is OneSync?
OneSync replaces the original GTA V network system with a more efficient, server-controlled synchronization. It enables:
- More than 32 players on a server
- Better synchronization of players and vehicles
- Distance-based streaming – players only see what's near them
- Lower network load through targeted culling
The Three OneSync Modes
Mode Max Players Distance Culling Recommended For
Off 32 No Test servers, very old scripts
Legacy 48 No (global sync) Old ESX servers, scripts from 2017-2019
Infinity 1024+ Yes (424 units radius) Modern servers, QBCore, recommended
OneSync Infinity vs. Legacy
Infinity (Recommended)
Infinity uses distance-based streaming – players only receive data from entities in their vicinity. This massively reduces network load and enables larger player counts. All modern frameworks like QBCore are optimized for it.
Legacy
In Legacy, all player data is synchronized globally – every player gets data from everyone else. This puts more strain on the network, but is compatible with older scripts that rely on global player queries.
Configuring OneSync in server.cfg
Basic Configuration
`# Enable OneSync Infinity (recommended) set onesync on
Maximum number of players
sv_maxclients 64`
Advanced Configuration
`# OneSync Infinity set onesync on
Legacy mode (only if necessary)
set onesync legacy
Enable population (NPCs)
set onesync_population true
Enable distance culling (on by default)
set onesync_culling true
Vehicle culling (hide vehicles outside view range)
set onesync_distanceCullVehicles false
Culling distance in units (default: 424)
set onesync_distanceCull 500
Adjust frequency based on distance
set onesync_radiusFrequency true
Vehicle culling for occupied vehicles
set onesync_vehicleCulling false`
Important OneSync Configuration Variables
Variable Default Description
onesync off OneSync mode: on (Infinity), legacy, off
onesync_population false Enable NPC population on the server
onesync_culling true Distance-based hiding of entities
onesync_radiusFrequency true Adjust sync frequency based on distance
onesync_distanceCull 424 Distance in units at which entities are hidden
onesync_vehicleCulling false Enable culling for occupied vehicles
onesync_distanceCullVehicles true Hide vehicles outside view range
Routing Buckets – Dividing Players into Zones
Routing Buckets are an advanced OneSync feature that lets you divide players into separate synchronization zones. Players in different buckets don't see each other:
`-- Move a player to a different bucket SetPlayerRoutingBucket(playerId, bucketId)
-- Query current bucket GetPlayerRoutingBucket(playerId)
-- Enable population in a bucket SetRoutingBucketPopulationEnabled(bucketId, true)` This is useful for:
- Instances (multiple simultaneous housing interiors)
- Event zones (players in an arena see each other, but not those outside)
- Admin areas (invisible to normal players)
Common Problems and Solutions
Players don't see each other on the map / Blips missing:
- With Infinity, player blips are only shown in the immediate vicinity
- Solution: Use a script that sets blips server-side for all players
- Alternative: Switch to Legacy (not recommended for large servers)
Invisible players:
- Check if your framework is compatible with Infinity – older versions cause problems
- Check if player visibility scripts collide with OneSync
- Temporarily disable all non-essential scripts for testing
NPCs don't spawn:
- Set
onesync_population truein server.cfg - Check if scripts are modifying NPC density
Synchronization issues after switching from Legacy to Infinity:
- Don't just change server.cfg – also check framework and scripts
- Old scripts that rely on global player synchronization don't work properly with Infinity
- QBCore and ESX in current versions are Infinity-compatible
Recommended OneSync Configuration
For most servers we recommend these settings:
# === ONESYNC (Recommended for modern servers) === set onesync on set onesync_population true set onesync_culling true set onesync_radiusFrequency true set onesync_distanceCull 500 set onesync_distanceCullVehicles false set onesync_vehicleCulling false
For servers with very old scripts that need global player visibility:
# === ONESYNC LEGACY (Only for old scripts) === set onesync legacy set onesync_population true