Client API and game tools
In a client script that has lib/rlx.lua:
| Function | |
|---|---|
RLX.GetPlayerData() · RLX.IsPlayerLoaded() · RLX.IsDead() | |
RLX.GetJob() · RLX.GetGang() · RLX.GetMeta(key) · RLX.GetStatus(name) · RLX.HasLicense(name) · RLX.GetLoadout() | |
RLX.GetAccountMoney(name) · RLX.GetItemCount(name) · RLX.HasItem(name, n) | |
RLX.GetShared() · RLX.GetItems() · RLX.GetJobs() · RLX.IsModuleEnabled(name) · RLX.GetLocale() | |
RLX.ShowNotification(text, kind, ms) | |
RLX.OpenMenu, RLX.Input, RLX.Confirm, RLX.ProgressBar, RLX.CancelProgressBar, RLX.ShowTextUI, RLX.HideTextUI | Interface |
RLX.OpenDialog, RLX.PlayCamera, RLX.StopCamera, RLX.ShowCountdown | Dialogs, camera paths |
RLX.AddPoint(def, fn), RLX.RemovePoint(id), RLX.AddBlip(def), RLX.RemoveBlip(id) | For this player. |
RLX.GetClosestPlayer(maxDistance) · RLX.GetPlayersInRadius(radius) · RLX.GetClosestVehicle(maxDistance) | playerId, distance / list / netId. |
RLX.GetVehicleProperties(netId) · RLX.SetVehicleProperties(netId, props) | |
RLX.PlayAnim(dict, clip, { flag, duration }) · RLX.StopAnim() · RLX.RequestModel(model) | |
RLX.OpenInventory() · RLX.CloseInventory() · RLX.Teleport(x, y, z, heading, findGround) | |
RLX.OnKey(action, onPress, onRelease) · RLX.IsKeyDown(action) · RLX.GetEffectiveKey(action) · RLX.GetKey(action) · RLX.GetKeyLabel(action) · RLX.RegisterKeyAction(name, label, default, group) · RLX.OpenSettings() · RLX.GetSetting(key) · RLX.SetSetting(key, value) | Keys and settings. |
RLX.GetCurrentVehicle() · RLX.IsInVehicle() | The vehicle you sit in (netId), without the LS:MP trap ("Good to know"). |
RLX.RaycastCamera(dist) · RLX.GetAimedEntity(dist, opts) · RLX.GetEntityCenter(entity, model) · RLX.GetEntityModelSafe(entity) · RLX.Highlight(entity, opts) · RLX.PlaceObject(model, opts) | Aim and placement. |
RLX.GetTargetOptions(info) · RLX.RunTarget(key, info) · RLX.GetTargetDebug() · RLX.ShowCard(card) · RLX.TakePhoto() | Targeting, cards, portrait (TakePhoto returns false, reason). |
RLX.ShowHelp(text, ms) · RLX.HideHelp() · RLX.ShowSubtitle(text, ms) | Game texts: the help box top left (~INPUT_CONTEXT~ tokens become GTA's key icons; {lock}: the key the player uses for an RLX action), the subtitle at the bottom. |
RLX.Add3DText(id, coords, text, { distance, scale, color }) · RLX.Remove3DText(id) | Floating text placed once, drawn by the core (removed when the resource stops). |
RLX.ShowKeyHints(list) · RLX.HideKeyHints() | GTA's key bar (its "instructional buttons", bottom right, the key icons of the player's keyboard); if the game cannot draw it, the rlx_ui page takes over: { { keys = { 32, 34, 33, 35 }, label = "Move" }, { keys = { "wheel" }, label = "Speed" } }. A key = a game control, "action:lock" (key chosen in the settings) or a name: wheel, mouse, lmb, rmb, shift, ctrl, alt, space, enter, esc, tab. |
RLX.OpenStash(id) · RLX.StashDeposit(slot, n) · RLX.StashTake(slot, n) · RLX.CloseStash() · RLX.GetOpenStash() · RLX.GetVehicleStash() | Stashes. |
RLX.UseItem(slot) · RLX.GiveItem(player, slot, n) · RLX.GiveMoney(player, amount) · RLX.Respawn() | Player actions (checked by the server). |
RLX.OpenSkinMenu(opts) · RLX.SaveSkin(appearance) | Appearance. |
RLX.RegisterProvider(kind) · RLX.GetProviders() · RLX.GetConfig(key) · RLX.GetLocale() | For facade resources. |
RLX.TriggerServerCallback(name, cb, ...) · RLX.Callback(name, ...) | |
RLX.GetSession() · RLX.SelectCharacter(id) · RLX.CreateCharacter(data) · RLX.DeleteCharacter(id) | For your character screen. |
RLX.Localize(table) · RLX.Translator(Locales) | Languages (server too). |