Timer problem
#1

I have problem with timer. I want it to go from 180 to 0.
PHP код:
forward Mission1TimeOut(playerid);
public 
Mission1TimeOut(playerid)
{
    new 
time 180;
    if(
time >= 1)
    {
        
TimeLeftTimer(playerid);
        new 
string[5];
        
time -= 1;
        
format(stringsizeof(string), "%i"time);
        
PlayerTextDrawSetString(playeridTimerTD[playerid][1], string);
    }
    else
    {
        
time 0;
    }
    return 
1;

It goes to 179 and stops there
I also tried with
PHP код:
time --; 
But still the same

Here is SetTimerEx
PHP код:
Mission1TimeTimer SetTimerEx("Mission1TimeOut"1000false"i"playerid); 
What could be the problem?
Reply
#2

Fixed.. Problem was that this
PHP код:
new time 180
Should be global because every time timer is called new 180 is created..

DAMN i was stupid
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)