SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 17/09/2019, 01:10 PM   #111
gurmani11
Huge Clucker
 
gurmani11's Avatar
 
Join Date: Dec 2012
Location: Lucid Dreams
Posts: 355
Reputation: 18
Default Re: Timer Fix

Moreover, this plugin stops working and a global timer stops ticking. However, if we run other plugins after one is dead, they work
__________________
EPHEMERAL
gurmani11 is offline   Reply With Quote
Old 13/01/2020, 07:50 PM   #112
KashCherry
Big Clucker
 
KashCherry's Avatar
 
Join Date: Feb 2018
Location: Estonia
Posts: 60
Reputation: 30
Default Re: Timer Fix

Plugin updated to version 1.1.1

Fixed:
- Fixed the problem when timers just stopped.
- Fixed the problem when the callback was called after the timer was deleted.

Added:
- Now you can pause the timer and continue it in the future.
Example:
PHP Code:
#include <timerfix>

new timer[MAX_PLAYERS];

forward WhileNotInVehicle(playerid);
public 
WhileNotInVehicle(playerid)
{
    return 
1;
}

public 
OnPlayerSpawn(playerid)
{
    
timer[playerid] = SetTimerEx("WhileNotInVehicle"1000true"i"playerid);
}

public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    
PauseTimer(timer[playerid]);
}

public 
OnPlayerExitVehicle(playeridvehicleid)
{
    
ContinueTimer(timer[playerid]);

- You can add additional callbacks for one timer.
Example:
PHP Code:
#include <timerfix>

forward CallbackOne(number);
public 
CallbackOne(number)
{
    
printf("[CallbackOne] Number is %d"number);
}

forward CallbackTwo(number);
public 
CallbackTwo(number)
{
    
printf("[CallbackTwo] Number is %d"number);
}

public 
OnGameModeInit()
{
    new 
timer SetTimerEx("CallbackOne"1000false"i"727);
    
// The same arguments will be passed for both callbacks.
    
AddTimerHandler(timer"CallbackTwo");

- Also added the custom timers with count of executions and delay before the timer starts.
Example:
PHP Code:
#include <timerfix>

new timer;

forward CallbackOne(number);
public 
CallbackOne(number)
{
    
printf("[CallbackOne] Number is %d"number);
}

forward CallbackTwo(number);
public 
CallbackTwo(number)
{
    
printf("[CallbackTwo] Number is %d"number);
    
KillTimer(timer);
}

public 
OnGameModeInit()
{
    
// Set the count to -1 for infinite timer
    
timer SetCustomTimerEx("CallbackOne"10005005"i"800);
    
// The same arguments will be passed for both callbacks.
    
AddTimerHandler(timer"CallbackTwo");

Report about any bugs here please.
KashCherry is offline   Reply With Quote
Old 14/01/2020, 04:19 PM   #113
KashCherry
Big Clucker
 
KashCherry's Avatar
 
Join Date: Feb 2018
Location: Estonia
Posts: 60
Reputation: 30
Default Re: Timer Fix

Release updated with this issue fix. Download the latest release again please.

Report about any bugs here please.
KashCherry is offline   Reply With Quote
Old 17/01/2020, 09:53 AM   #114
TokicMajstor
Huge Clucker
 
TokicMajstor's Avatar
 
Join Date: Oct 2018
Location: Bosnia And Herzegovina
Posts: 212
Reputation: 10
Default Re: Timer Fix

Very nice job, this could be useful
__________________

My work:
-MapTD - GTA SA Map on a TextDraw

https://forum.sa-mp.com/showthread.php?t=671806
TokicMajstor is offline   Reply With Quote
Old 06/02/2020, 09:15 PM   #115
UserName12
Little Clucker
 
Join Date: Oct 2015
Posts: 15
Reputation: 0
Default Re: Timer Fix

Quote:
Originally Posted by KashCherry View Post
- Fixed the problem when timers just stopped.
Well it is not fixed.

My server was running ~16h40mins and then global timer stopped
UserName12 is online now   Reply With Quote
Old 05/03/2020, 10:10 AM   #116
WestCoast1337
Little Clucker
 
Join Date: Oct 2019
Posts: 32
Reputation: 0
Default Re: Timer Fix

Quote:
Originally Posted by UserName12 View Post
Well it is not fixed.

My server was running ~16h40mins and then global timer stopped
The problem is relevant
WestCoast1337 is offline   Reply With Quote
Old 01/05/2020, 12:00 AM   #117
RudeWorld
Little Clucker
 
RudeWorld's Avatar
 
Join Date: Aug 2018
Posts: 19
Reputation: 0
Default Re: Timer Fix

error while processing timer: cannot execute public 'Malloc_SolidifyTimer'
how do i fix this?
RudeWorld is offline   Reply With Quote
Old 25/05/2020, 02:53 PM   #118
DmitriyShift
Little Clucker
 
DmitriyShift's Avatar
 
Join Date: Jun 2019
Posts: 38
Reputation: 3
Default Re: Timer Fix

if we put a timer

exemple:
PHP Code:
SetTimer("PlayerUpDate",10001); 
the timer stops a few minutes later.
__________________
DmitriyShift is offline   Reply With Quote
Old 26/05/2020, 04:38 PM   #119
Unrea1
Gangsta
 
Unrea1's Avatar
 
Join Date: Oct 2013
Location: Venezuela
Posts: 810
Reputation: 126
Default Re: Timer Fix

What is this?

[timerfix.plugin] n_SetTimerEx: bad parameter count (count is 4, should be greater than 5)
__________________
Unrea1 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
Timer ID stored in a variable gets wiped when timer hits ? NeXoR Scripting Help 2 25/03/2017 07:22 PM
Performance Question , Per Player Timer vs Timer that loops through all players BiosMarcel Scripting Help 14 12/12/2016 09:50 AM
If /foodsearch doesn't find item, set wait timer (TIMER HELP) Josh_Main Scripting Help 7 14/09/2016 04:13 PM
Which is better Per Player Timer or Global timer? (issue with timer) Dokins Scripting Help 4 07/06/2016 09:50 AM
Slice's Timer Fix include --> timer public function isn't getting called Riwerry Scripting Help 0 02/01/2016 03:50 PM


All times are GMT. The time now is 03:15 PM.


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