19.04.2015, 09:32
(
Last edited by Ciandlah; 30/04/2015 at 05:55 AM.
)
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:
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:
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:
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:
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:
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
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));
I've also added two new functions:
Code:
SetTimer_("func", 100, 1000, -1); SetTimerEx_("func", 100, 1000, -1, "i", 42);
Code:
SetTimer_("global1", 250, 1000, -1); SetTimer_("global2", 500, 1000, -1); SetTimer_("global3", 750, 1000, -1); SetTimer_("global4", 1000, 1000, -1);
Code:
SetTimer_("global1", 250, 1000, 4);
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;
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