Run

From RAGE Multiplayer Wiki

Runs thread-safe API code on main thread.


C# Syntax

void NAPI.Task.Run(Action task, [long delayTime = 0]);

Parameters

  • task: the action to execute. Parameter input should be in Action type
  • delayTime: delay time in milliseconds until the action gets executed. Parameter input should be in long type

Example

NAPI.Chat.SendChatMessageToPlayer(client, "Hello right now.");
NAPI.Task.Run(() => 
{
    NAPI.Chat.SendChatMessageToPlayer(client, "Hello after 5 seconds.");
}, 5000);