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 08-14-2012, 08:41 PM by foxtacles (contribs). It may differ significantly from the current revision.
Creates a timer.

[top]Declaration

Code cpp:
VAULTSCRIPT VAULTSPACE Timer (*VAULTAPI(CreateTimer))(VAULTSPACE RawFunction(), VAULTSPACE Interval) _CPP(noexcept);
Code c:
native CreateTimer(const func{}, interval);

[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;
}
vaultmp::Void VAULTSCRIPT exec()
{
    CreateTimer(&MyTimer, 5000);
}

[top]Usage example (PAWN)

Code c:
forward MyTimer();
public MyTimer()
{
    // Timer function
    return 0;
}
main()
{
    CreateTimer("MyTimer", 5000);
}

[top]Related pages