SA-MP Forums Archive
If(Hour == ..) [reps+] - 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: If(Hour == ..) [reps+] (/showthread.php?tid=502427)



If(Hour == ..) [reps+] - SPA - 23.03.2014

Hi how to ask if the (Hour == [4] ) for example , my idea that everyday at 5 PM or 5 AM server automaticlly show best 4 players as textdraw , i mean instead of making timers i can ask if hour == ... is that good idea and how to do it ? thanks


Re: If(Hour == ..) [reps+] - MP2 - 23.03.2014

It depends if you track time server-sided or not. If you do, of course this is how you would do it.


Re: If(Hour == ..) [reps+] - SPA - 24.03.2014

I m tracking , iv a script which showing the time and date, but how ?


Re: If(Hour == ..) [reps+] - Hanuman - 24.03.2014

pawn Код:
new hrs, min, sec;
forward StartTime();
public StartTime()
{
     sec++;
     if(sec == 60)
     {
        min++;
        sec = 0;
     }
     if(min == 60)
     {
       hrs++;
       mins = 0;
       sec = 0;
     }
     if(hrs == 24)
     {
        hrs = 0;
        min = 0;
        sec = 0;
     }
     if(hrs == this)// your time
     {
         //your codes
     }
     return 1;
}

public OnGamemodeInit()
{
     SetTimer("StartTime", 1000, 1);
     return 1;
}
I am 40% sure that u will get some errors bcuz i haven't tested it. So if u get some errors then try to solve them. In case of failure in solving, then give me the errors.