public OnPluginEnd() << Is called when the plugin is unloaded or reloaded due to file changes. Any timers when plugins are reloaded or unloaded are killed.
If the plugin does not get reloaded or unloaded during map changes. The timer will carry over to the next map.
You would have to use the forward OnMapEnd(); to kill the timer or use the flag "TIMER_FLAG_NO_MAPCHANGE".
Code:
public OnMapEnd()
{
if(cTimer != INVALID_HANDLE)
{
KillTimer(cTimer, false);
cTimer = INVALID_HANDLE;
}
}
If you used the TIMER_FLAG_NO_MAPCHANGE. Then you would still need to do that.
Code:
public OnMapEnd()
{
cTimer = INVALID_HANDLE;
}
In your OnConvarChanged forward Handle. Your not checking if cTimer != INVALID_HANDLE; If it a valid handle that already has a repeated timer. Your just creating another one on top of that one.
This is what I would do in that part.
Code:
if (iNewVal > 0) {
if(cTimer != INVALID_HANDLE)
{
KillTimer(cTimer, false);
cTimer = INVALID_HANDLE;
}
cTimer = CreateTimer(60.0, PrintTime, _, TIMER_REPEAT);
} else {
KillTimer(cTimer, false);
cTimer = INVALID_HANDLE;
}
__________________