Horas igual Offline -
nasser - 28.02.2017
Galera quando eu jogava GTA Offline conforme as horas passavam o tempo ia mudando para dia noite madrugada e assim ia hoje quando da 6:00 й dia quando da 17:00 fica por do sol e quando da 18:00 ~ 19:00 da noite tem como fazer isso gradualmente? Й bem comum nos servidores do nada mudar de dia pra noite e vice versa seria algo novo
Re: Horas igual Offline -
silenthill - 28.02.2017
PHP код:
SetTimer("tempoh",500,true);
forward tempoh();
public tempoh()
{
new hour, Minute, Second;
gettime(hour, Minute, Second);
if (hour == 0){SetWorldTime(0);}
if (hour == 1){SetWorldTime(1);}
if (hour == 2){SetWorldTime(2);}
if (hour == 3){SetWorldTime(3);}
if (hour == 4){SetWorldTime(4);}
if (hour == 5){SetWorldTime(5);}
if (hour == 6){SetWorldTime(6);}
if (hour == 7){SetWorldTime(7);}
if (hour == 8){SetWorldTime(8);}
if (hour == 9){SetWorldTime(9);}
if (hour == 10){SetWorldTime(10);}
if (hour == 11){SetWorldTime(11);}
if (hour == 12){SetWorldTime(12);}
if (hour == 13){SetWorldTime(13);}
if (hour == 14){SetWorldTime(14);}
if (hour == 15){SetWorldTime(15);}
if (hour == 16){SetWorldTime(16);}
if (hour == 17){SetWorldTime(17);}
if (hour == 18){SetWorldTime(20);}
if (hour == 19){SetWorldTime(23);}
if (hour == 20){SetWorldTime(0);}
if (hour == 21){SetWorldTime(0);}
if (hour == 22){SetWorldTime(0);}
if (hour == 23){SetWorldTime(0);}
}
Re: Horas igual Offline -
nasser - 28.02.2017
Quote:
Originally Posted by silenthill
PHP код:
SetTimer("tempoh",500,true);
forward tempoh();
public tempoh()
{
new hour, Minute, Second;
gettime(hour, Minute, Second);
if (hour == 0){SetWorldTime(0);}
if (hour == 1){SetWorldTime(1);}
if (hour == 2){SetWorldTime(2);}
if (hour == 3){SetWorldTime(3);}
if (hour == 4){SetWorldTime(4);}
if (hour == 5){SetWorldTime(5);}
if (hour == 6){SetWorldTime(6);}
if (hour == 7){SetWorldTime(7);}
if (hour == 8){SetWorldTime(8);}
if (hour == 9){SetWorldTime(9);}
if (hour == 10){SetWorldTime(10);}
if (hour == 11){SetWorldTime(11);}
if (hour == 12){SetWorldTime(12);}
if (hour == 13){SetWorldTime(13);}
if (hour == 14){SetWorldTime(14);}
if (hour == 15){SetWorldTime(15);}
if (hour == 16){SetWorldTime(16);}
if (hour == 17){SetWorldTime(17);}
if (hour == 18){SetWorldTime(20);}
if (hour == 19){SetWorldTime(23);}
if (hour == 20){SetWorldTime(0);}
if (hour == 21){SetWorldTime(0);}
if (hour == 22){SetWorldTime(0);}
if (hour == 23){SetWorldTime(0);}
}
|
Jб uso isso manin, tou flnd incluindo minutos etc..
Re: Horas igual Offline -
Cheleber_Pausini - 28.02.2017
https://sampforum.blast.hk/showthread.php?tid=257071
?
EDIT:
https://sampwiki.blast.hk/wiki/SetPlayerTime
Exemplo:
PHP код:
for(new i = 0; i < MAX_PLAYERS; ++i)
{
SetPlayerTime(i, hour, Minute);
}
Re: Horas igual Offline -
nasser - 01.03.2017
Quote:
Originally Posted by Cheleber_Pausini
|
Valeu isso mesmo
Re: Horas igual Offline -
MBJ - 03.03.2017
Quote:
Originally Posted by silenthill
PHP код:
SetTimer("tempoh",500,true);
forward tempoh();
public tempoh()
{
new hour, Minute, Second;
gettime(hour, Minute, Second);
if (hour == 0){SetWorldTime(0);}
if (hour == 1){SetWorldTime(1);}
if (hour == 2){SetWorldTime(2);}
if (hour == 3){SetWorldTime(3);}
if (hour == 4){SetWorldTime(4);}
if (hour == 5){SetWorldTime(5);}
if (hour == 6){SetWorldTime(6);}
if (hour == 7){SetWorldTime(7);}
if (hour == 8){SetWorldTime(8);}
if (hour == 9){SetWorldTime(9);}
if (hour == 10){SetWorldTime(10);}
if (hour == 11){SetWorldTime(11);}
if (hour == 12){SetWorldTime(12);}
if (hour == 13){SetWorldTime(13);}
if (hour == 14){SetWorldTime(14);}
if (hour == 15){SetWorldTime(15);}
if (hour == 16){SetWorldTime(16);}
if (hour == 17){SetWorldTime(17);}
if (hour == 18){SetWorldTime(20);}
if (hour == 19){SetWorldTime(23);}
if (hour == 20){SetWorldTime(0);}
if (hour == 21){SetWorldTime(0);}
if (hour == 22){SetWorldTime(0);}
if (hour == 23){SetWorldTime(0);}
}
|
Acho que isso ficaria melhor assim:
PHP код:
forward tempoh();
public tempoh()
{
new hour, Minute, Second;
gettime(hour, Minute, Second);
SetWorldTime(hour);
}
Re: Horas igual Offline -
ViniBorn - 03.03.2017
Quote:
Originally Posted by MBJ
Acho que isso ficaria melhor assim:
PHP код:
forward tempoh();
public tempoh()
{
new hour, Minute, Second;
gettime(hour, Minute, Second);
SetWorldTime(hour);
}
|
Esse й melhor, mas faltam alguns ajuste pra fazer a mesma coisa que o outro cуdigo.
Respuesta: Horas igual Offline -
SammyJ - 03.03.2017
PHP код:
SetTimer("tempoh",500,true);
forward tempoh();
public tempoh()
{
new hour;
gettime(hour);
switch(hour)
{
case 0, 20..23: hour = 0;
case 18: hour = 20;
case 19: hour = 23;
}
return SetWorldTime(hour);
}
Re: Horas igual Offline -
nasser - 03.03.2017
Quote:
Originally Posted by MBJ
Acho que isso ficaria melhor assim:
PHP код:
forward tempoh();
public tempoh()
{
new hour, Minute, Second;
gettime(hour, Minute, Second);
SetWorldTime(hour);
}
|
Estou usando essa public para ficar atualizando a hora e botei assim
PHP код:
if (hour == 0){SetPlayerTime(i, hour, minute);
Isso dentro de um loop para setar cada player
Quote:
Originally Posted by SammyJ
PHP код:
SetTimer("tempoh",500,true);
forward tempoh();
public tempoh()
{
new hour;
gettime(hour);
switch(hour)
{
case 0, 20..23: hour = 0;
case 18: hour = 20;
case 19: hour = 23;
}
return SetWorldTime(hour);
}
|
Vocк provavelmente nгo entendeu o que eu precisava.. De qualquer forma agradeзo.