How to do make it so there is a certain percentage for something to succeed?
#1

I'm trying to make a system to plant bombs, however I'm stuck.
How do I make it, so that one bomb site, has the chance of 30% to be planted successfully, and an another 85%?
Reply
#2

pawn Код:
new percent = random(100);

if(percent < 85) // 85 percent of the time this will be true.
Not sure if its meant to be < or <= (I'm fairly certain it's correct).
Reply
#3

Thanks MP2, that'll do I think.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)