JRS COREDocs

Troubleshooting

Real problems from JRS Core servers, matched to the console line you see, the cause and the fix

Each block starts with what you see, usually a line from the server console. Search this page for the exact text.

Boot and config#

failed to load ... unexpected symbol near '<\239>'#

Cause: the resource's fxmanifest.lua was saved as UTF-8 with a BOM. FXServer reads those three hidden bytes as code and skips the whole resource. Windows PowerShell 5.1 adds a BOM when you use Set-Content or Out-File -Encoding utf8.

Fix: save the file again as UTF-8 without BOM (VS Code: click the encoding in the status bar, Save with Encoding, UTF-8). The same applies to every .lua file.

No such command ... or Argument count mismatch with a word from a comment#

Cause: FXServer splits each server.cfg line on ; before it looks at #. Text after a semicolon, even inside a comment, runs as a new command. A comment written after set can even change a convar.

Fix: never use ; in a cfg file. Keep ensure lines to the resource name alone and put notes on their own line above it.

Unable to establish a connection to the database (ECONNREFUSED)#

Cause: mysql_connection_string is not set, so oxmysql falls back to root on localhost with no password. Other codes such as ER_ACCESS_DENIED_ERROR mean the user, password or database name is wrong.

Fix: set the convar in server.cfg before ensure oxmysql, as shown in the database part of Install.

Inventory#

The item shows an empty square#

Fix: add jrs_inventory/html/images/items/<item>.png, where <item> is the value of the item column. The file may contain WebP data as long as the name ends in .png: the in-game browser reads the content, not the extension. Most bundled icons are stored that way to keep the first download small.

Arabic item names show as ????#

Cause: the rows were written by a database client that was not using utf8mb4, so every Arabic letter was saved as a real ? byte. The text is lost in the table itself, so changing fonts or the NUI will not bring it back. An empty label_ar is fine: it falls back to the English label.

Fix: find the rows with SELECT item FROM jrs_items WHERE label_ar LIKE '%?%', write label_ar and descriptions_ar again over a utf8mb4 connection (for the MariaDB/MySQL command line: --default-character-set=utf8mb4), then run /reloaditems.

A new row in jrs_items does not show in game#

Cause: jrs_inventory reads item definitions once at start.

Fix: run /reloaditems from the server console or as an admin. It reloads jrs_items without a restart.

Players#

A player sees menus in the wrong language#

Cause: the language belongs to the player, not the server. It is chosen on the character screen, saved on the account and shared through the jrsLanguage state bag, so every script reads the same value.

Fix: staff can change it with /setlang <id> en|ar. An admin can switch their own with /language en|ar. In your own scripts read it with JrsLang.Of(source) instead of a config value.

Players fall under the map after fast travel or when joining#

Cause: the player was shown before the ground around them had streamed in.

Fix: use jrs_core 2.6.0 or newer, which ships client/ground_guard.lua: it holds the player until real ground is under them and rescues anyone falling through the world. For your own teleports call exports.jrs_core:EnsureSafeGround(x, y, z, timeoutMs, ped) instead of setting the coordinates directly.

Owner commands do nothing for the server owner#

Fix: add the owner's identifier to Config.CoreOwners in jrs_core/config/config.lua (steam:, license: or discord:). That identifier always gets the owner group, written back to the database on connect. Groups that may use admin commands are listed in Config.AdminGroups.

Usable items#

Food or a drink does nothing when used#

What you see: the item has no Use option, or using it plays nothing and the bars do not move.

Cause: an item only becomes usable when jrs_metabolism finds a key with its exact name under Items.RegisteredUsableItems in jrs_metabolism/config/usables.cfg.lua. Items are registered with the inventory once, when the resource starts.

Fix: add an entry keyed by the value of the item column, then restart jrs_metabolism:

lua
['canned_beans'] = {
    Label  = "Canned Beans",
    Action = { Animation = "EAT", Object = "s_canbeans01x" },   -- animation + prop in the hand
    CloseInventory = true,
    RemoveOnUse    = true,
    Metabolism = {
        Hunger = { Type = "add", Value = 30 },
        Thirst = { Type = "remove", Value = 5 },
    },
    NotifyOnUse = "You ate the beans.",
},

Type is add or remove. Leave out any stat you do not want to touch.

Note

Not listed here? Copy the first red line from the console and search this site for it. Most errors name the resource that failed.