Skip to content
FIVECRATE

FiveM Anticheat Basics: Server Security Settings Explained

FiveM anticheat basics from the docs: what sv_entityLockdown, sv_filterRequestControl, pure mode and state bag strict mode block, and what each can break.

Author: FiveCrate
Published:
Updated:
Read time: 20 min
Applies to
FiveM Legacy (FXServer 35245 or later, required to accept connections since October 15, 2026) and FiveM for GTAV Enhanced (early access since July 21, 2026); any framework (Qbox, ESX, QBCore, standalone)
Last verified

Direct Answer

FiveM anticheat protection on your side is a handful of FXServer settings plus server-side checks in your own scripts. FiveM runs its own client anticheat and allows anticheat resources, but its docs admit that “sometimes things slip through”. With OneSync on, set in server.cfg: sv_entityLockdown to limit which entities clients can create, sv_filterRequestControl to stop them taking over entities other players control, setr sv_stateBagStrictMode true so only the server writes state bags, and sv_pureLevel to reject modified game files (always on in FiveM for GTAV Enhanced). Keep sv_scriptHookAllowed at false. Add one setting at a time and test it, because each one can break resources.

What FiveM’s own anticheat covers, and what it leaves to you

FiveM has a client-side anticheat that Cfx keeps in “the private tree containing client-side ‘global’ anticheat”, as the Resource FAQ puts it. The Secure Your Events page is frank about its limits: “The anti-cheat team is always trying to improve the anti-cheat, but sometimes things slip through.”

The weak point is usually your own code. The same page warns that “Cheats can allow the client to trigger events in any context”: through TriggerServerEvent (client to server) or TriggerEvent (between client resources). No convar repairs a server event that hands out whatever the client asks for, like the docs’ own example of bad security:

RegisterNetEvent("job:givePlayerItem", function(item, count)
 local ply = FX.GetPlayerFromSource(source)
 -- directly adding items to the user from their own input
 -- is always bad practice, you should always validate user input
 ply.addItem(item, count)
end)

The docs’ fix is to check networked events against values the server holds (money, state bags, inventory items, position, experience and level, permissions and roles), read “using server-side methods, not allowing players to change the values”.

How to stop cheaters on FiveM: the official list

The Resource FAQ answers “What can I do against cheaters?” with five points:

  • Report cheats you have “in usable form” to abuse@fivem.net.
  • Use server-side code where possible. “With OneSync’s unique features, server owners are able to build secure code that prevents abuse by cheats.”
  • Read the forum guides it links on how to combat cheaters and how to write your own anticheat.
  • Build your own server-side anticheat for your use case, and maintain it with the community.
  • Contribute to FiveM, which is open source: Cfx welcomes patches that improve server-side detection or add client-side detections.

Are anticheats allowed on FiveM?

Yes. The Resource FAQ’s answer is “Of course! FiveM allows you to run any resource within the terms, and you are free to use anticheat resources.” Cfx says it only acts against three things:

  • Paid resources sold outside the accepted methods in FiveM’s Terms of Service.
  • Protection rackets, defined as “(former) authors of hacks extorting server owners to buy their anticheat”.
  • Global ban lists. Cfx has “no way to verify the quality of every anticheat”, a shared list may ban players “without good reason”, and those players then cannot join a large number of servers.

This guide does not compare or recommend anticheat resources. It covers the protections built into FXServer, which work the same on Qbox, ESX, QBCore or a standalone server; what they can break depends on the resources you run.

Before you change anything: OneSync and server.cfg

Entity lockdown is documented on the OneSync page, and like control-request filtering it works on the server’s own picture of the game world, its “state awareness”. That needs OneSync. The server-commands reference describes onesync off as “No state awareness at all”, where “the server will only function as a relay”, and on as “Full state awareness and server-determined entity routing”. The official vanilla setup guide comments set onesync on as “required for server-side state awareness”.

  • FiveM Legacy with txAdmin: do not put OneSync in server.cfg. txAdmin comments out any such line with the note “onesync MUST only be set in the txAdmin settings page.” Use the OneSync select on the FXServer tab of txAdmin’s settings (an advanced option). Its default is on, shown as On (recommended).
  • FiveM Legacy without txAdmin: keep set onesync on in server.cfg, as the vanilla setup guide’s example file does.
  • FiveM for GTAV Enhanced: there is nothing to choose. Enhanced “switched to a client-server model” instead of P2P sync, OneSync big mode “is now the only mode”, and the early access hotfix of July 21, 2026 put the OneSync convar back in read-only mode.

