2019-04-21, 11:14 PM
The documentation covers standard uses. This is a completely non-standard use, and exploits internal details. Those details have never been guaranteed to be stable and change a lot.
Fortunately, rewriting that isn't too hard because the timer doesn't accept any additional parameters (i.e. it is a `SetTimer` wrapper, not a `SetTimerEx` wrapper). Something like this:
Fortunately, rewriting that isn't too hard because the timer doesn't accept any additional parameters (i.e. it is a `SetTimer` wrapper, not a `SetTimerEx` wrapper). Something like this:
PHP Code:
#if defined _inline_timers_included
#endinput
#endif
#define _inline_timers_included
#include <YSI_Coding\y_inline>
forward InlineTimersHandler(Func:cb<>, bool:repeat);
public InlineTimersHandler(Func:cb<>, bool:repeat)
{
@.cb();
if (!repeat)
{
Indirect_Release(cb);
}
}
stock SetInlineTimer(Func:cb<>, delay, bool:repeat)
{
new timer = SetTimerEx("InlineTimersHandler", delay, _:repeat, "ii", _:cb, _:repeat);
if (timer)
{
Indirect_SetMeta(cb, timer);
Indirect_Claim(cb);
return _:cb;
}
return 0;
}
stock KillInlineTimer(cb)
{
KillTimer(Indirect_GetMeta(cb));
Indirect_Release(cb);
}