SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 07/05/2013, 12:37 PM   #1
Dan..
Gangsta
 
Join Date: Jun 2012
Location: Galati, Romania
Posts: 521
Reputation: 122
Default Timerfix plugin - A fix for every ttime related issue


Timerfix

Timerfix provides an improvement (increases the accuracy) to the timers system existent in SA-MP server.

Building
  • Windows: Open the samp-plugin-timerfix.sln and hit the `Build` button. Binaries will be located in the bin/ folder and will have the name timerfix.dll.
  • Linux: Type in terminal make. Binaries will be located in the bin/ folder and will have the name timerfix.so.

Installing
  1. Move the binaries in the plugins/ folder.
  2. Write timerfix (Windows) or timerfix.so (Linux) in the server.cfg at the end of the line containing plugins.
  3. Add the #include <timerfix> at the top of the script only if you want to use additional methods added.

Notes
  1. This plugin fixes the basic timer system existent in SA:MP (SetTimer, SetTimerEx, KillTimer) and GetTickCount.
  2. This plugin also adds new natives (player timers, which are automatically killed when the player disconnects; there is a hook in the include file), which require `timerfix` include file.

Benchmarks
I haven't done any yet.

For downloads please check the downloads branch for anything else check the project on Github.com
__________________
I'm no longer visiting these forums. BlueG, you can suck my dick.

Last edited by Dan..; 04/08/2013 at 12:26 PM.
Dan.. is offline   Reply With Quote
Old 07/05/2013, 07:13 PM   #2
[DFE]Ike
Big Clucker
 
[DFE]Ike's Avatar
 
Join Date: Oct 2008
Location: Germany
Posts: 61
Reputation: 8
Default AW: Timerfix plugin - A fix for every ttime related issue

Change
Code:
#if defined TIMERFIX_OnPlayerDisconnect
		return TIMERFIX_OnPlayerDisconnect(playerid);
to
Code:
#if defined TIMERFIX_OnPlayerDisconnect
		return TIMERFIX_OnPlayerDisconnect(playerid, reason);
EDIT: + Add something like "KillPlayerTimer(timerid)", because I don't want to define for every PlayerTimer the delay untill the PlayerTimer is deleted. KillPlayerTimers delete all PlayerTimers, that's useless for me.
__________________
[DFE]Ike is offline   Reply With Quote
Old 07/05/2013, 08:11 PM   #3
Bicentric
Big Clucker
 
Join Date: Sep 2012
Posts: 145
Reputation: 36
Default Re: Timerfix plugin - A fix for every ttime related issue

Looks good! Might actually consider using it, I want to see some benchmarks first
Bicentric is offline   Reply With Quote
Old 07/05/2013, 08:51 PM   #4
ikey07
High-roller
 
ikey07's Avatar
 
Join Date: Jul 2010
Location: Latvia,Riga
Posts: 1,364
Reputation: 180
Default Re: Timerfix plugin - A fix for every ttime related issue

Definitely will try
__________________
ikey07 is offline   Reply With Quote
Old 07/05/2013, 09:15 PM   #5
Rock
Huge Clucker
 
Rock's Avatar
 
Join Date: Feb 2013
Location: C:\Windows\Rock.dll
Posts: 333
Reputation: 29
Default Re: Timerfix plugin - A fix for every ttime related issue

I'm waiting for some benchmarking against fixes2.
__________________
Just Rock
Rock is offline   Reply With Quote
Old 07/05/2013, 10:14 PM   #6
OpticKiller
Banned
 
Join Date: May 2013
Location: N/A
Posts: 559
Reputation: -13
Default Re: Timerfix plugin - A fix for every ttime related issue

May I ask what this thing does?
OpticKiller is offline   Reply With Quote
Old 08/05/2013, 04:24 PM   #7
Dan..
Gangsta
 
Join Date: Jun 2012
Location: Galati, Romania
Posts: 521
Reputation: 122
Default Re: Timerfix plugin - A fix for every ttime related issue

Quote:
Originally Posted by [DFE]Ike View Post
Change
Code:
#if defined TIMERFIX_OnPlayerDisconnect
		return TIMERFIX_OnPlayerDisconnect(playerid);
to
Code:
#if defined TIMERFIX_OnPlayerDisconnect
		return TIMERFIX_OnPlayerDisconnect(playerid, reason);
EDIT: + Add something like "KillPlayerTimer(timerid)", because I don't want to define for every PlayerTimer the delay untill the PlayerTimer is deleted. KillPlayerTimers delete all PlayerTimers, that's useless for me.
KillTimer(timerid) works for player timers too!

Quote:
Originally Posted by Bicentric View Post
Looks good! Might actually consider using it, I want to see some benchmarks first
Quote:
Originally Posted by Rockk View Post
I'm waiting for some benchmarking against fixes2.
Why? This is as fast as the basic timer system and Y_Less's plugin.

Quote:
Originally Posted by OpticKiller View Post
May I ask what this thing does?
SA-MP timers and all time related functions aren't as accurate as you may think. This fixes them.
__________________
I'm no longer visiting these forums. BlueG, you can suck my dick.
Dan.. is offline   Reply With Quote
Old 07/05/2013, 10:54 PM   #8
Pooh7
Huge Clucker
 
Pooh7's Avatar
 
Join Date: Aug 2010
Location: Serbia
Posts: 379
Reputation: 22
Default Re: Timerfix plugin - A fix for every ttime related issue

Quote:
Originally Posted by SA-MP Wiki
Timer intervals are not accurate (roughly 25% off). There are fixes available for this on the SA-MP forums.
Apparently, this is one of the fixes.
__________________
Pooh7 is offline   Reply With Quote
Old 08/05/2013, 04:27 PM   #9
Cell_
Big Clucker
 
Join Date: May 2012
Posts: 121
Reputation: 29
Default Re: Timerfix plugin - A fix for every ttime related issue

I am pretty content with Slice's include: http://forum.sa-mp.com/showthread.php?t=289675 . Why should I use this over that include, if you can please explain?
__________________
Cell_ is offline   Reply With Quote
Old 08/05/2013, 04:34 PM   #10
Dan..
Gangsta
 
Join Date: Jun 2012
Location: Galati, Romania
Posts: 521
Reputation: 122
Default Re: Timerfix plugin - A fix for every ttime related issue

Quote:
Originally Posted by Cell_ View Post
I am pretty content with Slice's include: http://forum.sa-mp.com/showthread.php?t=289675 . Why should I use this over that include, if you can please explain?
It is faster, uses less resources, fixes more issues, adds new features.
__________________
I'm no longer visiting these forums. BlueG, you can suck my dick.
Dan.. is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Idea to avoid all this rep related issue matty1415 General 40 25/04/2013 04:03 AM
Streamer Plugin Issue [rG]Cold Scripting Help 2 20/12/2012 05:23 PM
[PROBLEM] Probably related to audio plugin blackwave Help Archive 3 30/12/2010 07:05 PM
Win7 Related Issue Johny_James Everything and Nothing 13 11/12/2010 02:41 PM
Server error...Plugin compilation related. XPlatform Plugin Development 1 15/11/2009 12:28 PM


All times are GMT. The time now is 07:43 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.