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



Server time - TiXz0r - 12.05.2015

Hello.

I make this for changing server time (real time).

But when is 0 minute she spam 10 time,becouse this public called by timer every 10 seconds.

Who can help me and say me how to make better function?

Код:
public MedServerTimer1()
{
    new Minute;
    gettime(Minute);
    if(Minute == 0)
    {
    new Hour, Second;
    gettime(Hour,Second);
    if(Second > 15) return 1;
    SetWorldTime(Hour);

	new string[124];
    format(string, sizeof(string),""COL_LIME"[ULN]: "COL_WHITE"Sada je %d sati. Vrijeme je: Vedro.", Hour);
   	SendClientMessageToAll(-1,string);
    }

    return 1;
}



Re: Server time - JaKe Elite - 12.05.2015

What are you trying to do exactly? Are you trying to do something when the time changes to X:00 for example 2:00.

?


Re: Server time - TiXz0r - 12.05.2015

when is 00 minutes change to next hour


Re: Server time - JaKe Elite - 12.05.2015

You could try this.

PHP код:
public MedServerTimer1()
{
    new 
HourSecondMinute;
    
gettime(HourMinuteSecond);
    if(
Hour >= && Minute == && Second == 0)
    {
        
SetWorldTime(Hour);

        new 
string[124];
        
format(stringsizeof(string),""COL_LIME"[ULN]: "COL_WHITE"Sada je %d sati. Vrijeme je: Vedro."Hour);
           
SendClientMessageToAll(-1,string);
    }
    return 
1;




Re: Server time - TiXz0r - 12.05.2015

Thanks but im fixed rep+