Clock always displays 12:0 - 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: Clock always displays 12:0 (
/showthread.php?tid=457446)
Clock always displays 12:0 -
lramos15 - 11.08.2013
I made a /time command with this
Код HTML:
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
Re: Clock always displays 12:0 - Emmet_ - 11.08.2013
It should be this:
pawn Код:
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.
Re: Clock always displays 12:0 -
IstuntmanI - 11.08.2013
GetPlayerTime returns the in-game time of that player, if you want the real time, you have to use gettime.