Facade resources and their contracts
Each screen is a resource that announces itself to the core with RLX.RegisterProvider(kind) (on the client) and uses only the public API. To make yours: disable RLX's in resources.json, then follow the same contract.
| Kind | Resource | Contract | Without it |
|---|---|---|---|
characters | rlx_identity | Listen to rlx:characterSelection (session: chars, maxChars, canDelete, identity), call RLX.SelectCharacter(id), RLX.CreateCharacter({ firstname, lastname, dob, sex, height }), RLX.DeleteCharacter(id) (they return { ok, data, err }). rlx:characterSelected and rlx:playerLoaded say when to close. | The first character is chosen; if there is none, a "New Citizen" is created. |
ui | rlx_ui | Answer the local calls rlx:ui:menu, rlx:ui:input, rlx:ui:confirm, rlx:ui:progress, rlx:ui:cancelProgress, rlx:ui:settings (lsmp.onCall), listen to rlx:ui:textui (text or nil), rlx:ui:keyhints and rlx:ui:card (card: ID card, badge). | Menus and inputs return nil (warning in the console); a progress bar waits for its duration and returns true. |
notify | rlx_ui | Listen to rlx:notify (text, kind, ms). | Game notifications (above the minimap). |
skin | rlx_skin | Listen to rlx:applySkin (appearance, sex) and dress the ped; answer rlx:skin:open (opts) with the saved appearance or nil; save with RLX.SaveSkin(appearance). | The ped's default look. |
inventory | rlx_inventory | Listen to rlx:inventory:open / rlx:inventory:close, rlx:inventoryChanged; act with RLX.UseItem(slot), RLX.GiveItem(player, slot, n), RLX.GiveMoney(player, amount). Stashes: rlx:inventory:openStash and rlx:stashChanged (the stash), RLX.StashDeposit, RLX.StashTake, RLX.CloseStash() when closing. | No window and no stashes (the player is told; everything else works). |
hud | rlx_hud | rlx:setAccountMoney, rlx:setMeta, RLX.GetPlayerData(). | The game HUD. |
death | rlx_death | Listen to rlx:dead (delay in s; emitted again when the delay changes) and rlx:alive, call RLX.Respawn() when the player asks. Show the line other resources send with the local event rlx_death:hint (text, nil to clear). | Automatic respawn at the hospital after the delay. |
RLX.GetProviders() (client) tells who provides what.
Other replacements
| You want… | How |
|---|---|
| Your spawn point (apartment, selector) | spawn hook. |
| Your inventory (logic) | Config.Modules.inventory = false, then RLX.OverridePlayerMethod("addItem", ...) and the other inventory methods. |
| Your bank | RLX.OverridePlayerMethod("addAccountMoney", ...) or the money hooks. |
| Your ambulance | Config.Modules.death = false: listen to playerDeath, call RLX.Revive(source). |
| Your chat | Disable rlx_chat, send the /… lines to the server: lsmp.emitServer("rlx:cmd", line). |
| Your admin commands | Config.Modules.adminCommands = false, then RLX.RegisterCommand. |
| Your weapons | Config.Modules.weapons = false: weapons are then plain items of your inventory, or your own system. |
| Your garages and persistence | Config.Vehicles.persistent = false (vehicles go back to their garage), or Config.Modules.vehicles = false and your own table. |
| Your crafting, your ground items, your stashes | Config.Modules.crafting, drops, stashes = false, then your resource. |
| Your status system (hunger, thirst…) | Config.Modules.status = false, then your resource. |
Everything else is set in the shared/config.lua files of each resource; their texts are in their locales/ folder.