Gettime
#7

You could make a switch:
pawn Код:
select hour
{
    case 20, 21, 22:
    {
        // Your code here
    }
}
If you plan to change the times later on, or add some extra hour-values, you can easily add them to that list.
Otherwise you need to extends and possibly rewrite the entire if-statement.

Perhaps you want to run that code at hour 6 and 15 later on as well, you could easily do:
pawn Код:
select hour
{
    case 6, 15, 20, 21, 22:
    {
        // Your code here
    }
}
Using "if" would make it pretty long and more complex:
pawn Код:
if (((hour >=20 && hour <=22))  || (hour == 6) || (hour == 15))
Reply


Messages In This Thread
Gettime - by w3b - 05.01.2016, 07:49
Re: Gettime - by justinnater - 05.01.2016, 08:36
Re: Gettime - by w3b - 05.01.2016, 08:42
Re: Gettime - by justinnater - 05.01.2016, 08:48
Re: Gettime - by w3b - 05.01.2016, 09:01
Re: Gettime - by justinnater - 05.01.2016, 09:10
Re: Gettime - by AmigaBlizzard - 05.01.2016, 11:50
Re: Gettime - by AbyssMorgan - 05.01.2016, 13:27

Forum Jump:


Users browsing this thread: 2 Guest(s)