Timers module - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: open.mp (https://forum.open.mp/forumdisplay.php?fid=40) --- Forum: Development Updates (https://forum.open.mp/forumdisplay.php?fid=43) --- Thread: Timers module (/showthread.php?tid=583) |
Timers module - Y_Less - 2019-05-22 This is a sneak-peek at one of the improved modules we've done, for timers in open.mp: PHP Code: native SetTimer(const func[], msInterval, bool:repeat) = SetTimerEx; The first two are just for backwards-compatibility, the rest are the improved API: PHP Code: native Timer:Timer_Create(const func[], usDelay, usInterval, repeatCount, const params[] = "", GLOBAL_TAG_TYPES:...);
RE: Timers module - JustMichael - 2019-05-22 It's so pretty uwu I definitely prefer this over how timers are handled in SA-MP. Even the little things can make a big difference. RE: Timers module - Freeze - 2019-05-22 Very good! I'm looking forward to what's coming soon RE: Timers module - Afisiado - 2019-05-22 Finally, decent functions with timers! RE: Timers module - CRHStudios - 2019-05-22 Pretty good features and improvements with the timers. RE: Timers module - 2PAC_ - 2019-05-23 Very nice, good job! RE: Timers module - Max_Andolini - 2019-05-23 This is great!!! RE: Timers module - Verc - 2019-05-23 What a great news! RE: Timers module - Koplan - 2019-05-23 Good Job! RE: Timers module - Hawkins - 2019-05-23 Continue in the same spirit RE: Timers module - Manyula - 2019-05-23 Absolutely love the new API, great job! Not really a fan of the prefixing of the functions, though. Is that scheme gonna be applied to all of the new API? RE: Timers module - BigETI - 2019-05-23 Think it having two names: The prefix is the library or module the function is from and the suffix is the actual function name. The underscore just seperates both names. RE: Timers module - JustMichael - 2019-05-23 (2019-05-23, 06:59 PM)BigETI Wrote: Think it having two names: The prefix is the library or module the function is from and the suffix is the actual function name. The underscore just seperates both names. Well said, sir. Have a box?of cookies :) I do prefer this to how SA-MP does it, and I wouldn't want to have mixed casing. RE: Timers module - Manyula - 2019-05-23 I understand that the prefix is there to be able to quickly identify the module it belongs to, but imho I don't think that's necessary. But then again, I think this comes down to personal taste. One more thing: I think some of the timer functions lack a certain consistency in terms of naming. Code: native Timer_Get[b]Time[/b][i]Remaining[/i](Timer:timer); should be... Code: native Timer_Get[i]Remaining[/i][b]Time[/b](Timer:timer); to be in line with... Code: native Timer_GetTotalCalls(Timer:timer); as the latter sounds more natural. RE: Timers module - BigETI - 2019-05-23 The naming of the functions is more a convention we are going to use rather than personal taste. (I personally don't like it) RE: Timers module - NexoR - 2019-05-23 Good job. RE: Timers module - Y_Less - 2019-05-24 (2019-05-23, 07:11 PM)Manyula Wrote: I understand that the prefix is there to be able to quickly identify the module it belongs to, but imho I don't think that's necessary. But then again, I think this comes down to personal taste. You're right about the mixed verb/noun order, I'll fix that. As for module prefixes, that's now quite well established. It gives a nice consistent naming scheme, and there's a longer-term goal you'll have to wait for to see... RE: Timers module - Gravityfalls - 2019-05-24 Amazing. RE: Timers module - Riddick - 2019-05-29 This seems to be all right. Is it PAWN limitation or bad SA-MP's SetTimer(Ex) functions coding that we are not allowed to pass strings in it? (or we are but it didn't work correctly - I can't remember now). --- I still wish here for "IsValidTimer" function. I know that IDs could be assigned to a new timer where the other timer has finished its job and it doesn't guarantee that the timer in a give slot is still the same, but some internal IDs should be assigned once maybe? I guess maybe use versioned timer IDs? Unless you are not going for it. RE: Timers module - Y_Less - 2019-05-29 It's a bug in the native, not a pawn limitation. RE: Timers module - Expert* - 2019-05-30 I use module prefixes for fixed/protected/new functions so i love it. What i don't love is extra work to ensure compatibility. global func: Player_SetSkin static func: player_setskin call: PLAYER_RequestSpawn RE: Timers module - Y_Less - 2019-05-30 I'm not sure what that last line is. RE: Timers module - Expert* - 2019-05-31 Callback, starts with uppercase letters ( PLAYER_, VEHICLE_ ) ex: PLAYER_EnterVehicle. RE: Timers module - Y_Less - 2019-05-31 Callbacks start with "On". RE: Timers module - Expert* - 2019-06-03 *that's how i prefer to name my callbacks* I started to name them like this because "OnPlayerLogin" was taken by y_users. RE: Timers module - Roth - 2019-06-06 Incredible, very good job. RE: Timers module - BoNNe - 2019-06-07 great job RE: Timers module - TroyST - 2019-06-09 Well done wise man! RE: Timers module - Sasino97 - 2019-06-11 I hope?this one to?work when passing strings as parameters, lol. (2019-05-23, 06:59 PM)BigETI Wrote: Think it having two names: The prefix is the library or module the function is from and the suffix is the actual function name. The underscore just seperates both names. That is how it should be :D Then I will Code: #define Timer. Timer_ RE: Timers module - Markski - 2019-06-11 This is really good. Just some days ago I was considering making an include (based on samp-precise-timers) for functions to have a limited loop lifetime without needing to have such logic to kill the timer on each public. Glad to see this is being done for the OG native. RE: Timers module - [SF]kAn3 - 2019-10-02 So should I stop using y_timers? RE: Timers module - 2KY - 2020-04-24 Very nice improvements to the code. Thanks! RE: Timers module - EvilShadeZ - 2020-04-25 I think this module is missing Timer_SetCallsRemaining(Timer:timer,calls); This would be very useful for adjusting how many calls are left. Useful for shortening / extending repeating timers. Absolutely loving timers in microseconds. How accurate are they compared to SA-MP timers? |