13.10.2011, 20:54
What was the code responsible for picking up a random number between numbers?
new RandomNumber = random(500);
print( RandomNumber );
rand = random(3);
switch(rand)
{
case 0: Blah Blah;
case 1: Blah Blah;
case 2: Blah Blah;
}
// credit to KyleSmith
stock randomEx(minnum = cellmin, maxnum = cellmax)
{
return random(maxnum - minnum + 1) + minnum;
}
new lotto = randomEx(1,100); // will pick a random number between 1 and 100
new payout = randomEx(10000,20000); // will choose a random amount between 10k to 20k
GivePlayerMoney(playerid,payout); // give the player the random cash payout
print(payout); // print the random cash payout