Delay

From GT-MP
Jump to: navigation, search
Delay
Server-Side Function
Utilities-terminal.png Server-Side Csharp.png C#

See also: startTimer

Calls the given function in a separate thread after a given time span.

Syntax

In C#
Server-Side Function

API.delay(int ms, bool once, Action target);
  • ms: parameter input should be in int type.
  • once: parameter input should be in bool type.
  • target: parameter input should be in Action type.

NOTE: This function returns data in Timer type.

Usage example(s)

// This will delay the kick of a player by 5 seconds.
API.delay(5000, true, () => { API.kickPlayer(Client player); });

Changelog

Version Description
1.0 Release.