SA-MP Forums Archive
Problem verification ~x( - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem verification ~x( (/showthread.php?tid=263189)



Problem verification ~x( - eXtrike - 20.06.2011

pawn Код:
forward SecundeLeftUpdater();
public SecundeLeftUpdater()
{
    new
        string[ 10 ];
    switch(SecundeLeft)
    {
        case 00:
        {
            SecundeLeft = 60;
            MinuteLeft--;
            format(string, 10, "0%d", MinuteLeft);
            TextDrawSetString(MinLeft, string);
            UltimateSecond = 0;
        }
        case 10:
        {
            SecundeLeft = 10;
            UltimateSecond = 1;
        }
    }
    if(UltimateSecond == 1)
    {
        SecundeLeft--;
        format(string, 10, "%0d", SecundeLeft);
        TextDrawSetString(SecLeft, string);
        return 1;
    }
    SecundeLeft--;
    format(string, 10, "%d", SecundeLeft);
    TextDrawSetString(SecLeft, string);
    return 1;
}
When arrive at 9 second, is 02:9.
I want 2:09


Re: Problem verification ~x( - =WoR=Varth - 20.06.2011

pawn Код:
SecundeLeft--;
format(string, 10, "0%d", SecundeLeft);
TextDrawSetString(SecLeft, string);
return 1;
Try this.


Re: Problem verification ~x( - eXtrike - 20.06.2011

), my mistake ) in the format is %0d ) wtf )?
Solved.