[Plugin] Fixes2 - [Continuous Development]
#1

Fixes2 - 19-04-2015

Next Release Date: 1-5-2015
Next Version: 2.1


I have decided that due to the that Yless has up and left the SAMP community for his reasons that noone is entitled to know unless he tells you, that I will continue to update his Fixes plugin. I personally had a couple of problems with the overall development that certain tasks could be added into this plugin to be fixed.

If you have any problems or bugs please do not be scared to place a message down below or Private Message me. For people who will post down below saying you cannot replace Y_Less, I know that I cant however I will try my best to keep certain plugins going.


ORIGINAL POST
So I decided to write some more function fixes in a plugin as it's simpler. The first on my list were "SetTimer" and "SetTimerEx". Namely the fact that they are not very accurate and that they don't correctly support strings and arrays. Both these problems are now fixed to the best of my ability. I should note that the accuracy is still a little off because of the "sleep" call in the server internally, but they're MUCH better now.

I've also improved their performance through the use of "std :: priority_queue" so the next timers to trigger are always at the top of the list.

A note when passing arrays, as with "CallLocalFunction" you MUST follow the array with its length as an extra parameter or the system has no way to know how big it is:


Code:
SetTimerEx("func", 1000, 0, "ai", arr, sizeof (arr));
These functions are not changed in ANY way, "0" still means "run once", anything else still means "run forever". You don't even need to recompile to use the new versions, just use the plugin.

I've also added two new functions:

Code:
SetTimer_("func", 100, 1000, -1);
SetTimerEx_("func", 100, 1000, -1, "i", 42);
These versions of the function have more control over exactly what you can do. There are now two time parameters - initial delay and interval. So the functions above will be called after 100ms and then every 1000ms after that. This is useful if you have a few global timers so they don't all run at the same time:


Code:
SetTimer_("global1", 250, 1000, -1);
SetTimer_("global2", 500, 1000, -1);
SetTimer_("global3", 750, 1000, -1);
SetTimer_("global4", 1000, 1000, -1);
Those timers will all run once every 1 second, but will all be offset from each other by 250ms. This feature was already provided by y_timers, but is now more native. Additionally, the "repeat" parameter ("-1" above) is now a COUNT. So if you do:

Code:
SetTimer_("global1", 250, 1000, 4);
Then that function will run EXACTLY FOUR times and no more. You can set this parameter to "0", but unlike the normal versions, this means "never run" and is thus pointless! "-1" means "run forever". The natives for these functions are:

Code:
native SetTimer_(const func[], const delay, const interval, const count);
native SetTimerEx_(const func[], const delay, const interval, const count, const format[], {Float, _}:...);
native KillTimer_(timer) = KillTimer;
This plugin is slightly magical: if you use it you don't need to recompile your mode at all. Just add this to your "plugins" line and it will improve all existing timers in all existing modes. Obviously if you want to use the "_" versions of the functions you'll need to change things.


CHANGES / UPDATES

Version 2.1b list to be added on the 1-5-2015 4 hours before the update release

At the moment you will only be able to download the .DLL and .SO due to this will be a continous development in updating the plugin for you all:


VERSION 2.0 FIXES
DROP BOX:
DOWNLOAD CLICK HERE

GITHUB:
https://github.com/CallistoGaming/Fixes2
Reply
#2

Good to see that someone is continuing the development. Great job
Reply
#3

Quote:
Originally Posted by Uberanwar
View Post
Good to see that someone is continuing the development. Great job
Yeah mate, I thought that while he left, most servers still actually require this plugin. Hence why im continuing it, with the added new fixes coming in the next update.
Reply
#4

Great! Please consider using GitHub for code hosting, that way other devs can help you out!
Reply
#5

https://github.com/Southclaw/fixes2

As I can see Zeex already patched one bug, and source is required with releases.
Reply
#6

Thank you very much for this!
Reply
#7

Quote:

I've also improved their performance through the use of "std :: priority_queue" so the next timers to trigger are always at the top of the list.

https://github.com/Southclaw/fixes2/....cpp#L157-L164

This is already a thing that the original fixes2 has.
Reply
#8

I'll be using this! Great work maybe you should keep up with your projects on GitHub might be easyer for you. Rep for your work for continuing the project.
Reply
#9

Quote:
Originally Posted by KingHual
View Post
https://github.com/Southclaw/fixes2/....cpp#L157-L164

This is already a thing that the original fixes2 has.
Please keep in mind that the post above is the original post with the added passage of my statement. Updating the topic tonight - Earlier release of 2.1b will be tomorrow night with a small patch. It will be added to my github though for public eyes
Reply
#10

Fixes 2.1b will be released on Friday, make sure you update your Fixes2 plugin.

This current fixes will be from bug reports I have looked over on the forum section.

Code:
Fixed:
# RemoveBuildingForPlayer BUG (Upon command GMX, the new function calls itself once then removes the items then respawns them.)
# Small In-Game Bugs that are a suprise so download to find out on friday
Reply
#11

Good work man!
Reply
#12

Any word on 2.1b?
Reply
#13

I just wanted to take the time to say thank you this resolved my timers issue 100% so Thank you I hope you keep up the awesome work #LoveToTheSampCommunity
Reply
#14

Are you still developing this?
Reply
#15

I guess I maybe found the bug? I'm having this timer:
pawn Code:
gMaintenanceTimer = SetTimer("UpdateMaintenanceCountdown", 1000, true)
And inside of this public function I'm having KillTimer(gMaintenanceTimer); It's getting called / I don't have it under any condition or smth.
But, timer still going.
Reply
#16

Quote:
Originally Posted by Riwerry
View Post
I guess I maybe found the bug? I'm having this timer:
pawn Code:
gMaintenanceTimer = SetTimer("UpdateMaintenanceCountdown", 1000, true)
And inside of this public function I'm having KillTimer(gMaintenanceTimer); It's getting called / I don't have it under any condition or smth.
But, timer still going.
Having the same issue, if I attempt to kill a timer within the public function it's calling; it won't kill it and constantly keep calling it.

Then again, the last update on this was last year. Figured I'd post here anyways. You should have probably informed everyone you weren't going to continue developing this though.
Reply
#17

Use this plugin instead.
Reply
#18

Quote:
Originally Posted by CantBeJohn
View Post
Having the same issue, if I attempt to kill a timer within the public function it's calling; it won't kill it and constantly keep calling it.

Then again, the last update on this was last year. Figured I'd post here anyways. You should have probably informed everyone you weren't going to continue developing this though.
Don't load the plugin.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)