RE.Register

From GTA Network Wiki
Jump to: navigation, search

RE.Register
Server-Side Function

utilities-terminal.png Server-Side csharp.png C#

Registers a remote event at runtime.

Syntax

bool NAPI.RemoteEvent.Register(string eventName, Action<Client, object[]> action);

NOTE: This function returns a bool, true if successful and false if failed.

Usage example(s)

public void InvokedFromSomewhere()
{
    NAPI.RemoteEvent.Register("testRemoteEvent", TestMethod);
}

public void TestMethod(Client player, params object[] args)
{
    // Remote event code
}

Changelog

Version Description
1.0 Release.

References