SA-MP Forums Archive
Real world 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: Real world time. (/showthread.php?tid=331433)



Real world time. - DannySnoopy - 04.04.2012

Hello guys, i have a problem, that all day and night, i have the same server time (i have a clock that works fine).
But my point is , i want at the morning to be morning time, and at night night time. what i have now is
for example 22:30 -> day time on the server.

+1 rep for helpers!


Respuesta: Real world time. - admantis - 04.04.2012

you have to use SetWorldTime to actually change the visual time of your server, and you can use gettime function, storing the hour in a variable, and setting the world time to that hour. it's not hard, if you place it under a timer (1 hour) for example.


Re: Respuesta: Real world time. - DannySnoopy - 04.04.2012

Quote:
Originally Posted by admantis
Посмотреть сообщение
you have to use SetWorldTime to actually change the visual time of your server, and you can use gettime function, storing the hour in a variable, and setting the world time to that hour. it's not hard, if you place it under a timer (1 hour) for example.
Ye i'v tried it, but it never appeared on the server.


Re: Real world time. - KeeWitness - 04.04.2012

In your main filterscripts folder, When you install the server

You should have something like gl_realtime, or W/E tries it.


Re: Real world time. - aRoach - 04.04.2012

pawn Код:
public OnPlayerUpdate( playerid )
{
    new Time[ 2 ];
    gettime( Time[ 0 ], Time[ 1 ] );
    SetPlayerTime( playerid, Time[ 0 ], Time[ 1 ] );

    return 1;
}
But is better to creata a timer caled every minute to do this...


Re: Real world time. - [HiC]TheKiller - 04.04.2012

Take a look in your filterscripts directory in gl_realtime. It comes with the sa-mp server and it shows you how to make a real time clock.


Re: Real world time. - KeeWitness - 04.04.2012

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
Take a look in your filterscripts directory in gl_realtime. It comes with the sa-mp server and it shows you how to make a real time clock.
Why are you copying what i just said?


Re: Real world time. - TzAkS. - 04.04.2012

Quote:
Originally Posted by aRoach
Посмотреть сообщение
pawn Код:
public OnPlayerUpdate( playerid )
{
    new Time[ 2 ];
    gettime( Time[ 0 ], Time[ 1 ] );
    SetPlayerTime( playerid, Time[ 0 ], Time[ 1 ] );

    return 1;
}
But is better to creata a timer caled every minute to do this...
Yes,or on Pay Day wich is came on every hour.


Re: Real world time. - DannySnoopy - 04.04.2012

It's ok i solved it by my self, thanks anyways.