Raised This Month: $ Target: $400
 0% 

how to make something have a 'chance'


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 08-16-2008 , 00:22   Re: how to make something have a 'chance'
Reply With Quote #4

Quote:
Originally Posted by jim_yang View Post
I suggest random 0-10000 and check if less than 100 for 1% chance
or random float from 0 to 1 and check the percent directly
There's absolutely no difference. Any method will work. The chances are matematically the same. But it gets easier to read if you use numbers equal to the chance you are trying to achieve.

You could do,for example, random_num(1,400) and check if it's equal to one, or random_num(1,800) and check if its <= 2. Which one is easier to figure out?
danielkza is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode