Skip to content

Conversation

Katzu09
Copy link

@Katzu09 Katzu09 commented Jul 16, 2025

Summary

This PR adds a new native function IsValidPreciseTimer(timerid) that makes it possible to test whether a specified timer ID is still active and valid.

It also fixes a problem where callback functions continue to execute even after DeletePreciseTimer(timerid) is executed within the callback itself.

Usage Example (PAWN)

new MyTimer;

public OnPlayerConnect(playerid)
{
    MyTimer = SetPreciseTimer("HelloTimer", 2000, true, "i", playerid);
}

public HelloTimer(playerid)
{
    // check if it is still valid before deleting
    if(IsValidPreciseTimer(MyTimer))
    {
        DeletePreciseTimer(MyTimer);
        printf("Timer stopped for player %d.", playerid);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant