RSG Framework gives a Red Dead roleplay server its foundations: players, money, jobs, inventory, banking, targeting and security, all working together from the first boot.
Get the core once, then read everything about a player from one object.
local RSGCore = exports['rsg-core']:GetCoreObject()
local Player = RSGCore.Functions.GetPlayer(src)
if not Player then return endlocal data = Player.PlayerData
-- data.citizenid, data.charinfo, data.job,-- data.gang, data.money, data.metadata ...print(data.charinfo.firstname, data.job.label)
Four money types. Failed payments return false, so you never hand out goods for free.
-- cash, gold, bank, bloodmoneyif Player.Functions.RemoveMoney('cash', 12, 'general-store') then
exports['rsg-inventory']:AddItem(src, 'bread', 1)
else
RSGCore.Functions.Notify(src, 'Not enough cash', 'error')
end
Players can hold several jobs and switch between them. Built into the core.
local ok, reason = RSGCore.Functions.AddPlayerJob(src, 'sheriff', 1)
if not ok then-- invalid_job, invalid_grade, max_jobs ...endlocal held, grade = RSGCore.Functions.HasPlayerJob(src, 'sheriff')
local jobs = RSGCore.Functions.GetPlayerJobs(src)
Check the space first, then add. Notifications and logging happen for you.
if exports['rsg-inventory']:CanAddItem(src, 'resource_wood', 5) then
exports['rsg-inventory']:AddItem(
src, 'resource_wood', 5, nil, nil, 'woodcutting'
)
end-- stashes and shops use the same exports
exports['rsg-inventory']:OpenInventory(src, 'sheriff-stash', {
maxweight = 100000, slots = 50
})
Add interactions to peds, props, models and zones, limited by job, gang or item.
Ask the server a question from the client and wait for the answer.
-- server
RSGCore.Functions.CreateCallback('res:server:getThing', function(source, cb)
cb(result)
end)
-- clientlocal result = RSGCore.Functions.AwaitCallback('res:server:getThing', 5000)
Everything a roleplay server needs in the core.
The pieces most servers build first are already here and already connected, so your own scripts can focus on gameplay.
Player data and characters
One player object holds identity, money, job, gang, metadata, position and items. Look players up by source, citizen ID, license or character details, online or offline.
Health, hunger, thirst, cleanliness and stress in metadata
Reputation tracking per player
Extend the player with your own methods and fields
Money that fits the setting
Cash, gold, bank and blood money, with optional money items so cash can sit in the inventory like it would in a satchel.
cashgoldbankbloodmoney
Multi-job
Players hold several jobs and switch with /myjobs. Admins create and edit jobs in game with /jobadmin. Definitions live in the database.
Inventory
Slots and weight, stashes, drops and shops. Add items safely with space checks, and register new items at runtime.
Banking
Branch-based accounts with a home branch, loans and lockboxes, available to every script through exports.
Targeting
rsg-target gives you eye-targeting on entities, models and zones, built in the RSG resource structure.
Prompts and notifications
Press-to-interact prompts and prompt groups at world coordinates, plus a notification UI with titles, icons and positions.
Commands and permissions
Register commands with argument help and a permission level from helper up to god.
Change the world while it runs
Add, update and remove items, jobs and gangs from the server without a restart. Connected clients receive the changes straight away, so shop scripts, job tools and admin panels can manage content live.
Callbacks and events
Client-to-server and server-to-client callbacks with timeouts, and a clear set of player load, job, money and duty events.
Safer by default.
Roleplay servers get tested by players. The core closes the common holes so your scripts start from a safe place.
Clients can only write what they shouldOnly a short list of metadata, such as hunger and thirst, can be set from the client. Everything else is set on the server.
Money calls tell you if they failedRemoving money returns false when the player can't pay, and amounts must be valid numbers.
Exploit attempts have a built-in answerBan an exploiter with one call, and protect sensitive events with the core's CSRF token.
Database access is parameterisedScripts use oxmysql with placeholders, so player input never becomes SQL.
A growing set of resources.
Built on the same core and the same conventions, so they install and behave the same way.
Foundations
rsg-core
rsg-inventory
rsg-banking
rsg-target
rsg-character
rsg-wardrobe
rsg-gizmo
World and travel
rsg-weather
rsg-stables
rsg-wagons
rsg-boats
rsg-railroad
rsg-trams
rsg-ferry
rsg-guarma
Law and order
rsg-lawman
rsg-prison
rsg-bountyhunter
rsg-doorlock
rsg-bankrobbery
rsg-hanging
Economy and work
rsg-mining
rsg-hunting
rsg-cooking
rsg-moonshine
rsg-factory
rsg-stores
rsg-housing
Life and entertainment
rsg-camping
rsg-bathing
rsg-smoking
rsg-theatre
rsg-cinema
rsg-fivefinger
rsg-telegram
Staff and support
rsg-adminmenu
rsg-medic
rsg-voice
rsg-weapons
Some of these are still in active development. Browse the Rexshack-RedM organisation on GitHub for what is released today.
Speaks your players' language.
RSG scripts ship with the same translation keys in ten languages, so your community can play in their own.