PDA

View Full Version : Clock always displays 12:0


lramos15
11/08/2013, 05:26 PM
I made a /time command with this GetPlayerTime(playerid,hour,minutes);
format(string,128,"~b~~h~%i:%i",hour,minutes);
GameTextForPlayer(playerid, string, 3000, 1);
but it always displays just 12:0

Emmet_
11/08/2013, 06:24 PM
It should be this:


GetPlayerTime(playerid, hour, minutes);
format(string, 128, "~b~~h~%02d:%02d", hour,minutes);
GameTextForPlayer(playerid, string, 3000, 1);


And GetPlayerTime only works if you've used TogglePlayerClock or SetPlayerTime.

IstuntmanI
11/08/2013, 06:25 PM
GetPlayerTime returns the in-game time of that player, if you want the real time, you have to use gettime.