Thread: [Solved] Invalid Timer Handle
View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-04-2017 , 20:16   Re: Invalid Timer Handle
Reply With Quote #5

Quote:
Originally Posted by Neuro Toxin View Post
New syntax.

Code:
stock bool ClearTimer(Timer timer) {
    if(timer != null) {
        delete timer;
        timer = null;
        return true;
    }
    return false;
}
Your error message doesnt match your code. ClearTimer is just closing a handle. It doesnt care about what type of handle is parsed.

Provide the actual error and its stack trace.
Code:
stock bool ClearTimer(Timer timer) {
You mean this, right?

Code:
stock bool ClearTimer(Timer &timer) {
Edit: For that matter, just scrap the whole stock and use delete instead.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 10-04-2017 at 20:17. Reason: Fixed comma location
Powerlord is offline