How do I make a random number, on my /gamble command
#2

It should work:
PHP Code:
CMD:gamble(playeridparams[])
{
    new 
rand random(3);//It's 3 no 1 - 3
    
new string[64];
    
    if(
rand == 2)
    {
        
SendClientMessage(playeridCOLOR_YELLOW"Your number landed on 3, and you won 50 dollars!");
        
GivePlayerMoney(playerid50);
    }
    else
    {
        
format(string,sizeof(string),"Your number is %d",rand);
        
SendClientMessage(playeridCOLOR_REDstring);
        
GivePlayerMoney(playerid, -10);
    }
    return 
1;

Reply


Messages In This Thread
How do I make a random number, on my /gamble command - by ExtendedCarbon - 14.09.2013, 20:38
Re: How do I make a random number, on my /gamble command - by ThePhenix - 14.09.2013, 21:06

Forum Jump:


Users browsing this thread: 1 Guest(s)