SA-MP Forums Archive
help bugged - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help bugged (/showthread.php?tid=339605)



help bugged - RicaNiel - 04.05.2012

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;
}



Re: help bugged - Accord - 04.05.2012

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...


Re: help bugged - RicaNiel - 04.05.2012

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


Re: help bugged - Accord - 04.05.2012

what are you tried to do?


Re: help bugged - RicaNiel - 04.05.2012

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