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

WaitForMainThread

Материал из RAGE MP Wiki Archive
Версия от 14:03, 23 декабря 2022; imported>Xabi (Created page with "Waits for the main thread before executing API related functions. {{CSharpContainer| {{#tag:pre|Task<object>{{Template:CSharp_Serverside_namespace}}Task.WaitForMainThread([lo...")
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

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>