SA-MP Forums Archive
Several questions - 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: Several questions (/showthread.php?tid=78579)



Several questions - Rks25 - 21.05.2009

like new minutes =3 ;
and new seconds = 60;

But what i need is when it becomes 3 or 2 (the minutes) , it should display as 02 or 03, and same for seconds, when seconds become 8 or 9, they should show like 08 or 09.. how to do?


Re: Several questions - .::: Ecko :::. - 21.05.2009

amm it's possible btw. amm u want to be shown in gamemodetext?

Ecko


Re: Several questions - Rks25 - 21.05.2009

yes


Re: Several questions - pspleo - 21.05.2009

Quote:
Originally Posted by .::: Ecko :::.
amm it's possible btw. amm u want to be shown in gamemodetext?

Ecko
I suggest you go learn some english...

I would do it like this.
pawn Код:
if(minutes < 10) //9 and down
{
   format(whatever, sizeof whatever, "0%d", minutes);
}
Same with seconds.

Leopard


Re: Several questions - Andom - 21.05.2009

use %02d instead of %d, then it will always be 2 numbers (like 15, or 09)