leet scripting API
leet is an extra API for the scripts you run from the script list in the in-game menu. It works alongside the regular RAGE Multiplayer client API (mp). You control the game through mp. leet shows your script what mp does not expose and ties the script to the script list, for example by giving it a Stop button.
This document describes how each function behaves: what it accepts and returns, which errors it throws, and what it guarantees.
leet is split into namespaces (leet.packets, leet.events, leet.features, leet.ui, leet.world, leet.players, leet.logger, leet.vehicle, leet.entities), each with its own section below. More namespaces will be added over time, and the existing ones keep their contracts.
Getting started
Scripts are started from the script list in the menu. Execute runs a script once, right now; Auto Exec runs it automatically.
A script has access to:
| Object | Available on | What it is |
|---|---|---|
mp | all servers | The standard RAGE Multiplayer client API. |
api | GTA5RP servers | The GTA5RP server API. |
leet | all servers | The API described in this document. |
For packets, read Packets: quick start first.
A first script: it logs every outgoing callRemote the client makes and gets a Stop button. Stop removes the packet subscription itself; onUnload here only prints the farewell.
leet.packets.on('callRemote', (call) => {
mp.console.logInfo(`[callRemote] ${call.name} ${JSON.stringify(call.args)}`);
});
leet.events.onUnload(() => {
mp.console.logInfo('remote call logger stopped');
});