14.09.2013, 20:38
I want to make a gamble command that chooses a number between 1 and 3 and if it lands on 2 it will give the player 50 dollars, if it it lands on something else it will tell him he lost.
I have this code but it doesn't work.
I have this code but it doesn't work.
Code:
CMD:gamble(playerid, params[])
{
new rand = random(1 - 3);
new string[64];
GivePlayerMoney(playerid, -10);
if(rand == 2)
{
SendClientMessage(playerid, COLOR_YELLOW, "Your number landed on 3, and you won 50 dollars!");
}
else
{
format(string,sizeof(string),"Your number is %d",rand);
SendClientMessage(playerid, COLOR_RED, string);
}
return 1;
}

