Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional format specifier #6

Open
xarland opened this issue May 23, 2019 · 2 comments
Open

Additional format specifier #6

xarland opened this issue May 23, 2019 · 2 comments

Comments

@xarland
Copy link

xarland commented May 23, 2019

How about this as a format specifier that passes the ID of the timer (t/T)?

Example before:

new gTimerID;

gTimerID = SetPreciseTimer("StartTimer", 1000, false, "i", playerid);

public StartTimer(playerid)
{
    printf("playerid: %i, timerid: %i", playerid, gTimerID);
    DeletePreciseTimer(gTimerID)
    return 1;
}

Example after:

SetPreciseTimer("StartTimer", 1000, false, "it", playerid);

public StartTimer(playerid, timerid)
{
    printf("playerid: %i, timerid: %i", playerid, timerid);
    DeletePreciseTimer(timerid);
    return 1;
}

The timerid will be passed not by the developer, and the plugin.

@markski1
Copy link

This could be handled with a cache like mysql plugin does, and no need to pass it as yet another parameter. Plus, using format specifier for stuff which is meant to be implicit by the plugin could make things a bit harder to understand...

@Y-Less
Copy link

Y-Less commented Sep 23, 2019

I'd say an explicit parameter is way better than anything implicit. Then only the timers that actually want it get it, and you know you'll get it because you asked for it.

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

No branches or pull requests

3 participants