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

CreateTimerEx

Creates a timer with an argument list.

[top]Declaration

Code cpp:
VAULTSCRIPT VAULTSPACE Timer (*VAULTAPI(CreateTimerEx))(VAULTSPACE RawFunction(), VAULTSPACE Interval, VAULTSPACE cRawString, ...) VAULTCPP(noexcept);
Code c:
native CreateTimerEx(const func{}, interval, const def{}, {Fixed,Float,_}:...);

[top]Parameters

Function - the function of the timer
Interval - the timer interval in milliseconds
cRawString - the parameter list of the function. This is a string containing a sequence of:
  • i - Integer (4 byte)
  • l - Long integer (8 byte)
  • f - Floating-point (8 byte)
  • p - Pointer (4 byte)
  • s - String (const char*)

... - the arguments. Must match the previously defined definition.

[top]Return value

Returns a Timer referring to the newly created timer.

[top]Usage example (C++)

Code cpp:
Result VAULTSCRIPT MyTimer(int a, int b, const char* c)
{
    // Timer function
    return static_cast<Result>(0);
}
Void VAULTSCRIPT exec() noexcept
{
    // C++ template version (type-safe, deduces type string)  
    CreateTimerEx(MyTimer, static_cast<Interval>(5000), 1, 2, "www.vaultmp.com");
}

[top]Usage example (PAWN)

Code c:
forward MyTimer(a, b, const c{});
public MyTimer(a, b, const c{})
{
    // Timer function
    return 0;
}
main()
{
    CreateTimerEx("MyTimer", 5000, "iis", 1, 2, "www.vaultmp.com");
}

[top]Related pages