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