Put the other settings in server.cfg, which the server runs at startup (the reference shows it as FXServer.exe +exec server.cfg; on Enhanced the executable is named cfx-server.exe; on Linux the vanilla guide starts it with bash ~/FXServer/server/run.sh +exec server.cfg), and restart the server after each change. The server-commands reference gives no Windows- or Linux-specific value for any setting in this guide. The newest version requirement the docs give for any setting here is server version 12739, for sv_stateBagStrictMode. Since October 15, 2026, players can no longer connect to FXServer versions older than 35245, so every Legacy server players can join is new enough.

sv_entityLockdown: stop clients from creating entities

By default, clients can create any entity. The OneSync docs say lockdown lets the server keep things in check and “deter users from doing things they shouldn’t be doing, such as spawning stuff client side”. sv_entityLockdown sets the mode for the whole server:

ModeEffect, in the docs’ wordsPlatform
inactiveClients can create any entity (the default)Legacy and Enhanced
relaxedOnly script-owned entities created by clients are blockedLegacy and Enhanced
strictNo entities can be created by clientsLegacy and Enhanced
fullDisables dummy object creationFiveM for GTAV Enhanced only
sv_entityLockdown relaxed

What entity lockdown can break

  • Client-side spawning. Under relaxed or strict, resources that create vehicles, peds or objects in client code lose them: in the FXServer source, an entity that fails the lockdown check goes straight to startDelete(). The OneSync docs recommend creating entities on the server instead:
-- create a blista at the specified coordinates
local vehicle = CreateVehicleServerSetter(GetHashKey("blista"), "automobile", 2204.795, -887.9213, 1461.224, 90.0)
-- guarantee that the server created entity will be persistent for the server
SetEntityOrphanMode(vehicle, 2)
  • Ambient population under strict. The source lets client-generated population (random ambient, parked, patrol, permanent and scenario entities) through only “in non-strict lockdown”. strict therefore removes that population as well.
  • Population on Enhanced. In relaxed mode on Enhanced, “population entities can only be spawned if the world grid is owned by the player”.
  • Map objects on Enhanced. full blocks dummy objects, which the Enhanced page defines as “objects on the map which are created dynamically from clients”.

For finer control than a server-wide mode, a server script can handle the entityCreating event, which “can be canceled to instantly delete the entity”.

Lock down one routing bucket instead of the whole server

A server script can give a single routing bucket its own lockdown mode. In the FXServer source, a bucket’s mode replaces the global sv_entityLockdown value for entities that players in that bucket create. This is the OneSync docs’ example:

SetRoutingBucketEntityLockdownMode(1, "strict") -- Set the lockdown mode to strict
SetRoutingBucketPopulationEnabled(1, false) -- Let's disable population for everything inside this bucket!
SetPlayerRoutingBucket(source, 1) -- Now the given player (source) won't be able to create entities client-side

An archived Cfx cookbook post from November 2020 notes that the routing bucket natives “require OneSync to be ‘on’, not set to ‘legacy’ mode”. The native’s reference page in the open-source repository lists only strict, relaxed and inactive; the OneSync page adds full as an Enhanced-only mode.

sv_filterRequestControl: stop clients taking over other players’ entities

A control request (REQUEST_CONTROL_EVENT) is the game event behind the NetworkRequestControlOfEntity native. When FXServer rejects one, its console warning says the client “tried to use NetworkRequestControlOfEntity” and calls that native “deprecated, and should not be used because of potential abuse by cheaters”. sv_filterRequestControl decides which requests the server passes on. The server-commands reference lists these modes:

ModeWhat it blocks
-1Same as 2 at this time, and also warns in the console
0Nothing (marked as the default); also disables the routing bucket and entity lockdown policy
1Requests for player-controlled entities (currently occupied vehicles only) that have existed longer than the settle timer
2Requests for all entities controlled by players
3Requests for all player-controlled entities, plus any non-player entities older than the settle timer
4Every request: REQUEST_CONTROL_EVENT is not routed at all

Every mode except 0 adds two rules: control requests cannot cross routing buckets, and they are always blocked when the sender is in strict entity lockdown, through the global setting or its routing bucket. The settle timer, sv_filterRequestControlSettleTimer, defaults to 30000 milliseconds and applies to modes 1 and 3 only.

