Перейти к содержанию

Run

Материал из RAGE MP Wiki Archive

Runs thread-safe API code on main thread.


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

<syntaxhighlight lang="csharp"> NAPI.Chat.SendChatMessageToPlayer(client, "Hello right now."); NAPI.Task.Run(() => {

   NAPI.Chat.SendChatMessageToPlayer(client, "Hello after 5 seconds.");

}, 5000); </syntaxhighlight>