23.12.2013, 20:10
Quote:
So you say that the end user is able to get the global "New"s in samp ?
Or you mean for other programs ? |
Here is a quick example:
pawn Code:
// timer.inc
// the include that runs off the timer
// declare the variable to store the timer ID so we can kill it later on
new g_Timer;
// Initialize the timer when the mode starts by hooking OnGameModeInit
hook OnGameModeInit() { g_Timer = SetTimer(...); }
// Kill the timer when the mode ends by hooking OnGameModeExit()
hook OnGameModeExit() { KillTimer(g_Timer); }
pawn Code:
// test.pwn
#include <timer>
stock RandomFunction()
{
// Here the "g_Timer" variable's value is altered meaning we no longer have the correct
// timer ID to kill via our library
g_Timer = SetTimer(...);
}