All resources

rsg-essentials – Docs (v3.3.0)#

Contents#

  1. Files
  2. Modules
  3. Configuration
  4. Events, callbacks and commands
  5. Key bindings
  6. Security
  7. Server owner how-tos
  8. Troubleshooting

1. Files#

FilePurpose
fxmanifest.luaLoads client/*.lua, server/*.lua; depends on rsg-core
shared/config.luaAll settings
client/afk.lua, server/afk.luaAFK kick
client/discord.lua, server/discord.luaDiscord rich presence
server/logs.luaDiscord webhook logger (rsg-log:server:CreateLog)
client/eagleeye.luaEagle eye access by job
client/firstperson.luaFirst-person free-aim
client/handsup.lua, client/pointing.luaHands up, pointing
client/latern.luaLantern holster fix
client/nearwater.luaRiver wash and drink
client/zones.luaMap zone colours
client/unlockdoors.luaUnlocks a few shop/clinic doors
client/weaponcheck.luaRemoves held weapons not in inventory
client/maxcores.luaFills cores on character load
client/density.luaPed/animal/vehicle density
client/ignore.luaHide challenge popups, stop auto-shuffle
client/smallfixes.luaDrown/boat fix, prompts, stuck wagons, animal cleanup
client/commands.lua/hideui
server/storm.lua, server/xmas.luaRestart storm and Christmas weather (rsg-weather)
server/versionchecker.luaGitHub version check
locales/*.jsonen, cs, de, el, es, fr, ja, nl, pl, pt-br, ro, ru

2. Modules#

ModuleWhat it does
AFK kickKicks players standing still for Config.AFK.KickAfter seconds with countdown warnings. Groups in IgnoredGroups are exempt (checked on client and server)
Discord rich presenceApp ID, assets, two buttons and live status from Config.Discord.Template ({ID}, {NAME}, {PLAYERS_COUNT})
Discord logsWebhook logger used by many RSG resources
Eagle eyeEveryone, or only jobs listed in Config.EagleEye; updates on job change
First-person aimingForces first person while free-aiming (FirstPersonShooting)
Hands up / pointingX raises/lowers hands (blocked when dead or cuffed); hold B to point. Both are rebindable (Config.UseKeyMapping, Config.Keys)
Lantern holsterLantern goes back on the hip when switching weapons
River wash & drinkCrouch in a named river/lake for Wash and Drink prompts; thirst restored per Config.River
Map zonesColours regions in Config.Zones
Weapon checkRemoves any held weapon not in the inventory (uses rsg-weapons)
Max coresHealth and stamina cores filled on load
DensityMultipliers from Config.Density
Restart stormBuilds a storm via rsg-weather before a txAdmin scheduled restart
ChristmasSnow weather pattern via rsg-weather (EnableXmas)

3. Configuration#

shared/config.lua:

OptionDefaultMeaning
DebugfalseDebug prints
AFKtableEnabled, KickAfter (1800 s), IgnoredGroups, WarnAt (seconds remaining)
RivertableDrinkThirst {min,max}, DrinkDuration, WashDuration (ms)
EnableAnimalCleanupfalseRemove dead animals every CleanupInterval ms
FirstPersonShootingfalseForce first person while aiming
EnableXmasfalseChristmas weather
PauseReadBookfalsePause-menu book reading
StopAutoShuffletrueNo auto-shuffle to driver seat in wagons
CrouchtrueRequire crouching at water
EagleEyetableeveryone.enabled, plus per-job entries (e.g. vallaw)
DiscordtableApp ID, assets, buttons, UpdateEvery, Template
DiscordWHImage/LogUserName/AuthorNamestringsWebhook look
DensitytableMultipliers 1–9 (animals, humans, peds, vehicles)
WaterTypestableNamed water bodies and types

Webhook URLs go in server/logs.lua.

4. Events, callbacks and commands#

NameSideNotes
rsg-log:server:CreateLogserver event(name, title, color, message, tagEveryone). Client calls are rate limited, cannot ping @everyone and are stamped with the sender's id
rsg-essentials:server:afkKickserver eventAFK kick; staff exemption re-checked on the server
rsg-essentials:server:getPermissionscallbackUsed by AFK kick
rsg-discord:getdata / rsg-discord:receivedataserver / clientRich presence string (rate limited)
rsg-core:client:RemoveWeaponFromTabclient event(weaponName) removes a weapon from the ped
CommandWhoWhat
/hideuieveryoneToggle all UI
/testwebhookgodSend a test Discord log

5. Key bindings#

X hands up, hold B point, ENTER wash, J drink (at water while crouched).

6. Security#

Client-sent logs cannot spam webhooks or ping @everyone. The AFK staff exemption is checked on the server. Rich presence requests are rate limited.

7. How-tos#

  • Turn a module off through its config option (e.g. AFK.Enabled = false).
  • Language: setr rsg:locale "de" in server.cfg.
  • Start after rsg-core, and after rsg-weather if you use storm/xmas.

8. Troubleshooting#

ProblemFix
No Discord logsAdd webhook URLs in server/logs.lua; run /testwebhook
Rich presence emptySet DiscordAppID and asset names from the Discord Developer Portal
Storm/xmas does nothingrsg-weather must be started
Staff kicked for AFKAdd their group to AFK.IgnoredGroups

Support the Project : https://rexshack.tebex.store/

<!-- BEGIN AUTO-REFERENCE (generated from the code; re-run the generator instead of editing by hand) -->

Technical reference#

Generated from the source of rsg-essentials 3.3.0. Names, arguments and defaults below are read straight from the code.

Dependencies#

rsg-core

Configuration#

OptionDefaultNotes
Config.Debugfalse
Config.UseKeyMappingtrueHands up and pointing use rebindable keys (rsg-core RegisterKey, needs rsg-core 3.5.0+). false polls Config.Keys every frame
Config.KeystableHandsUp = 'X', Point = 'B': default key names. Players rebind them in the game's key settings
Config.AFKtableafk kick
Config.Rivertableriver wash / drink
Config.EnableAnimalCleanupfalseanimal cleanup
Config.CleanupInterval900000ms (15 mins)
Config.FirstPersonShootingfalseenable first person shooting
Config.EnableXmasfalseenable xmas weather
Config.PauseReadBookfalsepause menu
Config.StopAutoShuffletrueStop shuffle when entering wagons
Config.CrouchtrueSet to true to force crouching, or false to allow interaction without crouching.
Config.EagleEyetableThis allows server admins to control which roles (jobs) can use Eagle Eye.
Config.DiscordtableGo to Discord Developers Portal (https://discord.com/developers)
Config.DiscordWHImage'https://cdn.discordapp.com/attachments/1032260791669375006/1066811751discord webhook config
Config.DiscordWHLogUserName'Rexshack Gaming Logs'
Config.DiscordWHAuthorName'Rexshack Gaming'
Config.Densitytabledensity config
Config.WaterTypestablewater types config
Config.Zonestablemap zones

Callbacks#

CallbackSideArgumentsFile
rsg-essentials:server:getPermissionsserversource, cbserver/afk.lua
-- client side
RSGCore.Functions.TriggerCallback('rsg-essentials:server:getPermissions', function(result)
    -- use result
end)

Events#

Server events can be fired by any client, so every handler re-validates the player, the arguments and any permission, distance or cooldown on the server. Never add a reward to a handler without those checks.

EventSideArgumentsFile
RSGCore:Client:OnPlayerLoadedclient``client/afk.lua
RSGCore:Client:OnPlayerUnloadclient``client/afk.lua
RSGCore:Client:OnPermissionUpdateclient``client/afk.lua
rsg-discord:receivedataclientrichPresenceStringclient/discord.lua
RSGCore:Client:OnJobUpdateclientjobclient/eagleeye.lua
rsg-core:client:RemoveWeaponFromTabclientweaponNameclient/weaponcheck.lua
rsg-essentials:server:afkKickserver``server/afk.lua
rsg-discord:getdataserver``server/discord.lua
rsg-log:server:CreateLogservername, title, color, message, tagEveryoneserver/logs.lua
-- from a client script
TriggerServerEvent('rsg-essentials:server:afkKick')
-- from a server script
TriggerClientEvent('RSGCore:Client:OnPlayerLoaded', source)

Commands#

CommandNotesFile
/hideuiclient/commands.lua
/testwebhooklocale('sv_test_your_webhook')server/logs.lua

Locales#

Language files in locales/: cs, de, el, en, es, fr, ja, nl, pl, pt-br, ro, ru. Set the language with setr rsg:locale "en".

<!-- END AUTO-REFERENCE -->