Timer question
#1

Hello, is there a way to detect if a timer still running ?
Reply
#2

Yes, set a variable, when the timer starts, assign the variable as 1 as simple as that, if you didn't get it I'll write you an example.
Reply
#3

Hey danice, i'll be gratefull if you give me an example.
Reply
#4

Danice for a good explanation give them a example i'll give you the example
:
pawn Код:
forward MyTimer();
new MyVariable[MAX_PLAYERS]; // let's create the function

public MyTimer()
{
    MyVariable[playerid] = 1;
    return 1;
}

// To use the timer
SetTimer("MyTimer", time, false / true);

// Now let's verify if the variable is 1
if(MyVariable[playerid] == 1)
{
    // doo something here //
   return 1;
}
This is just a example i hope i helped you!
REGARDS!~~
Reply
#5

pawn Код:
forward MyTimer();
new MyVariable = 0; // let's create the function

public MyTimer()
{
    MyVariable= 1;
    return 1;
}

// To use the timer
SetTimer("MyTimer", time, false / true);

// Now let's verify if the variable is 1
if(MyVariable == 1)
{
    // doo something here //
   return 1;
}
It shouldn't be MAX_PLAYERS since it's a timer not a player, and it's only one timer, not 1 timer for each player, however your example overall is right.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)