help bugged
#1

Need help my count down timer

i want numbers will not go in "-" sign instead if they are 0 and the other are 0 they will not be changed
pawn Код:
public OnPlayerTimeUpdate(playerid)
{
   
    pData[playerid][pSeconds] =- 1;
    if(pData[playerid][pSeconds] == 0)
    {
        pData[playerid][pMinutes] =- 1;
        pData[playerid][pSeconds] =  60;
    }
    if(pData[playerid][pMinutes] == 0)
    {
        pData[playerid][pHours] =- 1;
        pData[playerid][pMinutes] = 60;
    }
    if(pData[playerid][pHours] == 0)
    {
        pData[playerid][pDays] =- 1;
        pData[playerid][pHours] = 24;
    }
    if(pData[playerid][pDays] == 0)
    {
        pData[playerid][pWeeks] =- 1;
        pData[playerid][pDays] = 7;
    }
    if(pData[playerid][pWeeks] == 0)
    {
        pData[playerid][pMonths] =- 0;
        pData[playerid][pWeeks] = 7;
    }
    if(pData[playerid][pMonths] == 0)
    {
        pData[playerid][pMonths] = 12;
        pData[playerid][pYears] =- 1;
    }
    if(pData[playerid][pYears] == 0 && pData[playerid][pMonths] == 0 && pData[playerid][pWeeks] == 0 && pData[playerid][pDays] == 0 && pData[playerid][pHours] == 0 && pData[playerid][pMinutes] == 0 && pData[playerid][pSeconds] == 0)
    {
        SCM(playerid,C_RED,"You have died because you have ran out of time");
        return Kick(playerid);
    }
    return 1;
}
Reply
#2

You can't do it like that because you using in
Код:
 pData[playerid][pSeconds] =- 1;
before the check if the player's seconds == 0 and you complate before to -1...
Reply
#3

Quote:
Originally Posted by Accord
Посмотреть сообщение
You can't do it like that because you using in
Код:
 pData[playerid][pSeconds] =- 1;
before the check if the player's seconds == 0 and you complate before to -1...
are you sure?

maybe there are other ways
Reply
#4

what are you tried to do?
Reply
#5

i mean if the
hours is 0 and the minutes is 6 and the seconds ranout it will get
and not making the minutes to -1
i want it like that

its like a huge timer system or countdown system
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)