08.10.2013, 22:17
How to make random(between $100k and $300k)
new rand = random(300000);
if(rand < 100000)
{
rand += 100000;//Makes it stay above 100000
}
//The variable rand now holds a random value between 100k and 300k.
//You can now do do somthing like: GivePlayerMoney(playerid, rand);
new value = random(max - min) + min;
pawn Код:
Hope that helps! ![]() |
new rand = random(300000);//Creates random number 0-300000.
if(rand < 100000)
{
rand += 100000;//Ensure the random number stay's above 100000.
}
GivePlayerMoney(playerid, rand);//Gives the player the random ammount of money.
#define random_moneys(%0,%1) (random(%1 - %0) + %0)
GivePlayerMoney(playerid, random_moneys(100000, 300000)); // MinCash, MaxCash