*-- Gametime System - 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: *-- Gametime System (
/showthread.php?tid=121426)
*-- Gametime System -
Memoryz - 16.01.2010
Hello, I like how the GTA: SA time works and instead of using realworld time, I want to make a new time system for my roleplaying script.
Anyways,
for every 10 minutes, the server time increases by 1 hour.
I know it would be using timers, but how can I get the current time on the server, and then add an hour to it?
Re: *-- Gametime System -
ray187 - 16.01.2010
Code:
new mins,hour,secs;
gettime(hour,mins,secs);
SetWorldTime(hour+1);
Re: *-- Gametime System -
smeti - 16.01.2010
Quote:
Originally Posted by ray187
Code:
new mins,hour,secs;
gettime(hour,mins,secs);
SetWorldTime(hour+1);
|
pawn Code:
new
Hour;
gettime(Hour);
SetWorldTime(Hour+1);
Re: *-- Gametime System -
Memoryz - 17.01.2010
I've tried that, but it just gets the realworld time and adds an hour to it.
Re: *-- Gametime System -
Sascha - 17.01.2010
lol i have the same problem as you
Re: *-- Gametime System -
MadeMan - 17.01.2010
pawn Code:
new GameHour;
forward UpdateTime();
public UpdateTime()
{
GameHour++;
if(GameHour >= 24)
{
GameHour = 0;
}
SetWorldTime(GameHour);
}
public OnGameModeInit()
{
SetTimer("UpdateTime", 600000, 1);
return 1;
}