[Pedido] Deixar Um Tempo Randomico (Sol,Chuva,Nublado,Noite,Tarde) - 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: [Pedido] Deixar Um Tempo Randomico (Sol,Chuva,Nublado,Noite,Tarde) (
/showthread.php?tid=405134)
Deixar Um Tempo Randomico (Sol,Chuva,Nublado,Noite,Tarde) -
Pietrotm2012 - 05.01.2013
Gente eu queria que tipo
Fica Sol Durante 5 Minutos
Chuva Durante 3
Nublado Durante 5
Noite Durante 3
Tarde Durante 3
Pf!!!

Ai Ficaria Randфmico
Re: Deixar Um Tempo Randomico (Sol,Chuva,Nublado,Noite,Tarde) -
FreeGells - 05.01.2013
Tenta ai, nгo testei.
Код:
#include < a_samp >
forward RandomWeather ( ) ;
public RandomWeather ( )
{
new
rand = 1 + random ( 5 ) ;
switch ( rand )
{
case 1:
{
SetWeather ( 1 ) ; // Sol
SetTimer ( "RandomWeather", 300000, false ) ;
}
case 2:
{
SetWeather ( 8 ) ; // Chuva
SetTimer ( "RandomWeather", 180000, false ) ;
}
case 3:
{
SetWeather ( 20 ) ; // Nublado
SetTimer ( "RandomWeather ", 300000, false ) ;
}
case 4:
{
SetWorldTime ( 12 ) ; // Dia
SetTimer ( "RandomWeather", 180000, false ) ;
}
case 5:
{
SetWorldTime ( 0 ) ; // Noite
SetTimer ( "RandomWeather", 180000, false ) ;
}
}
return 1 ;
}
Re: Deixar Um Tempo Randomico (Sol,Chuva,Nublado,Noite,Tarde) -
TreePuncher - 05.01.2013
Nгo seria Aleatуrio, ao invйs de randomico? ._.
Re: Deixar Um Tempo Randomico (Sol,Chuva,Nublado,Noite,Tarde) -
Etton - 05.01.2013
Quote:
Originally Posted by Jay_McReary
Nгo seria Aleatуrio, ao invйs de randomico? ._.
|
Mesma coisa com delete.
Re: Deixar Um Tempo Randomico (Sol,Chuva,Nublado,Noite,Tarde) -
Pietrotm2012 - 05.01.2013
Quote:
Originally Posted by FreeGells
Tenta ai, nгo testei.
Код:
#include < a_samp >
forward RandomWeather ( ) ;
public RandomWeather ( )
{
new
rand = 1 + random ( 5 ) ;
switch ( rand )
{
case 1:
{
SetWeather ( 1 ) ; // Sol
SetTimer ( "RandomWeather", 300000, false ) ;
}
case 2:
{
SetWeather ( 8 ) ; // Chuva
SetTimer ( "RandomWeather", 180000, false ) ;
}
case 3:
{
SetWeather ( 20 ) ; // Nublado
SetTimer ( "RandomWeather ", 300000, false ) ;
}
case 4:
{
SetWorldTime ( 12 ) ; // Dia
SetTimer ( "RandomWeather", 180000, false ) ;
}
case 5:
{
SetWorldTime ( 0 ) ; // Noite
SetTimer ( "RandomWeather", 180000, false ) ;
}
}
return 1 ;
}
|
Vlw Mano!!! Rep+