Skip to main content

Client-side C# Functions

4498 functions are available: 3408 RAGE.Game.* statics and 1090 RAGE.Elements class methods. They are generated from RAGE:MP's own shipping client assembly (for the exact signature) crossed with our native table (for the hash and marshalling), so a method either has a verified native behind it or is not emitted at all.

using RAGE;
using RAGE.Elements;

// RAGE.Game.* — the natives, with the handle passed explicitly
RAGE.Game.Vehicle.SetVehicleNeonLightEnabled(veh, 0, true);
RAGE.Game.Entity.SetEntityHeading(ped, 90.0f);
Vector3 pos = RAGE.Game.Entity.GetEntityCoords(ped, true);

// Element methods — the same natives with the handle supplied for you
Player.LocalPlayer.SetArmour(100);

// out-parameters come back as ref arguments, matching RAGE:MP
int r = 0, g = 0, b = 0;
RAGE.Game.Vehicle.GetVehicleNeonLightsColour(veh, ref r, ref g, ref b);

Natives only run on the script thread. Event handlers and Tick are on it; code after an await is not. A native invoked from the wrong thread is rejected with a log line rather than crashing the game — if you need one after async work, hop back through Events.Tick.

What exists today​

RAGE.Chat​

Chat.Output("hello"); // push a line to the local chat
Chat.Show(true);
Chat.Activate(true);
Chat.SafeMode = false; // allow HTML in messages
Chat.Colors = true;

RAGE.Elements​

Every element is identity — Id, RemoteId, Type, IsLocal, IsNull — plus:

MemberOnNotes
Positionalllive world position
Modelallmodel hash
Dimensionallalways 0 — see below
Handlegame entitiesthe local GTA handle
Existsgame entities
NamePlayerthe server-supplied name
VehiclePlayerthe occupied vehicle, or null
Player.LocalPlayerstatic
Dataalla client-local Dictionary<string, object>

Elements are cached by identity: the same entity always gives you the same object, so player == Player.LocalPlayer behaves the way a RAGE:MP gamemode expects.

Dimension reports 0 for every entity. Per-entity dimension is not synced to the client, and reporting the local player's dimension for everyone would be wrong in a way that is hard to notice.

Pools​

Entities.Players.All // List<Player>
Entities.Players.Count
Entities.Vehicles.GetAtRemote(id)
Entities.Vehicles.GetAtHandle(handle)
Entities.Peds.AsEnumerable()

Available: Players, Vehicles, Objects, Pickups, Blips, Checkpoints, Markers, Colshapes, TextLabels, DummyEntities, Peds, Cameras. They resolve against the live streamer, so All reflects what is actually streamed in rather than a list you maintain.

RAGE.Vector3​

Full value type with the RAGE:MP surface: X/Y/Z, Length, Normalized, Normalize, Add/Subtract/Multiply/Divide, the + - * / and == != operators, Lerp, Distance, DistanceSquared, DistanceTo, DistanceTo2D, RandomXY, Around, SetFromBuffer.

Binary operations return a new vector; they never mutate the receiver.

RAGE.Ui.HtmlWindow​

Url, Active, Headless, InputEnabled, MouseInputEnabled, ExecuteJs, ExecuteCachedJs, Call, CallProc, Reload, Destroy, MarkAsChat.

The client owns a single CEF page today, so ExecuteJs reaches it but the window Id is not yet used to route between browsers. SendMouseClickEvent / SendMouseMoveEvent are declared and do nothing — there is no synthetic-input channel into CEF yet.

RAGE.Events​

Add, Remove, AddProc, AddDataHandler, RemoveDataHandler, CallLocal, CallRemote, CallRemoteUnreliable, CallRemoteProc.

CallRemoteUnreliable is an alias for CallRemote — our transport is reliable-only. CallRemoteProc delivers the call but completes with null: there is no client→server RPC answer channel in the protocol, and the JavaScript host has the same limitation. It returns a completed task rather than hanging forever on a reply that will never arrive.

Not implemented yet​

  • 264 methods have no binding. 169 because our native table has no native of that name (the same stale-dump root cause behind the JavaScript gaps), and 95 because RAGE:MP's declared signature disagrees with the native's — most often ref int where the native takes a string, which is wrong in RAGE:MP too and would crash rather than work.
  • Properties. RAGE:MP exposes many element members as properties (Player.Health); the generator emits methods only, so those are not there yet.
  • RAGE.NUI (24 types, NativeUI menus), RAGE.User, RAGE.Util.

The exact per-method list lives in tools/csharp-api-gaps.txt in the client repo, and the cross-surface register is docs/API_GAPS.md.