[Pedido] Deixar Um Tempo Randomico (Sol,Chuva,Nublado,Noite,Tarde)
#1

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

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 ; 
}
Reply
#3

Nгo seria Aleatуrio, ao invйs de randomico? ._.
Reply
#4

Quote:
Originally Posted by Jay_McReary
Посмотреть сообщение
Nгo seria Aleatуrio, ao invйs de randomico? ._.
Mesma coisa com delete.
Reply
#5

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+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)