sv_filterRequestControl 2
sv_filterRequestControlSettleTimer 30000

What it can break: resources that call NetworkRequestControlOfEntity. Modes 1 and 2 affect entities that players control; modes 3 and 4 reach other entities too. A server script can exempt one entity with SET_ENTITY_IGNORE_REQUEST_CONTROL_FILTER, which “allows to flag an entity to ignore the request control filter policy”.

Which sv_filterRequestControl value is the default? Sources disagree

  • The server-commands reference marks 0 as “Off (Default)” and lists -1 as a separate mode.
  • A community guide on the Cfx.re forum (“How to protect your server from MOST cheaters easily 101”) labels -1 as “Default”, and says “There’s 4 modes of this setting” while listing six values.
  • The FXServer source accounts for both. The value -1 is named Default in code, with the comment “Default is currently equivalent to FilterPlayer” (mode 2), but the convar is registered with NoFilter, which is 0, as its starting value.

So a server without the line runs with filtering off, as the docs say. Mode -1 is still useful: it is the only mode that prints the console warning when it rejects a request, at most once every 120 seconds. The warning gives the client’s slot ID and the entity’s network ID, and tells you to set "sv_filterRequestControl" "0" to disable the check.

sv_pureLevel and sv_scriptHookAllowed: block modified game files

sv_pureLevel is “used to prevent users from using modified client files”. On FiveM Legacy it is optional; the open-source server registers it with a starting value of 0. The docs describe two levels:

LevelEffect
1Blocks all modified client files except audio files and known graphics mods
2Blocks all modified client files

Modified files in the FiveM folder are ignored. A player who modified base game files gets an error message naming the modified file. What it can break: your players’ own mods. Level 2 also blocks audio and graphics mods. A player who switches between servers with different pure levels has to restart the game, as the docs note when comparing it to game build and pool size changes.

On FiveM for GTAV Enhanced, pure mode “is now always enabled and can no longer be turned off”, and graphic mods cannot be used while Enhanced is in early access.

sv_scriptHookAllowed defaults to false. Setting it to true lets clients with Script Hook V connect, which the docs mark “Not recommended - makes the server vulnerable to security issues.”

sv_pureLevel 1
sv_scriptHookAllowed false

sv_stateBagStrictMode: only the server writes state bags

State bags are key/value data attached to entities, players and the server. By default, “player state can be able to be written by the player and the server, entity state can be written by the owning player and the server”. Strict mode, introduced in server version 12739, means only the server can modify the state of networked entities and the player state:

setr sv_stateBagStrictMode true

What it can break: client scripts that write LocalPlayer.state, or the state of an entity they own. Those writes fail, and the client console shows “StateBags can’t be modified from the client, because the StateBag strict mode is enabled. Disable it using setr sv_stateBagStrictMode false.” Client-side entities that are not networked are not affected.

sv_enableNetworkedSounds and the other networked event convars

Three convars decide whether the server routes specific game events from one client to the others:

ConvarDefaultEvent it controlsWhat the docs say
sv_enableNetworkedSoundstrue (routing allowed)NETWORK_PLAY_SOUND_EVENT“commonly used by malicious actors”
sv_enableNetworkedPhoneExplosionsfalse (convar introduced in server version 6831)REQUEST_PHONE_EXPLOSION_EVENTif enabled, “it can also be used by malicious actors”
sv_enableNetworkedScriptEntityStatestrue (convar introduced in server version 8540)SCRIPT_ENTITY_STATE_CHANGE_EVENT“commonly used by malicious actors”

sv_enableNetworkedSounds false stops clients routing NETWORK_PLAY_SOUND_EVENT through the server, legitimate uses included; the forum community guide warns that it “will also disable legitimate uses of PLAY_SOUND”. The docs do not say which game features rely on script entity state changes; the forum community guide only says turning them off “blocks stuff like exclusive drivers”, so test before you set sv_enableNetworkedScriptEntityStates false. Leave phone explosions at false.

block_net_game_event: block a specific net game event

block_net_game_event adds a net game event to the list the server blocks, and unblock_net_game_event removes it, though not for events “blocked by other means like convars”. The docs’ example:

block_net_game_event "FIRE_EVENT"

