Skip to content

Reference ​

  • How the API is named — Every function follows the same rules, so you can guess a name before looking it up:
  • Server API — All these functions come from lib/rlx.lua. A function that fails returns nil (or false) and the reason.
  • The xPlayer object — Methods work with . and with :. Those that change something return true, or false and the reason.
  • Hooks — A hook runs before the action. It can let it happen (return nothing), block it (return false, "reason") or change it (return the modified table).
  • Events — Listen to them with lsmp.on(name, fn) (or RLX.On("playerLoaded", fn), which adds the rlx: prefix).
  • States, zones, net events, instances, decals — Building blocks for any system: a phone, houses, races, heists, a job. All of them come with lib/rlx.lua; nothing to install.
  • Props, aim and placement
  • Interface: menus, inputs, progress — On the client, or from the server with the source first. These functions wait for the player's answer: call them in a handler or a thread.
  • Interaction points and blips
  • Owned vehicles — Table rlx_vehicles: unique plate, owner (citizenid), model, full properties, garage, stored or out.
  • Companies — One account per job with society = true, per gang if Config.Societies.gangs, and those of your resources.
  • Stashes — A stash has an id, a label, a max weight and item stacks, like the inventory. It opens in the inventory window, next to the player's (Deposit, Take, double click). The content is saved in rlx_stashes.
  • Job menu (F6) — F6 (or /jobmenu) opens the actions of the player's job, on duty. Resources add their own; the core picks the target and checks everything again (job, grade, duty, distance):
  • Statuses, licenses, weapons
  • Offline characters — For boss menus and administration. In game, these functions go through the xPlayer; otherwise they write to the database, and the character cannot be loaded during the write.
  • Logs (files and Discord)
  • Commands
  • Database — Your resources can use RLX's database, even in the sandbox:
  • Client API and game tools — In a client script that has lib/rlx.lua:
  • Player keys and settings — The keys are changed in the game settings, like every other game key: Esc > Settings > Key Bindings, in the category named after the server (for now LS:MP shows this category to developers only;…
  • What LS:MP adds