Documentation

Setting up our scripts, and what we have checked about RedM itself.

Script

Pledii Pets

View script

Installation

Pets 2.2.0 and newer is one resource. pledii_lib is no longer required. When updating from an older version, copy any customized framework, notification and audit settings from Lib into Config.Framework, Config.Notify and Config.Audit in Pets' config.lua. Remove ensure pledii_lib and its folder only if no other installed resource needs it. Keep your existing Pets database tables and data; no manual database migration is needed.

  1. Drop this folder into your resources. Keep the folder name pledii_pets: the escrow licence is bound to it. Upload over FTP in Binary transfer mode, or the encrypted files arrive corrupted.

  2. Add the three items (pet_food, pet_sponge, pet_tonic). VORP and RSG keep items in different places:

    • VORP — run installation/items_vorp.sql on your server's database (HeidiSQL: open the database, File → Load SQL file, then Execute).
    • RSG — open installation/items_rsg.lua and paste its three entries into rsg-core/shared/items.lua, under RSGShared.Items. Restart rsg-core.

    Item images are not included. Use art you already have, or drop your own pet_food.png, pet_sponge.png and pet_tonic.png into your inventory's item image folder.

  3. Start it after your framework and oxmysql:

    ensure pledii_pets
    

    The two database tables create themselves on the first start. (installation/install.sql holds the same definitions if you prefer to create them by hand; it is safe to run twice.)

  4. Give yourself the permission, in server.cfg. It covers /petmanager, /petxp and /petadmin:

    add_ace group.admin pledii_pets.manager allow
    add_principal identifier.license:xxxxx group.admin   # you, if you are not in group.admin yet
    
  5. Check the console on first start. Pets prints one line saying which framework it found and what it is selling:

    [pledii_pets] Pledii Pets v2.2.0 | framework: vorp | selling: pets for cash | config OK
    

    If anything in your config is wrong it prints a numbered list instead. Fix those before you go further — they are all things that would otherwise fail silently in front of a player.

  6. Open config.lua and set the shop coordinates for your map. The two that ship are Saint Denis and Blackwater. Stand where you want a vendor and run /petadmin coords: it prints the numbers in F8 and copies them to your clipboard, ready to paste.

  7. Give yourself a pet to try it: /petmanager → Give a pet → pick yourself and a breed → Give. Then /mypets → Call.

Requirements & Notes

Required

Framework VORP or RSG
Database oxmysql
Server artifact 7290 or newer
OneSync on

The artifact and OneSync requirements are declared in the manifest, so the resource refuses to start rather than half-work on a build that is too old.

Optional

  • ox_lib — used for notifications if it is running. Without it the framework's own notify is used. Neither is required; Config.Notify chooses between them.
  • A keybind resource — Config.PetInteraction.rebind lets players rebind the pet key through a keybind script you already run. Off unless configured.
  • ricx_farmanimals — if you run it, dogs register as herding dogs and graze nearby farm animals automatically. Configurable in Config.PetShepherd, and skipped entirely when the resource is not present.
  • An admin/logging resource — Config.Audit can hand purchase, rename, summon and death events to any resource you name, through export names you configure. Off by default.

Important

Two features ship switched off. They change the feel of the script a lot, so they are opt-in rather than something you discover after install:

  • Config.PetMetabolism.enabled = false — the survival loop. Turn it on and animals get hungry and dirty, catch diseases and can die of neglect. Turn it on before players get attached to anything.
  • Config.PetFetch.enabled = false — foraging. The loot tables reference item names from a specific server; check every entry against your own items table before enabling it, or pets will come back with items you do not have.

The loot and supply item names are a starting point, not a guarantee. Item ids differ between servers. pet_food, pet_sponge and pet_tonic are created by the install files, but everything in the fetch tables assumes item names your database may not use.

Nine languages, all complete: English, Georgian, Arabic, German, Spanish, Italian, Portuguese, Russian and Turkish. Set Config.Locale. The files are unencrypted, so wording can be changed and new languages added.