Cfx’s release notes for June and July 2025 add that sv_experimentalNetGameEventHandler must be enabled, “which is the default”, or the commands do not work. Event names come from the Net Game Events list in the docs. Block only events your server does not need: the docs’ own example is that BLOCK_WEAPON_SELECTION can be blocked “if you are not using” the SET_CURRENT_PED_VEHICLE_WEAPON native.

Rate limits on network events and state bags

FXServer limits how fast each client can send events and state bag updates. The limiters use a token bucket: each has a rate (tokens replenished per second) and a burst (maximum token count), and a request is rate-limited when the bucket is empty. These are the defaults most relevant to abuse:

LimiterRate (tokens/s)BurstWhen it runs out (FXServer source)
netEvent50200The event is dropped
netEventFlood75300The client is dropped: “Reliable network event overflow.”
stateBag75125The updates are dropped, with a console warning
stateBagFlood150175The client is dropped: “Reliable state bag packet overflow.”
stateBagSize131072262144The client is dropped: “Reliable state bag packet overflow.”

Each limiter has two convars, set rateLimiter_<name>_rate <value> and set rateLimiter_<name>_burst <value>. The server-commands reference lists this table in its section of commands exclusive to FiveM for GTAV Enhanced, but these five limiters, with the same names and defaults, are also in the open-source FXServer code, the server component for FiveM Legacy. They are on by default. Before you raise one, note the source’s own advice next to the event size limit: “preferably, fix client scripts to not have this large a set of events with high frequency”. Floods that come from outside the game are covered in the DDoS protection and proxy guide.

Identity checks: sv_authMinTrust and sv_authMaxVariance

Both are integers from 1 to 5. Trust “is how unlikely it is for the user’s identity to be spoofed by a malicious client” (default 1; 5 is the most trustworthy). Variance “is how likely the user’s id will change for a given provider” (default 5). A player who falls short is refused with “You can not join this server due to your identifiers being insufficient. Please try starting Steam or another identity provider and try again.”

In the open-source server, the check uses the player’s most trusted identifier and least variable one. A license identifier is rated trust 5 and variance 1, and a linked Steam account counts the same way, so a player with either passes any setting. The ip identifier is rated trust 5 and variance 5. If your server needs steam: identifiers specifically, the FiveM Steam identifier guide covers that setup.

CnL kick options and sv_disableClientReplays

Under Server owner options, Secure Your Events lists settings linked to the Adhesive team, which “is always working really hard to prevent cheaters”. The page warns they “shouldn’t be touched unless you know what you are doing”, and says most are “enabled by default with FXServer 8450 build version and higher”.

OptionWhat the docs say
sv_kick_players_cnl_timeout_secThe timeout after which a player with no CnL connection is kicked; 600 means 10 minutes
sv_kick_players_cnl_update_rate_secHow often CnL is queried with the player list
sv_kick_players_cnl_consecutive_failuresHow many times in a row a player must be over the timeout before a kick; the default is 2
sv_pure_verify_client_settingsVerifies settings such as the pure level and script hook through adhesive and svadhesive, replacing the client’s periodic info.json request
sv_disableClientReplaysAims “to reduce chances of cheating options”, but disables the Rockstar Editor

The page says players caught by these checks will likely be kicked with “Connection to CNL timed out.” The docs stress that a kick “doesn’t mean is automatically Global Ban”, though it gives “an indication of player reliability”.

What FiveM for GTAV Enhanced enforces by default

AreaFiveM LegacyFiveM for GTAV Enhanced
Pure modeOptional, sv_pureLevel 1 or 2Always on; no graphic mods during early access
Sync modelOneSync on, legacy or offClient-server; OneSync big mode is the only mode
Entity lockdowninactive, relaxed, strictAdds full; relaxed limits population to world grids the player owns
sv_protectServerEntitiesIn the open-source server (default false): when on, clients cannot delete entities a server script owns. Not in the server-commands reference“Not implemented. Use sv_entityLockdown instead.”
NUI callback strict modeDisabled; opt in per resourceEnabled; opt out per resource
Development modesv_devMode is listed for Enhanced onlysv_devMode limits the server to 8 clients: “Do not enable in production.”

NUI callback strict mode protects against other resources rather than cheats: it “ensures that only NUI belonging to the resource that registered a callback may invoke it”. On Legacy, a resource opts in with nui_callback_strict_mode 'true' in its manifest.

