This site has been archived and made available for preservation purposes. No edits can be made.

CreateTimer

This is an old revision of this page, as edited 04-06-2012, 03:24 PM by foxtacles (contribs). It may differ significantly from the current revision.
Creates a timer.

[top]Declaration

<code cpp>
VAULTSCRIPT vaultmp::Timer (*CreateTimer)(vaultmp::Function, vaultmp::Interval);
native CreateTimer(const func{}, interval);
</code>

[top]Parameters

vaultmp::Function (C++ only) - the function of the timer
func (PAWN only) - the name of the timer's function
vaultmp::Interval - the timer interval in milliseconds

[top]Return value

Returns a vaultmp::Timer referring to the newly created timer.

[top]Usage example (C++)

<code cpp>
vaultmp::Result VAULTSCRIPT MyTimer()
{
// Timer function
return 0;
}
void VAULTSCRIPT exec()
{
CreateTimer(&MyTimer, 5000);
}
</code>

[top]Usage example (PAWN)

<code c>
forward MyTimer();
public MyTimer()
{
// Timer function
return 0;
}
main()
{
CreateTimer("MyTimer", 5000);
}
</code>

[top]Related pages