[HELP] Chance [++REP]
#2

pawn Код:
new result = random(100);
if(result <= 30) { do something  } //30%
if(result <= 40) { do something } //40%
etc.
Simple percentage. If there is a max of 100 percent, 30 percent of it will be 30/100, 40 percent will be 40/100 etc.

http://www.basic-mathematics.com/for...ercentage.html
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: 3 Guest(s)