04.07.2016, 19:42
What you've made is not what I'm looking for.
All I want is a command that will choose a random value between 0 and 20.
Example:
So let's say the random value is 0.
As you can see, you will only get the price if rand == 0 and money == 1.
But money is equal to 0 as defined above, so the player would not get anything.
How can I make it so it will choose a different random value so the player would get something.
All I want is a command that will choose a random value between 0 and 20.
Example:
Код:
new money, vehicle, level; money = 0; vehicle = 1; level = 1; CMD:getgift(playerid, params[]) { new rand = random(20); if(rand == 0 && money == 1) { //do this } else if(rand == 1 && vehicle == 1) { //do this } else if(rand == 2 && level == 1) { //do this } return 1; }
As you can see, you will only get the price if rand == 0 and money == 1.
But money is equal to 0 as defined above, so the player would not get anything.
How can I make it so it will choose a different random value so the player would get something.