How to turn on FiveM anticheat settings without breaking your server

  1. Confirm OneSync. On Legacy with txAdmin, check that OneSync is set to On (recommended). On Legacy without txAdmin, check for set onesync on in server.cfg. On Enhanced, there is nothing to set.
  2. Set the client file checks. Add sv_scriptHookAllowed false and, on Legacy, sv_pureLevel 1. Use level 2 only if your players do not need audio or graphics mods.
  3. Turn on request filtering with warnings first. Add sv_filterRequestControl -1, which already blocks like mode 2 and also logs rejections. Restart, play normally, and watch the server console for the NetworkRequestControlOfEntity warning. Fix or exempt each entity it names until it stops; then switch to 2, which blocks the same requests without the warning. Modes 3 and 4 block more than -1 does, so a quiet console under -1 does not prove they are safe: test them on their own.
  4. Move spawning to the server, then lock down. Update resources that create vehicles, peds or objects in client code, then add sv_entityLockdown relaxed. If you try strict, check ambient traffic and parked cars afterwards, because it removes client-generated population too.
  5. Add state bag strict mode. Add setr sv_stateBagStrictMode true, then watch the F8 client console for the strict mode error while you use your resources.
  6. Decide on the event convars. Set sv_enableNetworkedSounds false only if nothing on your server plays networked sounds, and block a net game event only when nothing uses it.
  7. Fix your own events. Settings cannot validate your server events. Check every handler that changes money, items or permissions against server-side values. Admin commands belong behind permissions, as the ACE permissions guide explains, and resources from unknown sources should be checked with the backdoor guide.

Troubleshooting

Spawned vehicles or props vanish straight away after enabling sv_entityLockdown

The resource most likely creates them in client code, which the lockdown blocks. Move the spawn to a server script with CreateVehicleServerSetter or another server-side creation native, or set sv_entityLockdown inactive again while you find the resource. If ambient traffic disappeared too, check whether you set strict; relaxed lets client-generated population through.

Console warning: “tried to use NetworkRequestControlOfEntity … but it was rejected”

This warning only appears in mode -1. A resource asked for control of an entity it may not take. The reason in parentheses at the end of the first line says why, for example “Entity is controlled by a player”, “Entity is in a different routing bucket” or “Strict entity lockdown is active”. Find the script that calls NetworkRequestControlOfEntity, or exempt the entity on the server with SET_ENTITY_IGNORE_REQUEST_CONTROL_FILTER. The warning itself says "sv_filterRequestControl" "0" turns the check off.

“StateBags can’t be modified from the client, because the StateBag strict mode is enabled”

A client script tried to write a state bag while sv_stateBagStrictMode is true. Move that write to the server, or use setr sv_stateBagStrictMode false, as the message says, until the resource is updated.

Players dropped with “Reliable network event overflow.”

The client sent events faster than the netEvent limit and then the netEventFlood limit allow (defaults 50/200 and 75/300). Look for a resource that triggers server events in a tight loop. A related drop, “Reliable network event size overflow:”, is followed by the name of the event that was too large.

Players dropped with “Reliable state bag packet overflow.”

The client sent too many state bag updates (stateBagFlood) or too much state bag data (stateBagSize). The server console prints which limiter fired and how to raise it with set rateLimiter_<name>_rate. Check the resource that writes state in a loop before raising anything.

“You can not join this server due to your identifiers being insufficient”

sv_authMinTrust or sv_authMaxVariance is stricter than the player’s identifiers allow. Return them to the defaults (1 and 5), or ask the player to start Steam, as the message suggests.

Players kicked with “Connection to CNL timed out.”

The docs list this kick reason as the result of the CnL options on the Secure Your Events page, and say it is not automatically a global ban. With the default of 2, a player is kicked when they fail to check in with CnL for the timeout (10 minutes in the docs’ example) and then miss the next check-in. If you changed sv_kick_players_cnl_timeout_sec or sv_kick_players_cnl_consecutive_failures, undo the change: the page says these “shouldn’t be touched unless you know what you are doing”.

block_net_game_event has no effect

Check that sv_experimentalNetGameEventHandler has not been turned off; the commands need it on. Also check the event name against the Net Game Events list in the docs.

Next Steps

Browse FiveCrate assets

Original FiveM assets made in-house, with free updates and a multi-server license.

Browse assets →

Official documentation and repository references