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

WaitForMainThread

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

Waits for the main thread before executing API related functions.


Task<object>NAPI.Task.WaitForMainThread([long delayTime = 0]);

Parameters

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

Example

<syntaxhighlight lang="csharp"> NAPI.Task.WaitForMainThread(); NAPI.Chat.SendChatMessageToPlayer(player, "We are in main thread now."); </syntaxhighlight>