SA-MP Forums Archive
Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help (/showthread.php?tid=632108)



Help - astanalol - 09.04.2017

Hi Guys
i Have Small Problems
my timer textdraw when i use it first time countdown working perfect
next time for me or another player using it countdown #Fast why ? not countdown with 1sec || countdown with 3secs or more in 1sec why ?
PHP код:
stock CreateTimerText()
{
    
CountDownTime 60 10;
    
CountDownTimer SetTimer("counttimer",1000,true);
}
forward counttimer(playerid);
public 
counttimer(playerid)
{
    if(
CountDownTime <= 0)
    {
        
CountDownTime = -1;
        
//TextDrawSetString(TextDraw1, "Mission Failed");
        
CPfailed(playerid);
        
KillTimer(CountDownTimer);
    }
    else
    {
        
CountDownTime--;
        new 
msg[15];
        
format(msgsizeof(msg), "%i:%i"CountDownTime/60CountDownTime%60);
        
TextDrawSetString(Textdraw1msg);
    }
    return 
1;

PHP код:
    Textdraw1 TextDrawCreate(537.000000327.000000"05:10");
    
TextDrawBackgroundColor(Textdraw1255);
    
TextDrawFont(Textdraw13);
    
TextDrawLetterSize(Textdraw10.3300001.200000);
    
TextDrawColor(Textdraw1, -554567169);
    
TextDrawSetOutline(Textdraw11);
    
TextDrawSetProportional(Textdraw11);
    
TextDrawSetSelectable(Textdraw10); 
+rep


Re: Help - Celmir - 09.04.2017

Hello, uhm... I'm not really that good with timers but where`d you use the stock CounterTimerText() , maybe that's the problem. Btw this is for my further knowledge, I have read every tutorial about timers but didn't really helped me


Re: Help - coool - 09.04.2017

Timers are not accurate roughly 25%. But there are fixes available https://sampforum.blast.hk/showthread.php?tid=289675 . A plugins link inside.


Re: Help - astanalol - 09.04.2017

Quote:
Originally Posted by coool
Посмотреть сообщение
Timers are not accurate roughly 25%. But there are fixes available https://sampforum.blast.hk/showthread.php?tid=289675 . A plugins link inside.
i tired it not working still the timer 1st time countdown perfect 2nd etc... countdown Fast


Re: Help - verlaj - 09.04.2017

Use y_timer

https://sampforum.blast.hk/showthread.php?tid=571044


Re: Help - SyS - 09.04.2017

can u show where you calling this function CreateTimerText ?