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:

WordUsed forExamples
Get / Set / Is / HasRead, change, askGetPlayer, SetClock, IsDead, HasLicense
RegisterA definition that lives as long as the server: items, jobs, commands, usable items, stashes, job actions, key actionsRegisterItem, RegisterCommand, RegisterStash
Add / RemoveSomething placed in the world or in a list, taken back laterAddPoint, AddTarget, AddProp, AddPed, AddRecipe, AddCron
Show / HideSomething on screenShowTextUI, ShowTimer, ShowKeyHints
Open / CloseA windowOpenMenu, OpenInventory, OpenStash, OpenDialog
Start / Stop, Play / StopSomething that runs; an animation, a sound, an effectStartRoute, PlayCamera, PlayAudio, StopAudio
Player in the nameActs on a player's character, given by sourceGetPlayerCoords, SetPlayerCoords, FreezePlayer, SetPlayerInvincible, SetPlayerInstance, IsPlayerAfk
  • Server and client. On the server, a function about a player takes their source first. The same name on the client acts on the local player: RLX.GetClosestPlayer(coords, maxDistance) on the server, RLX.GetClosestPlayer(maxDistance) on the client.
  • Results. A function returns its value, or nil (or false) and the reason. Its module turned off: nil, "module_disabled:<module>".
  • Other names. RLX.GetPlayerFromId = RLX.GetPlayer, RLX.GetPlayerFromIdentifier = RLX.GetPlayerFromCitizenId, RLX.ShowNotification = RLX.Notify.