Scripting/Squirrel/Functions/NewTimer

From Vice City Multiplayer
Revision as of 17:32, 2 August 2015 by ProsuWANTED (talk | contribs)
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

Syntax

NewTimer( func, time, 1, ...);

Arguments

  • function func - the function to call when the timer ends
  • int time - the time before the function call
  • ... - function (func) parameters

Example

function onPlayerCommand( player, cmd, text )
{
	if ( cmd == "count" )
	{
		Message( "[#ffffff]<<<Odliczanie>>>>" );
		NewTimer( "ClientMessageToAll", 1000, 1, "-> 3",28, 255, 11 );
		NewTimer( "ClientMessageToAll", 2000, 1, "-> 2",24, 255, 241 );
		NewTimer( "ClientMessageToAll", 3000, 1, "-> 1",249, 57, 56 );
		NewTimer( "ClientMessageToAll", 4000, 1, "-----> START <------",1000, 1500, 300 );
	}
}

Notes

Call onPlayerCommand were used in this example. More info about them in the corresponding pages.

Related Functions