SA-MP Forums Archive
/time little bug - 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: /time little bug (/showthread.php?tid=571132)



/time little bug - izeatfishz - 16.04.2015

Код:
CMD:time(playerid, params[])
{
	new hh, mm, ss, string[128];
    gettime( hh, mm, ss );
	format(string, sizeof(string), "~g~[~w~%d:%d~g~]", hh, mm);
	GameTextForAll( string, 8000, 1 );
	return 1;
}
It works fine, but say the time IRL is '17:26' it will display it as '17:2' And not the full minutes..?


Re: /time little bug - Azula - 16.04.2015

PHP код:
format(stringsizeof(string), "~g~[~w~%02d:%02d~g~]"hhmm); 



Re: /time little bug - Alpay0098 - 16.04.2015

You can use IF,
For example :
PHP код:
if(hh 10)
{
    
format(stringsizeof(string), "~g~[~w~%02d:%d~g~]"hhmm);
    
GameTextForAllstring8000);

And stuff a like. (You can use it for mm exactly like this)
Good luck.