RSG Framework
Getting Started

Misc Guides

Extra guides, tools, and templates for RSG Framework servers.

A collection of extra guides and useful snippets for running an RSG server.

Getting the players

To get a list of players on the server you can use a native:

for _, player in ipairs(GetActivePlayers()) do
    local ped = GetPlayerPed(player)
    -- do stuff
end

Or the RSG function:

for _, player in pairs(RSGCore.Functions.GetPlayers()) do
    local ped = GetPlayerPed(player)
    -- do stuff
end

Database connection

txAdmin configures this automatically. If you need to set it up manually, add the following to your server.cfg. RSG uses oxmysql as its database wrapper.

  • Download the latest oxmysql build (not the source code) and extract it to your resources folder.
  • Start the resource near the top of your server.cfg. If you have a lot of streamed assets, load them first to prevent timing out the connection.

You can add convars to tune the connection and enable extra debugging:

set mysql_slow_query_warning 150
set mysql_debug true

server.cfg template

txAdmin generates a server.cfg for you during the recipe install. For a manual install, use this template as a starting point:

## server main settings
{{serverEndpoints}}
sv_maxclients {{maxClients}}
set gamename rdr3
set sv_enforceGameBuild 1491

# locale config
setr rsg_locale "en"
setr ox:locale en

## key license settings
sv_licenseKey "{{svLicense}}"
set steam_webApiKey "none"

## database settings
set mysql_connection_string "{{dbConnectionString}}"
set mysql_slow_query_warning 300

## server settings
sv_hostname "{{serverName}} built with {{recipeName}} by {{recipeAuthor}}!"
sets sv_projectName "[{{recipeName}}] {{serverName}}"
sets sv_projectDesc "{{recipeDescription}}"
sets locale "en-US"
load_server_icon myLogo.png
sets Framework "RSG"
sets tags "rsg,roleplay"
sv_endpointprivacy true

set txAdmin-menuPtfxDisable true # Disable TXAdmin NoClip Particle Effect
set sv_experimentalNetGameEventHandler false

# use target
setr UseTarget false

# default resources
ensure mapmanager
ensure spawnmanager
ensure sessionmanager-rdr3

# database and library
ensure oxmysql
ensure ox_lib

# resources
ensure rsg-core
ensure rsg-multicharacter
ensure rsg-spawn
ensure rsg-menubase
ensure ox_target
ensure ip-chat
ensure [standalone]
ensure [framework]
ensure [mapmods]

## Permissions ##
add_ace group.admin command allow # allow all commands
add_principal identifier.license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx rsgcore.god
add_principal identifier.license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx group.admin

# Resources
add_ace resource.rsg-core command allow

# Gods
add_ace rsgcore.god command allow

# Inheritance
add_principal rsgcore.god group.admin
add_principal rsgcore.god rsgcore.admin
add_principal rsgcore.admin rsgcore.mod

Find additional information on server configuration files in the FiveM server manual.

Contributing via GitHub

The RSG source lives at Rexshack-RedM. To propose a change:

  1. Open the resource and navigate to the file you want to edit.
  2. Click the pencil icon to edit the code.
  3. Scroll to Propose Changes, add a title and short description, and press Propose Changes.
  4. Review the diff, then press Create Pull Request.
  5. Fill in the title/description if needed and click Create Pull Request — done!

If you have email notifications enabled, you'll receive any updates on your pull request by email.

On this page