#1

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
Reply
#2

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
Reply
#3

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

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
Reply
#5

Use y_timer

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

can u show where you calling this function CreateTimerText ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)