04.05.2012, 09:51
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
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;
}