Skip to content

Reference

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; the defaults work for everyone). Every RLX action is an LS:MP key mapping (lsmp.keys), declared once with its default key: LS:MP keeps each player's choice on their machine. So:

  • nothing fires while the player types (chat, a focused page, the console), and a held key is released when that starts;
  • a controller works;
  • any keyboard key, mouse button or combination can be bound (Ctrl+N, Mouse4).

RLX has no key page or key command of its own any more. A resource can still show the list: RLX.OpenSettings() (a menu with the key in effect, * when changed by the player, and where to change them) or RLX.GetKeyActions().

LS:MP letters are the letters printed on the player's keyboard: a default Z is the forward key on AZERTY. RLX defaults avoid Z, Q, W, A and the keys GTA uses; do the same for your own actions.

ActionDefaultActionDefault
InventoryTab (F5 in loadout mode)SeatbeltB
Job menuF6LockL
Vehicle menuF7Voice rangeF11
Targeting (hold)AltRadio (hold)Caps Lock
Player IDs (staff, hold)HomeHands upX
Fall down / get upGCrouchCtrl
Inventory slots 1-51 to 5Accept / refuse a requestY / N
Staff menu (rlx_admin)F9Call for help, unconscious (rlx_ambulance)H
Last call: GPS (rlx_dispatch)J

In your resource (client):

lua
RLX.RegisterKeyAction("phone", { en = "Phone", fr = "Téléphone" }, "M", "Character")  -- your own action (default M)
RLX.OnKey("phone", function() OpenPhone() end, function() --[[ released ]] end)       -- press / release
if RLX.IsKeyDown("phone") then ... end                                                -- held (read locally, free)
RLX.GetEffectiveKey("phone")   -- the key in effect for this player ("M", "Ctrl+N"...)

RLX.OnKey: use it rather than reading a control. A default is an id of Keys.KEYBOARD (rlx/shared/keys.lua) or any LS:MP key name ("Ctrl+N", "Mouse4"). RLX.GetKey(action) gives the game control under the key in effect, or nil (to disable the game's own action on it, like the crouch key does). Keys.token(control) gives the ~INPUT_…~ token GTA draws as the key icon in its texts. Players change their keys in the game settings (RLX.SetKey answers so).

Minimap, game HUD, pause menu ​

  • rlx_hud: HudConfig.minimap = "edge" puts the minimap in the corner of an ultrawide screen (GTA leaves it in a centered 16:9 band); "game" keeps GTA's place; a rectangle { x, y, width, height } puts it where you want. The HUD lines itself up on the real minimap (lsmp.hud.getMinimapRect).
  • HudConfig.hideGameHud: parts of GTA's HUD hidden (by default the vehicle name, the district and the street, which our HUD already shows).
  • Config.PauseMenu (core): hide or rename the tabs of the pause menu (map, info, gallery, stats; SETTINGS always stays): { hide = { "stats" }, labels = { info = { en = "Server", fr = "Serveur" } } }.

Settings (any value, kept with the account): RLX.GetSetting(key), RLX.SetSetting(key, value) on the client; RLX.GetPlayerSetting(source, key), RLX.SetPlayerSetting(source, key, value) on the server; local event rlx:settingChanged.