Odds of executing something
#1

Is there a better way of doing this:

pawn Код:
if(random(2) == 1)
{
    // 50% chance of code being executed.
}

if(random(3) == 2)
{
    // 33% chance of code being executed.
}

if(random(10) == 2)
{
    // 10% chance of code being executed.
}
Thank you.
Reply


Messages In This Thread
Odds of executing something - by Whizion - 26.02.2015, 02:44
Re: Odds of executing something - by rickisme - 26.02.2015, 02:51
Re: Odds of executing something - by SickAttack - 26.02.2015, 03:03

Forum Jump:


Users browsing this thread: 2 Guest(s)