Posts: 815
Threads: 127
Joined: May 2011
Reputation:
0
Looks nice. Have you tested it out? Is it very accurate?
Posts: 579
Threads: 5
Joined: Oct 2015
I'd suggest hooking the SetTimer functions and call the plugin's instead in the include, and provide an option to disable that as it's either to use as a plug-play instead of replacing function names, ...
Other than that, good job!
Posts: 58
Threads: 2
Joined: Feb 2018
Reputation:
0
Plugin updated to version 0.6
- Added hook Timer's natives
Posts: 2
Threads: 0
Joined: Mar 2018
Quote:
Originally Posted by KashCherry
Timer Fix v0.7
Description
This plugin makes timers more accurate
Natives
PHP Code:
native SetTimer(funcname[], interval, bool:repeat);
native SetTimerEx(funcname[], interval, bool:repeat, const format[], {Float,_}:...);
native KillTimer(const id);
native KillAllTimers();
Example
PHP Code:
#include <timerfix>
new num = 0;
new timer;
main() {
timer = SetTimer("callback",1000,true)
}
forward callback();
public callback() {
if(++num >= 5) {
KillTimer(timer);
SetTimerEx("callbackEx",1000,false,"d",num);
}
}
forward callbackEx(num);
public callbackEx(num) {
printf("Num: %d",num);
KillAllTimers();
}
Download
Binaries(Windows, Linux)
Source code
|
the idea is good ... but when I put this plugin the server blocks the players from connecting.
Code:
[10:57:29] Loading plugin: timerfix.so
[10:57:29] Timer Fix plugin v0.7 by KashCherry loaded
[10:57:29] Loaded.
[10:57:29] Loaded 9 plugins.
[10:57:29]
[10:57:29] Filterscripts
[10:57:29] ---------------
[10:57:29] Loaded 0 filterscripts.
[10:57:30] MySQL baza, a fost conectata!
[10:57:30]
-----------
Vehicle: 156
MaterialObjects: 112
Objects: 750
DynamicObjects: 2424
Pickps: 20
-----------
[10:57:30] Number of vehicle models: 46
[10:58:24] Kicking 92.119.39.147 because they didn't logon to the game.
[10:58:24] Kicking 200.53.203.103 because they didn't logon to the game.
[10:58:30] [connection] incoming connection: 200.53.203.103:29209 id: 0
[10:58:30] Invalid client connecting from 200.53.203.103
[10:58:30] [connection] incoming connection: 92.119.39.147:54599 id: 1
[10:58:30] [connection] incoming connection: 200.53.203.103:29217 id: 2
[10:58:30] Invalid client connecting from 92.119.39.147
[10:58:30] Invalid client connecting from 200.53.203.103
Posts: 2
Threads: 0
Joined: Mar 2018
16.03.2018, 16:22
(
Last edited by Dim4Shift; 16/03/2018 at 05:01 PM.
)
Quote:
Originally Posted by KashCherry
Fixed, download from here.
|
WOW nice ++! is posible add
native IsValidTimer(timerid); ? to bypass this error:
Code:
[12:15:08] [Timer Fix] KillTimer: cannot find timer with id 0
exemple pawn code:
Code:
#define INVALID_TIMER_ID (0xFFFF)
stock IsValidTimer(timerid) {
if(timerid != INVALID_TIMER_ID) return true;
return false;
}
Posts: 115
Threads: 0
Joined: Mar 2018
Quote:
Originally Posted by m4karow
I use some a few fast timer for animation callbacks, and maybe it will useful for me. i'll try it, thanks!
hmm, okay
Code:
[2018/03/23 14:36:01] [Timer Fix] Cannot call function [EL: 1]
[2018/03/23 14:36:01] [Timer Fix] Cannot call function [EL: 1]
and is there any way to find out which timer have to be killed? a log like in mysql plugin or something like that?
Code:
[2018/03/23 14:36:01] [Timer Fix] KillTimer: cannot find timer with id 0
this could be very useful for bug-fixing
|
[2018/03/23 14:36:01] [Timer Fix] KillTimer: cannot find timer with id 0
Code:
if(IsValidTimer(timerid)) KillTimer(timerid);
[2018/03/23 14:36:01] [Timer Fix] Cannot call function [EL: 1]
create, please function...
exemple:
Code:
new timerid;
public OnGameModeInit()
{
timerid = SetTimer("UpDate",1000, true);
return true;
}
forward UpDate();
public UpDate()
{
if(IsValidTimer(timerid)) KillTimer(timerid);
return true;
}
Posts: 287
Threads: 51
Joined: Oct 2015
Reputation:
0
incs: y iters, discord connector, profiler, crashdetect sscanf mysql, 3dtryg, mapandreas, progressbar, smartcmd, audio etc
plugins crashdetect mysql sscanf streamer audio MapAndreas profiler discord-connector
Posts: 57
Threads: 6
Joined: Nov 2015
Reputation:
0
when I reload gamemode with gmx in the console starts flooding
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:51] [Timer Fix] Timer executing failed
[16:16:52] [Timer Fix] Timer executing failed
[16:16:52] [Timer Fix] Timer executing failed
[16:16:52] [Timer Fix] Timer executing failed
[16:16:52] [Timer Fix] Timer executing failed
Posts: 1,349
Threads: 194
Joined: Jan 2014
Reputation:
0
^^ Reason I'm not using it while I will love too when it's fixed.
Posts: 7
Threads: 0
Joined: Mar 2012
Reputation:
0
There are things I need in this plugin.
GetTimerInterval
SetTimerInterval
SetTimerDelay
These are available in udan's plugin. Can it be added here?
Posts: 7
Threads: 0
Joined: Mar 2012
Reputation:
0
Thanks @KashCherry
I have a problem with KillTimer function. Can you check please?