JRS COREDocs
Get started

Installation

Upload JRS Core to your RedM server

Requirements#

  • A RedM server (latest artifacts) with txAdmin
  • MariaDB or MySQL (XAMPP / Laragon is fine on Windows)
  • A server key from portal.cfx.re
  • OneSync ON

txAdmin setup guide

docs.fivem.net - the official step by step guide to install txAdmin and create a server.

  1. Open txAdmin and choose Remote URL Template.
  2. Paste the raw recipe link:
text
https://raw.githubusercontent.com/NQ3Z/jrscore/main/recipe/jrscore.yaml
  1. txAdmin downloads every script, creates the database, imports the tables and items and writes server.cfg for you.
  2. Start the server.
  1. Run INSTALL.bat.
  2. Type the server folder, the MySQL details and your server key.
  3. The installer copies the scripts, creates the database, imports sql/jrscore.sql and writes server.cfg.
  4. In txAdmin set Server Data Folder to that folder and OneSync to ON.
  1. Copy the resources folder to your server data folder.
  2. Import sql/jrscore.sql into an empty database (HeidiSQL).
  3. Copy server.cfg and edit {{dbConnectionString}}, {{svLicense}}, {{maxClients}} and {{serverEndpoints}}.

Database (XAMPP, HeidiSQL or without XAMPP)#

JRS Core stores characters, items, money and everything else in a MariaDB / MySQL database. Pick one way to run it, import sql/jrscore.sql, then set the connection string.

  1. Download and install XAMPP. It includes MariaDB.
  2. Open the XAMPP Control Panel and press Start next to MySQL. Apache is not needed.
  3. Download and install HeidiSQL, the program used to manage the database.
  4. In HeidiSQL press New, set Network type to MariaDB or MySQL (TCP/IP), host 127.0.0.1, user root, port 3306, and press Open.
  5. Right click the empty left panel, Create new > Database, name it jrscore and use the collation utf8mb4_general_ci.
  6. Select jrscore, choose File > Run SQL file... and pick sql/jrscore.sql.
Warning

XAMPP starts with the user root and no password. That is fine on your own PC. On a public server create a dedicated user with a password (see the SQL below) and never open port 3306 to the internet.

  1. Install one database server: MariaDB Server (recommended) or MySQL Community Server. Write down the root password you choose.
  2. Create the database and a user. Open HeidiSQL or the command line and run:
sql
CREATE DATABASE jrscore CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'jrs'@'localhost' IDENTIFIED BY 'change_this_password';
CREATE USER 'jrs'@'127.0.0.1' IDENTIFIED BY 'change_this_password';
GRANT ALL PRIVILEGES ON jrscore.* TO 'jrs'@'localhost';
GRANT ALL PRIVILEGES ON jrscore.* TO 'jrs'@'127.0.0.1';
FLUSH PRIVILEGES;
  1. Import the tables:
bash
mariadb -u jrs -p jrscore < sql/jrscore.sql

(with MySQL the program is called mysql). Or use HeidiSQL: File > Run SQL file.... 4. Manage it with HeidiSQL or DBeaver (works on Windows, Linux and macOS).

  1. Install Laragon (the Full version has MySQL). It is a lighter alternative to XAMPP.
  2. Press Start All. MySQL listens on 127.0.0.1:3306, user root, no password.
  3. Create the database jrscore and import sql/jrscore.sql with HeidiSQL (Laragon has a Database button that opens it).
  1. Install Docker, then start a MariaDB container:
bash
docker run -d --name jrs-db --restart unless-stopped \
  -e MARIADB_ROOT_PASSWORD=change_this_password \
  -e MARIADB_DATABASE=jrscore \
  -p 127.0.0.1:3306:3306 \
  -v jrs-db:/var/lib/mysql \
  mariadb:11
  1. Import the tables (works in any shell):
bash
docker cp sql/jrscore.sql jrs-db:/jrscore.sql
docker exec jrs-db sh -c "mariadb -uroot -pchange_this_password jrscore < /jrscore.sql"

The image page: hub.docker.com/_/mariadb. The 127.0.0.1: in -p keeps the database private to the machine.

Any MariaDB or MySQL host that your game server can reach works (a managed database, or a database on another VPS).

  1. Create a database jrscore and a user for it in the provider panel.
  2. Allow the IP address of your game server only.
  3. Import sql/jrscore.sql with HeidiSQL connected to that host.
  4. Use the host name in the connection string below instead of 127.0.0.1.

Then tell the server how to connect. Put this line in server.cfg above ensure oxmysql:

cfg
set mysql_connection_string "mysql://jrs:[email protected]:3306/jrscore?charset=utf8mb4"

With XAMPP and the root user without password it is mysql://[email protected]:3306/jrscore?charset=utf8mb4. If the password has special characters (@, :, /, #) replace them with their percent code (@ = %40) or choose a simpler password.

Tip

To check the connection start the server and look for [oxmysql] Database server connection established in the console. Not there? Check that MySQL is running, the port is 3306 and the database name is exact.

Make yourself owner#

In resources/[CORE]/jrs_core/config/config.lua add your Steam hex inside Config.CoreOwners:

lua
Config.CoreOwners = {
    ['steam:110000xxxxxxxxx'] = true,
}

Or set group to owner / admin in the jrs_users table.

Load order#

cfg
ensure oxmysql
ensure jrs_core
ensure jrs_inventory
ensure jrs_character

The server.cfg in the pack already has the right order, numbered in sections. Add your own scripts in the section for their category.

Warning

Never put # comments at the end of an ensure line, and save fxmanifest.lua as UTF-8 without BOM.

Folders#

Folder Content
[CORE] jrs_core, jrs_inventory, loading screen, progress bar, chat, radial menu
[CHARACTER] character creator, clothing, barber, metabolism, animations
[ECONOMY] banking, stores, billing, mailbox, saloons, weapons
[JOBS] police, medic, mining, hunting, fishing, crafting, railroad and more
[PROPERTIES] housing, stables, doorlocks
[CRIME] outlaws, robbery, lockpick
[WORLD] city zones, teleports, guarma, canoe
[ADMIN] admin panel
[CFX] [DEPENDENCIES] default CFX resources, oxmysql, uiprompt, pma-voice, PolyZone

Updating#

Replace the resource folders, keep your config files, then restart the resource. Database changes are applied by the resource on start.

JRS Core · Free and open-source RedM framework · made by the JRS TEAM