View Single Post
Old 23/05/2019, 10:46 AM   #9
Misiek
Big Clucker
 
Join Date: May 2006
Posts: 111
Reputation: 16
Default Re: samp-precise-timers ⌚: A timer plugin written in the memory-safe Rust language. Check it out, you might like Rust!

Quote:
Originally Posted by RogueDrifter View Post
I thought we were unable to pass strings through the settimer function, does that mean your plugin fixes it?
Yes. This plugin handles strings correctly (as noted on GitHub), no need to worry.

Quote:
Originally Posted by kocurek View Post
great plugin!
but, will you add IsValidPreciseTimer and SetPreciseTimerInterval?
I will add SetPreciseTimerInterval.

IsValidTimer, however, is a little misleading in other plugins. They don't actually guarantee that the timer in a given slot is still the same timer as when assigned. For example:
Code:
new TimerVariable;
public OnGameModeInit() {
    TimerVariable = SetTimer("Timer1",3000,1);
}

public OnPlayerConnect(playerid) {
    TimerVariable = SetTimer("Timer2",1000,1); //timer id accidentally assigned to the same variable
}

public OnGameModeExit() {
    printf("TimerVariable's timer %d is valid, but points to a new timer: %d",TimerVariable, IsValidTimer(TimerVariable));
}
As you can see, TimerVariable is technically valid, but probably not what was intended, because it now points to a completely different timer.

A proper implementation would use versioned timer ids.

Quote:
Originally Posted by MisterTickle View Post
Going to go ahead and implement this. Good job.
Thanks! Let me know how that goes!
__________________
Ex-SA-MP beta tester 😉
net4game.com
Misiek is offline   Reply With Quote