Live Time. - 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: Live Time. (
/showthread.php?tid=386237)
Live Time. -
tiernantheman - 19.10.2012
Hey, I've scripted a time system for my server but one problem is, I don't really know how to make it live time. Here's some of my code.
Here's my OnGamemodeInit, were it sets the time, but it's not live, how would I make it live?
Код:
Hour = 12;
Minute = 30;
Second = 1;
ClockTimer = SetTimer("ClockUpdate", 999, 1);
If you need anymore code let me know.
Re: Live Time. - HuSs3n - 19.10.2012
why you dont use Gettime
https://sampwiki.blast.hk/wiki/Gettime
Код:
forward ClockUpdate();
public ClockUpdate()
{
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
printf("%02d:%02d:%02d", Hour, Minute, Second);
}
Re: Live Time. -
tiernantheman - 19.10.2012
Quote:
Originally Posted by HuSs3n
why you dont use Gettime
https://sampwiki.blast.hk/wiki/Gettime
Код:
forward ClockUpdate();
public ClockUpdate()
{
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
printf("%02d:%02d:%02d", Hour, Minute, Second);
}
|
Ahh, there we are I didn't even know about that lol. Thanks bud.