I'm making a BIG plugin for CS:S Jailbreak and it uses some timers, so I made this but in a native (the plugin will include an API with this native):
PHP Code:
stock ClearTimer(&Handle:Timer)
{
if(Timer != INVALID_HANDLE)
{
CloseHandle(Timer);
Timer = INVALID_HANDLE;
}
}
Paste it in the bottom of your plugin and use it like in this example:
PHP Code:
new coolInt;
public Action:hellobuddy(client, args)
{
new Handle:MyTimer = CreateTimer(30.0, blabla, _, TIMER_FLAG_NOMAPCHANGE);
switch(coolInt)
{
case 3:
{
ClearTimer(MyTimer);
coolInt = 0;
}
default:
{
coolInt++;
PrintToServer("hey homie the coolInt is now %i.", coolInt);
}
}
}
__________________