SA-MP Forums Archive
Need help with clock. - 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: Need help with clock. (/showthread.php?tid=389076)



Need help with clock. - tuuler - 31.10.2012

Hi, so my country summer clock time is over, and now its back to normal, how can i get my clock back 2 hours ? Please help

My clock:
(If you need something else to make it, please comment below)

pawn Код:
My gettime
new year,month,day; getdate(year, month, day);
new hour,minuite,second;    gettime(hour,minuite,second);

My textdraw
       txtTimeDisp = TextDrawCreate(550.000000, 21.000000, "00:00");
    TextDrawBackgroundColor(txtTimeDisp, 255);
    TextDrawFont(txtTimeDisp, 3);
    TextDrawLetterSize(txtTimeDisp, 0.569999, 2.299999);
    TextDrawColor(txtTimeDisp, -1);
    TextDrawSetOutline(txtTimeDisp, 1);
    TextDrawSetProportional(txtTimeDisp, 1);


public UpdateTime()
{
    gettime(HOUR, MINUTE);
    format(timestr,32,"%02d:%02d",HOUR,MINUTE);
    TextDrawSetString(txtTimeDisp,timestr);

    //SetWorldTime(HOUR);

    new x=0;
    while(x!=MAX_PLAYERS) {
        if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) {
            //SetPlayerTime(x,HOUR,MINUTE);
         }
         x++;
    }
}



AW: Need help with clock. - Skimmer - 31.10.2012

Why you don't use gettime() function under UpdateTime() ?

pawn Код:
gettime(hour,minuite,second);
The server knows your location and sets the time automatically to current time.


Re: Need help with clock. - tuuler - 31.10.2012

I know, but it's still 2 hours ahead, i know my country servers what have that problem fix'd.


Re: Need help with clock. - tuuler - 31.10.2012

Please help !