Sync Time
#1

How can i sync the clock that shows when you TogglePlayerClock(1); With the Computer time, Like it shows the hour and the Min.

So for example It's 4:24 my time, The clock in game will show 4:24. Basically it sets that clock to the computers clock the server is hosted on, I've tried GetTime and all that but it only seems to sync the Mins. and the seconds. I've searched the forums but i couldn't find anything usefull, I'm sure it's very simple I just can't figure it out
Reply
#2

Use GetTime, then if minutes = 60, set it to 0 and add 1 value to hours.. ?
Reply
#3

GetTime, Sets the TogglePlayerClock clock?... As of now i have a /time command which is sync with my computer time. It's Copied from the orginal Pen:Ls Scirpt.

pawn Код:
forward SyncTime();
public SyncTime()
{
    if (gdebug >= 3){printf("DEBUG SyncTime()"); }
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    new string[64];
    new tmphour;
    new tmpminute;
    new tmpsecond;
    gettime(tmphour, tmpminute, tmpsecond);
    FixHour(tmphour);
    tmphour = shifthour;
    if ((tmphour > ghour) || (tmphour == 0 && ghour == 23)) {
        PayDay();
        format(string, sizeof(string), "SERVER: The Time Is Now %d:00 Hours",tmphour);
        BroadCast(COLOR_WHITE,string);
        if (gdebug){printf("DEBUG tmphour=%d ghour=%d",tmphour,ghour);}
        ghour = tmphour;
        if (realtime) {
            SetWorldTime(tmphour);
            //SetPlayerTime(i,tmphour,tmpminute);
        }
    }
}
}
When when i TogglePlayerClock it just counts by seconds and mins. As you can tell i have tried to set it with SetplayerTime Also.
Reply
#4

Quote:
Originally Posted by ihatetn931
Посмотреть сообщение
How can i sync the clock that shows when you TogglePlayerClock(1); With the Computer time, Like it shows the hour and the Min.

So for example It's 4:24 my time, The clock in game will show 4:24. Basically it sets that clock to the computers clock the server is hosted on, I've tried GetTime and all that but it only seems to sync the Mins. and the seconds. I've searched the forums but i couldn't find anything usefull, I'm sure it's very simple I just can't figure it out


TogglePlayerClock(1); is for thing what he do, you can't sync it with real time, you must use GetTime, use glTime or something like that Filterscript there is TextDraw wich looks like SP clock but, but uses real time
Reply
#5

As I posted in the topic above this one:
Why not use the realtime fs which is included in the server package? I believe that's working fully.
Reply
#6

Oh so i can only do it with a textdraw, Ahh darn I was hoping i could make my weather change smoother with TogglePlayerClock and it showing the real time. I guess i have to deal with the weather changing instantly
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)