Good to know
- Copies. What you get from RLX is a copy: changing
xPlayer.jobchanges nothing, callsetJob. - Threads. Functions that wait (database, vehicles, companies, offline, menus and inputs,
SavePlayer) are called from a handler (lsmp.on,lsmp.onClient,lsmp.onCall, an RLX command, an RLX point) orlsmp.createThread, never directly in asetTimeout. Otherwise they returnnil, "not in a coroutine". - Client. Never trust what a client sends: check on the server (
RLX.GetPlayer(source), amounts, distances). Server points do it for you. - Saving. Every
Config.SaveIntervalSeconds, a few seconds after a money or item change, on disconnection and on stop. - Blips. On the client, LS:MP cannot delete a blip (
removeBliphas no effect): clientRLX.RemoveBliphides it and reuses it. On the server, they are real server blips, really deleted. - Proximity queries. Go through
RLX.GetClosestVehicle,RLX.GetEntitiesInRadiusandRLX.IsSpotFreerather thanlsmp.getClosestEntityandlsmp.getEntitiesInRadius: they take any position form and keep working when LS:MP changes them. - The player's vehicle (client). Under LS:MP,
getVehiclePedIsIn(ped, false)also returns the last vehicle, even on foot. CheckisPedInAnyVehicle(ped, false)first, or useRLX.GetCurrentVehicle(). - Picker types.
lsmp.selectionmay report a vehicle as"object"and a map object without a type: ask the game (getEntityType,isModelAVehicle), asrlx_targetdoes. - Minimap. GTA draws it in a 16:9 zone in the center of the screen, even on ultrawide, and neither GTA nor LS:MP can move it. The RLX HUD aligns itself on it.
- GTA replay. LS:MP's Rockstar Editor grabs keys (F5/F6, Alt shows its help). Its natives (
REPLAY,RECORDING) are blocked for resources, and disabling its controls has no effect: only LS:MP can turn it off. - Native names. LS:MP uses the current names of the natives, for example
getControlInstructionalButtonsString. - Natives that do not exist.
GetVehicleFuelLevel,SetVehicleFuelLevel,GetVehicleCurrentRpm... are not GTA natives, so LS:MP does not have them.rlx_fuelfuel is kept by the script (entity metarlx:fuel). - Deleting an entity.
lsmp.deleteEntityreturns a boolean; the reason of a failure is read withlsmp.getLastError()(permission: the resource lacks theentities.foreigncapability). - Lua 5.5. A
forloop variable cannot be reassigned, andglobalis a reserved word.