25.07.2018, 06:47
Код:
new money; money= random(500 to 1000);
How to do that
new money; money= random(500 to 1000);
randomex(min, max)
{
return random(max-min)+min;
}
new money = 500; //This will make it "always" start at 500
money = money + random(500); //then, reinitialize the variable. Tell the script that you want 500 + '0-500' more.
new money = 75;
money = money + random(19); //this will always be 75-94.
A better way to explain how you solve it, is to look at the problem part for part.
You want the ranom to start at 500, and end at 1000. Between 500 and 100 you have 500 units. PHP код:
PHP код:
|