Timer Countdown [ huge timer's ]
#1

Guys i have trouble with timers i will not work or it will turn the number's into negative
i have this one

pawn Code:
Seconds[playerid]
Minutes[playerid]
Hours[playerid]
Days[playerid]
Weeks[playerid]
Months[playerid]
years[playerid]
my problem is it will not work on Minutes
it will turn the seconds on negative
and if i change everything
it will change the years into negative
i want that when all are equivalent to 0 it will stop
but how i am freakin dont know

or work perfectly
Reply
#2

Why dont you show us a piece of that damn code?
Reply
#3

if I understood you right, then create a loop timer* contains the negative "what ever", or if you want it becomes less every second, just put the negative you want.

pawn Code:
forward LessTimer();
public LessTime()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        Seconds[i]-- //seconds will be -1 for all players
    }
    return 1;
}

OnGameModeInit()
{
    SetTimer("LessTime", 1000, true);
   // every second LessTime will be re-called, you can just place *LessTime* underneath OnPlayerUpdate and remove that line ^^
    return 1;
}
This is just an example/tips may help you.
Reply
#4

What are you gonna use them for?
Reply
#5

but how about for the hours and all of them?


Quote:

I got a friend who wants me to make a game mode and i dont trust him if he will pay or not
so i will secretely put this as an expiration date

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)