[Pedido] comando de provabilidades
#1

bem,alguem sabe como faзo um comando,tipo o player faz /tentarsorte e tem uma provabilidade de ter alguma coisa,50% й ter mil reais,30% ter 5 mil reais e 20% ter 10 mil reais
Reply
#2

PHP код:
if ( strcmp ( cmdtext , "/tentarsorte" , true ) == 0 ) {
    
    new 
Sorte = random ( 10 ) ;
    
    if ( 
Sorte >= 0 && Sorte <= 5 ) {
        
        
SendClientMessage ( playerid , -1 , "Vocк ganhou R$ 1000." ) ;
        
GivePlayerMoney ( playerid , 1000 ) ;
    }
    
    if ( 
Sorte >= 6 && Sorte <= 8 ) {
        
        
SendClientMessage ( playerid , -1 , "Vocк ganhou R$ 5000." ) ;
        
GivePlayerMoney ( playerid , 5000 ) ;        
    }
    
    if ( 
Sorte >= 9 && Sorte <= 10 ) {
        
        
SendClientMessage ( playerid , -1 , "Vocк ganhou R$ 10000." ) ;
        
GivePlayerMoney ( playerid , 10000 ) ;        
    }

    return 
1;
} 
Reply
#3

como faзo para o player so usar esse cmd 24h a 24h?
Reply
#4

Usa SetTimer.
Reply
#5

Nгo usa timer! usa gettime();
Reply
#6

e como faria a public?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)