Real world time.
#1

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!
Reply
#2

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.
Reply
#3

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.
Reply
#4

In your main filterscripts folder, When you install the server

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

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...
Reply
#6

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.
Reply
#7

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?
Reply
#8

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.
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)