One shop breed needs an external download to look right. The MP Foxhound row is the multiplayer foxhound model the base game already has. A free community retexture turns it into a German Shepherd — see docs/GERMAN_SHEPHERD.md for the link and the caveats. Nothing is bundled and nothing breaks without it.

No game files are streamed. This resource ships no models, no textures and no audio taken from RDR2. Everything in web/ was generated by the scripts in tools/, and the three typefaces are SIL Open Font License 1.1 with their licence texts in licenses/. If you redistribute the resource, those licence files must travel with it.

What stays editable under escrow

Escrow only encrypts Lua. These files ship readable so the script stays yours to adapt:

  • config.lua — the whole config
  • open/server.lua, open/client.lua — every call into VORP / RSG
  • locales/*.lua — every string
  • game/server/Validate.lua — the startup check
  • installation/* — the SQL and the RSG item snippet

Everything under web/, tools/, docs/ and licenses/ is not Lua and is readable regardless.

Commands

Command Who What
/mypets everyone the owned-animals list — summon, rename, inspect
/petmenu everyone the control radial, without walking up to the animal
/petmanager ace pledii_pets.manager live shop editor and hand a pet to a player
/petxp 500 · /petxp level 10 ace pledii_pets.manager add or take away XP, or set the level, of the pet you have out; add a player id for someone else's
/petadmin coords ace pledii_pets.manager print and copy coordinates for placing a vendor
/petadmin debug on ace pledii_pets.manager debug output in the console and your F8, no restart
/petadmin diag ace pledii_pets.manager your identity and your database rows, for support

All of them can be renamed or disabled in Config.Commands — set one to '' and it is not registered at all. petControl there gives /petmenu a second name; it is off by default. Players only see the commands they may use in their chat suggestions.

Script

Pledii Poker

View script

Installation

Keep the folder named exactly pledii_poker, and leave every file as delivered: escrow entitlement is bound to the resource name and its .fxap file (the Cfx portal adds it to your download; no .fxap = download again from Granted Assets).

You only ever edit shared/config.lua, open/ and locales/. tools/ (optional card-art generator), debug/ (where /pokermanager writes table dumps) and licenses/ can be ignored; the server never loads them.

  1. Link your server to the Cfx portal account that bought it. Protected resources authenticate against the account that owns the asset; a server key from another account cannot start it. Check: the sv_licenseKey in your server.cfg is listed under Cfx Portal -> Server Keys of the buying account. Download from Cfx Portal -> Granted Assets.
  2. Upload in Binary transfer mode. FTP clients set to ASCII silently corrupt .fxap files, and the result looks like a broken script.
  3. Extract it so the manifest sits directly in the folder:
    resources/pledii_poker/fxmanifest.lua
    
    Not pledii_poker/pledii_poker/.
  4. Start it after your framework, where your other ensure lines are (server.cfg, or resources.cfg on txAdmin recipes). Do not rely on a parent ensure [folder]: it makes the order unpredictable.
    ensure oxmysql
    # vorp_core or rsg-core
    ensure vorp_core
    ensure pledii_poker
    
  5. Give your admins the manager in server.cfg:
    add_ace group.admin pledii_poker.manager allow
    
    txAdmin recipes already put the server owner in group.admin, so this one line is enough for you. Another admin needs add_principal identifier.fivem:NNNN group.admin (their identifiers are in txAdmin's player list). Admins come from your framework's group column instead? Use the ready lines in OpenServer.IsManager (open/server.lua).
  6. Restart the server and check. No SQL to import and no items to add: the database tables are created on first start. The console shows [pledii_poker] framework: vorp (or rsg) and no red [pledii_poker] line. In game, walk up to the poker table in the Valentine, Blackwater or Saint Denis saloon (or the one placed in the Rhodes saloon on first start): [E] Play opens the buy-in window. As an admin, /pokermanager lists every table.

Controls

Where Key Does
At a table E Play: opens the buy-in window
F Watch a running game
Seated, your turn E Check / Call
F Fold
R Raise: then R more, C less, G Min / Half Pot / Pot / All In, E confirm, F cancel
Z All in (your stack, or the call when it already takes it all)
G Look at your cards
Seated, not your turn U Add chips
J Settings
Seated B Leave the table (press twice while you hold cards in a live hand: that forfeits your bets)
Watching E / B Play / Stop watching

The keys can be changed in Config.Keys. Every input is a native prompt, bottom right. The HUD never takes the mouse; only the buy-in window and the settings panel do (Enter / Esc, arrows or A / D for the amount).

Commands

Command Who Does
/pokermanager managers (OpenServer.IsManager; default the pledii_poker.manager ace) the table manager
/pokersettings everyone the player's own sound / effects / screen settings

Rename or turn off either in Config.Commands ('' = off).

Requirements & Notes

Required

  • RedM server artifact 7290 or newer, with OneSync on
  • VORP (vorp_core) or RSG (rsg-core)
  • oxmysql: four tables, pledii_poker_tables, pledii_poker_chips, pledii_poker_owed and pledii_poker_hands, created on first start
  • A server key linked to the Cfx account that owns the asset

Optional

  • vorp_lib: when it runs, /pokermanager places tables with its gizmo. Without it a built-in placement is used: look where the table should stand, the mouse wheel turns it, Enter places it, Backspace cancels.

Important

  • Tables are six-seat only: RDR2's deal clips exist for six seats, so a table can be set to fewer seats but never more.
  • Rockstar's female poker clips are broken in the game, so women play the male set (their hand-card offsets stay their own). A female character's hands may sit slightly off the cards in some clips.
  • RedM's prompt font has no Georgian, Cyrillic or CJK letters: prompt labels stay English in every language, and a table name typed in such letters shows as "Poker" on the prompt. The HUD and windows are fully translated. For Georgian notifications use ox_lib or another web notifier (OpenServer.Notify).
  • The rake is taken out of the game. Nobody receives it unless your server listens to pledii_poker:rake.
  • Managers see every player's hole cards in the /pokermanager live view (not at a table they sit at themselves). Give the manager only to staff you trust with that.
  • A player who leaves, or is kicked by an admin, mid-hand forfeits what they already bet, as at a real table. If the hand is then called off, their bet is refunded to them (on their next login if they are gone).

Database

Created and kept up to date by the script on start (no SQL file, now or in later versions; anything manual would be in CHANGELOG.md):

Table Holds
pledii_poker_tables tables placed or changed in /pokermanager
pledii_poker_chips each seated character's stack, so a crash pays it back
pledii_poker_owed money owed to a character that was offline or switched
pledii_poker_hands one row per finished hand: table, hand number, stake, board, each player's bet, winners and their hand name (no hole cards); kept Config.HandHistoryDays (30)

Seated players who die

A seated player who dies or is downed is stood up automatically and cashed out (a hand in progress is forfeited, as when leaving). For jail, cuffs or a teleport, call exports.pledii_poker:StandUp(src) from that script.

What stays editable under escrow

shared/config.lua, open/server.lua, open/client.lua and locales/ are readable and editable. The interface in ui/ is plain files, and the card decks are drawn by tools/generate_cards.py (change colours there and run it again; needs Python 3 and pip install pillow fonttools brotli). The hand engine, NPC play, animations, table geometry and the money safety are encrypted.

Troubleshooting

The resource does not start / "Couldn't start resource pledii_poker". Read the line above it in the console. dependency ... oxmysql means oxmysql is missing or starts later; /server:7290 means your artifact is too old; /onesync means OneSync is off (set onesync on).

"You lack the required entitlement" / "Failed to verify protected resource". The server key belongs to a different Cfx account than the one that bought the script, or the files were uploaded in ASCII mode. Link the key to the buying account, download again from Granted Assets and upload in Binary mode.

A red [pledii_poker] database error on start. oxmysql cannot reach the database or the user may not CREATE TABLE / ALTER TABLE. Check mysql_connection_string and the user's rights; the four tables are created by the script.

/pokermanager says you do not have permission. Add add_ace group.admin pledii_poker.manager allow and make sure your identifier is in group.admin, for example add_principal identifier.license:xxxxx group.admin. Test it in the server console: test_ace identifier.license:xxxxx pledii_poker.manager. Using your framework's admin group instead? Change OpenServer.IsManager in open/server.lua.

[E] Play does nothing / "You need $80 in cash to play at this table." The table's stake needs at least its minimum buy-in in cash. Lower minBuyIn in Config.Stakes, or give the table a lower stake in the manager. On RSG the cash account is cash (Config.Currency); a renamed account is mapped in open/server.lua (RSG_ACCOUNT).

No prompt at any table, for anyone. The prompts wait until the character counts as loaded: VORP's IsInSession or RSG's isLoggedIn state. A forked core or custom multicharacter may set neither; return your own check in OpenClient.IsPlayerLoaded (open/client.lua).

"You need $X in cash" although the player has cash / everyone has $0. Look for [pledii_poker] framework: in the server console. none means the core was not found: a renamed core resource goes in VORP_CORE / RSG_CORE in open/server.lua. Also check Config.Currency is one your framework has.

No prompt at a map table. The table may be switched off, or removed, in /pokermanager (removed map tables are listed at the bottom of the list, with Restore). The Tumbleweed saloon has no table in the map, so it ships switched off.

NPCs never sit down. Tick NPC players for the table in the manager, and check Config.EnableNPC. NPCs also stop joining for the rest of the hour once they have lost Config.NpcLossCapPerHour to players.

A player's money did not come back after a crash. Check pledii_poker_owed for that character. Rows with status = 'pending' are retried at character load or resource start. A paying row means the framework result is uncertain: check the framework money log using the payout id printed in the console. Only after confirming it was not credited, change that row back to pending; if it was credited, mark that exact receipt paid. Never reset all held rows or pay them again without checking. Keep paid receipts: their refund identifiers prevent delayed retries from creating a second payment.

The framework wallet and Poker's database are separate persistence systems. A full server crash can interrupt a buy-in before its stack is saved, or lose a framework balance change that the core had not persisted. Database outages can also prevent the latest hand snapshot from saving. Keep framework money logs/backups; this resource cannot promise loss-free recovery at every boundary. Custom money adapters must finish synchronously, credit only ctx.charId, return true only for a completed credit and false only when untouched. Log ctx.payoutId for reconciliation; do not defer the change to a callback.

Text shows as boxes in notifications. RedM's native notifications have no glyphs for your language. Run ox_lib, or point OpenServer.Notify / OpenClient.Notify at a web-based notifier.

The HUD shows key names like ui.pot. The interface did not receive its strings: restart the resource and look for a locale file error in F8. Every Config.Locale must match a file in locales/.

Script

Pledii Blackjack

View script

Installation

Keep the folder named exactly pledii_blackjack, and leave every file as delivered: escrow entitlement is bound to the resource name and its .fxap file (the Cfx portal adds it to your download; no .fxap = download again from Granted Assets).

You only ever edit shared/config.lua, open/ and locales/. tools/ (optional card-art generator), debug/ (where /bjmanager writes table dumps) and licenses/ can be ignored; the server never loads them.

  1. Link your server to the Cfx portal account that bought it. Check: the sv_licenseKey in your server.cfg is listed under Cfx Portal -> Server Keys of the buying account. Download from Cfx Portal -> Granted Assets.
  2. Upload in Binary transfer mode. FTP clients set to ASCII silently corrupt .fxap files.
  3. Extract it so the manifest sits directly in the folder: resources/pledii_blackjack/fxmanifest.lua (not pledii_blackjack/pledii_blackjack/).
  4. Start it after your framework: add ensure pledii_blackjack below the line that starts your framework (in server.cfg, or resources.cfg on txAdmin recipes; often a folder line such as ensure [vorp_essentials]):
    ensure oxmysql
    # ... the line that starts vorp_core or rsg-core ...
    ensure pledii_blackjack
    
  5. Give your admins the manager in server.cfg:
    add_ace group.admin pledii_blackjack.manager allow
    
    txAdmin recipes already put the server owner in group.admin. Admins come from your framework's group column instead? Use the ready lines in OpenServer.IsManager (open/server.lua).
  6. Restart the server and check. No SQL to import and no items to add: the database tables are created on first start. The console shows [pledii_blackjack] framework: vorp (or rsg) and no red line. In game, walk up to the blackjack table in the Rhodes, Blackwater or Van Horn saloon: [E] Play Blackjack sits you down. As an admin, /bjmanager lists every table.

Controls

Where Key Does
At a table E Play Blackjack: sits you at the nearest free chair
Betting R / C More / Less
E Bet
Your turn E Hit
F Stand
R Double
G Split (a pair)
Not your turn J Settings
Seated B Leave the table (press twice with cards in play: that forfeits the bet)

The keys can be changed in Config.Keys. Every input is a native prompt, bottom right; at the table the HUD never takes the mouse (only the settings panel and /bjmanager do).

Commands

Command Who Does
/bjmanager managers (OpenServer.IsManager; default the pledii_blackjack.manager ace) the table manager
/bjsettings everyone the player's own sound / effects / screen settings

Rename or turn off either in Config.Commands ('' = off).

Requirements & Notes

Required

  • RedM server artifact 7290 or newer, with OneSync on
  • VORP (vorp_core) or RSG (rsg-core)
  • oxmysql: three tables (pledii_blackjack_tables, pledii_blackjack_open, pledii_blackjack_owed), created on first start
  • A server key linked to the Cfx account that owns the asset

Optional

  • vorp_lib: when it runs, /bjmanager places tables with its gizmo. Without it a built-in placement is used: look where the table should stand, the mouse wheel turns it, Enter places it, Backspace cancels.

Important

  • Tables seat four: RDR2's dealer clips exist for four seats.
  • No insurance and no surrender; a pair splits once (split aces get one card each). The same rules at every table.
  • A player who leaves mid-hand forfeits the bet; one who disconnects keeps the hand (it stands) and is paid on their next login.
  • Config.HouseEdge above 0 makes the game less fair than real blackjack, and players are not told. It is your server's choice.
  • RedM's prompt font has no Georgian, Cyrillic or CJK letters: prompt labels stay in Latin letters in every language. The HUD's fonts cover Latin and Georgian; other scripts fall back to the system font.
  • Amounts always show $, also on a gold currency.

Database

Created and kept up to date by the script on start (no SQL file):

Table Holds
pledii_blackjack_tables tables placed or changed in /bjmanager
pledii_blackjack_open each character's bet in the hand being played, so a crash pays it back
pledii_blackjack_owed every payout, pending until handed over, then kept as a paid receipt

Seated players who die

A seated player who dies or is downed leaves the table automatically (a hand in progress is forfeited). For jail, cuffs or a teleport, call exports.pledii_blackjack:StandUp(src) from that script.

What stays editable under escrow

shared/config.lua, open/server.lua, open/client.lua and locales/ are readable and editable. The interface in ui/ is plain files, and the card decks are drawn by tools/generate_cards.py (needs Python 3 and pip install pillow fonttools brotli). The game, the dealer, animations, table geometry and the money safety are encrypted.

Troubleshooting

The resource does not start / "Couldn't start resource pledii_blackjack". Read the line above it in the console. dependency ... oxmysql means oxmysql is missing or starts later; /server:7290 means your artifact is too old; /onesync means OneSync is off (set onesync on).

"You lack the required entitlement" / "Failed to verify protected resource". The server key belongs to a different Cfx account than the one that bought the script, or the files were uploaded in ASCII mode.

A red [pledii_blackjack] database error on start. oxmysql cannot reach the database or the user may not CREATE TABLE. Check mysql_connection_string and the user's rights.

/bjmanager says you do not have permission. Add add_ace group.admin pledii_blackjack.manager allow and make sure your identifier is in group.admin. txAdmin recipes add the owner as identifier.fivem:<your id> (the add_principal line in server.cfg); test it in the server console: test_ace identifier.fivem:<your id> pledii_blackjack.manager. Admins come from VORP's or RSG's admin group instead? Use the ready lines in OpenServer.IsManager (open/server.lua).

/bjmanager or /bjsettings is an unknown command. Check the names in Config.Commands ('' turns a command off) and restart the resource.

The prompt shows, but E does nothing. Another script uses the same key (seating, inventory, emote menus). Pick another control in Config.Keys.play and restart.

A player gets "You cannot sit at this table." That is OpenServer.CanJoin refusing them; check your rule there.

No table or dealer in the Rhodes, Blackwater or Van Horn saloon. A saloon MLO or interior replacement can remove the map's table. Switch that table off in Config.MapTables (or delete it in /bjmanager) and place your own with /bjmanager.

No prompt at any table, for anyone. The prompts wait until the character counts as loaded: VORP's IsInSession or RSG's isLoggedIn state. A forked core may set neither; return your own check in OpenClient.IsPlayerLoaded (open/client.lua).

"The minimum bet here is $X" although the player has cash / everyone has $0. Look for [pledii_blackjack] framework: in the server console. none means the core was not found: a renamed core resource goes in VORP_CORE / RSG_CORE in open/server.lua. Also check Config.Currency.

"The house has reached its loss limit for this hour." The house has lost Config.HouseLossCapPerHour in this clock hour (winnings paid minus bets kept, every table together; bets it won earlier in the hour don't count below zero). Bets reopen at the next full hour; raise the limit or set it to 0 for none.

A player's money did not come back after a crash. Check pledii_blackjack_owed for that character. pending rows are paid at character load or resource start. A paying row means the framework result is uncertain: check the framework money log with the payout id printed in the console, then set that row to pending (not credited) or paid (credited). Never reset held rows without checking.

The HUD shows key names like ui.dealer. The interface did not receive its strings: restart the resource and look for a locale file error in F8. Config.Locale must match a file in locales/.

RedM guide

Pool sizes

What a pool is

RedM keeps a fixed-size table, a pool, for each kind of thing the game creates: objects, props, textures, doors, network events and many more. When a pool is full, nothing more of that kind can be created, and the game often crashes. Large mappings and many scripts running together are the usual cause.

The crash names the pool when it can. Pool names are stored as hashes inside the game, so the message often shows a hash or no name at all:

Game crashed: <<unknown pool>> Pool Full, Size == 2500
Error: 0x6db663ab Pool Full, Size == 400
CExplosionAttr Pool Full, Size == 135

Size == is the pool's size at the moment it overflowed.

Raising a pool

Pools are raised from server.cfg with increase_pool_size:

increase_pool_size "Object" 2000
increase_pool_size "DrawableStore" 50000
  • The number is how much to add, not the new size.
  • Startup only. It cannot be changed while the server runs.
  • Players restart once. A client joining a server with different pool sizes from its last session restarts the game first, the same way a changed sv_enforceGameBuild works. With the same sizes, that only happens on the first connection.

Which pools may be raised, and by how much, is decided by Cfx. The server downloads that list when it starts and checks every increase_pool_size line against it:

  • A pool that is not on the list, or an increase above its limit, is not applied at all (not lowered to the limit). The console prints Requested pool size increase is invalid: followed by the reason.
  • If the server cannot download the list, no pool change is applied.
  • A client will not connect to a server that asks for invalid sizes.

Pools a RedM server can raise

This is the list the RedM server checks against, as Cfx served it on 26 September 2026. The numbers are the largest increase allowed.

Pool Max increase
AttachmentExtension 430
CAnimalGroupMember 110
CAudioCollisionExtensionComponent 1000
CAvoidanceComponent 1300
CCrimeObserver 150
CDoorExtension 160
CDoorSyncData 20
CLightEntity 2000
CMoveObject 100
CNetObjDoor 20
CNetObjObject 100
CNetObjPedBase 110
CNetObjVehicle 40
CPedAvoidanceComponent 256
CPedSyncData 50
CPropSetObjectExtension 950
CompEntity 50
DrawableStore 50000
FragmentStore 4000
GrassBatch 2000
InteriorProxy 450
NavMeshRoute 200
Object 2000
OcclusionInteriorInfo 10
OcclusionPathNode 1500
OcclusionPortalEntity 140
OcclusionPortalInfo 140
PortalInst 150
ScaleformStore 100
StaticBounds 6500
TxdStore 26000
fwDynamicArchetypeComponent 1200
netGameEvent 400

Note Cfx's documentation page shows only 23 of these for RedM and says itself that it may be behind. The list above is what the server actually enforces, and it changes over time: the live copy is at https://gss.cfx-services.net/v1/public/pool-size-limits/redm.

Pools that cannot be raised

A pool that is not on that list keeps its default on a normal server. One that servers do run into is CScenarioInfo, the scenario pool, which is 2605 in the gameconfig.xml every RedM client ships with.

Warning The moo 31337 setting skips the validation, but Cfx documents it for development only, it has to be set on the server and on each client, and Cfx says never to use it in production.

Seeing how full the pools are

In game: F8 → Tools → Streaming → Pool Monitor shows most pools with their sizes.

Sources

  • Cfx.re docs, server commands, increase_pool_size: https://docs.fivem.net/docs/server-manual/server-commands/
  • FXServer source: code/components/citizen-server-impl/src/InitConnectMethod.cpp and code/components/pool-sizes-state/src/PoolSizesState.cpp in https://github.com/citizenfx/fivem
  • RedM client pool defaults: data/client_rdr/citizen/common/data/gameconfig.xml in the same repository
  • Crash messages as reported by server owners in the Cfx.re Discord (2021–2026)
RedM guide

Server settings that exist

Why this page

Optimisation guides for FiveM and RedM servers are full of settings that the server does not have. It accepts them without complaint and they do nothing. Everything below is checked against Cfx.re's own server-commands reference.

Settings that do nothing

None of these appear in Cfx's server-commands reference, yet they circulate in hosting blogs and forum guides:

sv_priority1 · sv_priority2 · sv_minupdaterate · sv_maxupdaterate · sv_maxPacketSize · sv_fpsLimit · sv_prioritizeNetThread · sv_timeout · onesync_enabled · onesync_maxPlayers · onesync_distanceCull · sv_streamingMemoryLimit · sv_resourceMonitor · sv_assetCacheEnabled · sv_maxMemoryUsagePercent

The real names behind some of them:

Written in guides Real setting
onesync_enabled onesync on
onesync_maxPlayers sv_maxClients
onesync_distanceCull onesync_distanceCulling

Three settings that do exist are listed by Cfx as no longer doing anything: onesync_enableBeyond, sv_enhancedHostSupport and sv_protectServerEntities (use sv_entityLockdown instead).

OneSync and entity settings

As documented by Cfx, with their defaults:

Setting Default What it does
onesync – on for full server-side state. legacy is "not recommended due to performance issues and graphical glitches".
onesync_enableInfinity true Large-scale entity sync, needed for large player counts. Startup only.
onesync_population true Population spawning. Needed for NPCs to spawn.
onesync_forceMigration true Moves entities to a new owner when the old one leaves. Turning it off may help performance but can leave entities without an owner.
onesync_distanceCulling true Stops syncing entities that are far away and out of view.
onesync_distanceCullVehicles false The same for vehicles.
onesync_radiusFrequency true Closer entities update more often. Off may help performance, at the cost of distant entities' accuracy.
sv_useAccurateSends true Sends updates by relevance and distance. Off may help performance but reduces accuracy.
sv_entityLockdown inactive strict stops clients creating any entities; relaxed blocks only script-created ones. (full is GTA V only.)

Player limit

sv_maxClients takes 1 to 2048. From 32 it needs onesync set to on or legacy; above 64 it needs onesync on.

Game build

The RedM build table in Cfx's docs has one entry: 1491, the September 2022 update. A sv_enforceGameBuild with another number for RedM, such as the 1436 seen in some example configs, is out of date.

A note on Cfx's own docs

The bottom part of Cfx's server-commands page is headed "Console commands exclusive to FiveM for GTAV Enhanced". The rate limiters (rateLimiter_*), sv_devMode, onesync_mapCellAreaSize and sv_ioThreads are documented there. Treat their documented defaults as GTA V values unless you have checked them on your RedM server.

Sources

  • Cfx.re docs, server commands: https://docs.fivem.net/docs/server-manual/server-commands/
RedM guide

OneSync: players, culling and buckets

Player count

With OneSync, a server can take up to 2048 players (sv_maxClients). Entity IDs go up to 65535 instead of 8192.

Culling: what a client can see

A client only creates entities, players included, inside a zone of 424 units around the player. Anything further away does not exist on that client.

What that means for scripts:

  • A loop over players on the client only sees players nearby. Anything that has to cover every player, such as a player list or a map of everyone, must run on the server.
  • When an entity leaves the range of the player who owns it, the server moves it to another owner or none.

Warning Natives exist to change the radius, SET_ENTITY_DISTANCE_CULLING_RADIUS and SET_PLAYER_CULLING_RADIUS, but Cfx's docs mark them as deprecated, with known, unfixable issues.

Tracking who is near whom

The server events playerEnteredScope and playerLeftScope report players entering and leaving each other's range. Cfx's docs discourage them: each one fires once per player already in range, so 32 players close together means 32 calls every time someone moves in or out. The docs point to state bags instead.

Routing buckets

A routing bucket is a separate copy of the world. Players and entities only see others in the same bucket, and each bucket can have its own rules:

  • Entity lockdown, e.g. strict so clients in it cannot create entities
  • Population on or off

Cfx's docs say plainly that buckets are not for interiors. Interiors should use the conceal natives.

Sources

  • Cfx.re docs, OneSync: https://docs.fivem.net/docs/scripting-reference/onesync/
  • Cfx.re docs, server commands (sv_maxClients): https://docs.fivem.net/docs/server-manual/server-commands/
RedM guide

Finding lag with the profiler

The profiler

FXServer and the RedM client both have a built-in profiler. It records what every resource did frame by frame, which is the only way to see which script is actually costing time. It works the same in the server console and in F8.

Command What it does
profiler record 500 record the next 500 frames (frames, not seconds)
profiler record start record until you stop it
profiler record stop stop recording
profiler status whether it is recording, and how far along
profiler view open the recording (the server prints a link to open in Chrome)
profiler saveJSON <file> save the recording as a Chrome profile
profiler save <file> / profiler load <file> save or load a recording

Note There is no profiler start, although some guides use it: the console answers that it is not found.

Reading a recording

Load it in Chrome's DevTools, in the Performance tab. Look for frames that take far longer than the rest, zoom into one, and the resource ticks inside it show which resource and which script ate the time.

A recording only shows what happened while it ran. Start it before the lag, keep it running through it, and record at a busy time: a script that loops over every player costs more the more players there are.

resmon

resmon 1 in F8 shows each resource's CPU time per frame on your client. stop a resource and start it again to see what it adds on its own.

Sources

  • FXServer source, profiler commands: code/components/citizen-scripting-core/src/Profiler.cpp in https://github.com/citizenfx/fivem
  • Cfx.re forum, "How to use the profiler command to identify problematic scripts": https://forum.cfx.re/t/809058