[HELP] Chance [++REP]
#4

Quote:
Originally Posted by SaYrOn
Посмотреть сообщение
Why are you checking if result is equal or below?

If random will return 5, it will go through both of above if-statements. And chance will be equaled to 40.

You should rather check if result is in between two values, smth like:
pawn Код:
if(result >= 30 && result <= 39) { do something  } //30%
if(result >= 40 && result <= 49) { do something } //40%
What the fuck. The OP wants a 30% chance, not the value being between 30 and 40. 39-30 = 9, which means there will be a 9 percent chance. Go learn some simple maths please. This was just an example. I showed them how to calculate percentage.
Reply


Messages In This Thread
[HELP] Chance [++REP] - by Amine_Mejrhirrou - 03.10.2012, 11:18
Re: [HELP] Chance [++REP] - by KingHual - 03.10.2012, 11:22
Re : [HELP] Chance [++REP] - by Amine_Mejrhirrou - 03.10.2012, 11:31
Re: [HELP] Chance [++REP] - by KingHual - 03.10.2012, 11:46
Re: [HELP] Chance [++REP] - by KingHual - 03.10.2012, 12:29
Re : [HELP] Chance [++REP] - by Amine_Mejrhirrou - 04.10.2012, 13:58
Re: [HELP] Chance [++REP] - by KingHual - 04.10.2012, 14:36

Forum Jump:


Users browsing this thread: 1 Guest(s)