[Ajuda] Clima-Hora realista
#1

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?
Reply
#2

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

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

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

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

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)