SA-MP Forums Archive
[Ajuda] Clima-Hora realista - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Clima-Hora realista (/showthread.php?tid=649717)



Clima-Hora realista - weex - 13.02.2018

Fiz esse sistema que de acordo com a hora seta um clima:
PHP код:
forward SetClima(); public SetClima() {
    if(
hora == 0){SetWorldTime(0);}
    else if(
hora == 1){SetWorldTime(1);}
    else if(
hora == 2){SetWorldTime(2);}
    else if(
hora == 3){SetWorldTime(3);}
    else if(
hora == 4){SetWorldTime(4);}
    else if(
hora == 5){SetWorldTime(5);}
    else if(
hora == 6){SetWorldTime(6);}
    else if(
hora == 7){SetWorldTime(7);}
    else if(
hora == 8){SetWorldTime(8);}
    else if(
hora == 9){SetWorldTime(9);}
    else if(
hora == 10){SetWorldTime(10);}
    else if(
hora == 11){SetWorldTime(11);}
    else if(
hora == 12){SetWorldTime(12);}
    else if(
hora == 13){SetWorldTime(13);}
    else if(
hora == 14){SetWorldTime(14);}
    else if(
hora == 15){SetWorldTime(15);}
    else if(
hora == 16){SetWorldTime(16);}
    else if(
hora == 17){SetWorldTime(17);}
    else if(
hora == 18){SetWorldTime(20);}
    else if(
hora == 19){SetWorldTime(23);}
    else if(
hora == 20){SetWorldTime(0);}
    else if(
hora == 21){SetWorldTime(0);}
    else if(
hora == 22){SetWorldTime(0);}
    else if(
hora == 23){SetWorldTime(0);} 

O problema й que nгo ta nada realista kkkk
Do nada ta de tarde e fica de noite
Alguйm sabe algum jeito melhor de fazer isso, ou alguma include que faзa melhor do que eu fiz?


Re: Clima-Hora realista - n0minal - 13.02.2018

Que cуdigo horrнvel, usa isso: https://sampforum.blast.hk/showthread.php?tid=544733


Re: Clima-Hora realista - Ermanhaut - 13.02.2018

Quote:
Originally Posted by n0minal
Посмотреть сообщение



Re: Clima-Hora realista - FerrariL - 13.02.2018

Poderia usar um switch,no lugar desse monte de ifs.


Re: Clima-Hora realista - n0minal - 13.02.2018

Quote:
Originally Posted by Ermanhaut
Посмотреть сообщение
Sу fui sincero D:


Re: Clima-Hora realista - Ermanhaut - 14.02.2018