Raised This Month: $ Target: $400
 0% 

How to make random Numbers with Random function?


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-03-2010 , 07:30   Re: How to make random Numbers with Random function?
Reply With Quote #11

Use random_num() if it's the result satisfy you.
__________________
Arkshine is offline
ScHrAnZ DiNgEnS
Senior Member
Join Date: Sep 2007
Old 01-03-2010 , 08:40   Re: How to make random Numbers with Random function?
Reply With Quote #12

hmmm random() works now, maybe i test to short, or maybe the funktion is initialized with current time.

I test it for 3 days on the same time and i get the same results on each day... pure coincidence?
__________________
ScHrAnZ DiNgEnS is offline
Send a message via ICQ to ScHrAnZ DiNgEnS Send a message via AIM to ScHrAnZ DiNgEnS
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-03-2010 , 08:44   Re: How to make random Numbers with Random function?
Reply With Quote #13

It can happen often if the number is small. You can not expect to get good results with such small range.
__________________
Arkshine is offline
ScHrAnZ DiNgEnS
Senior Member
Join Date: Sep 2007
Old 01-03-2010 , 09:53   Re: How to make random Numbers with Random function?
Reply With Quote #14

thats true, but in my test i use numbers from 1 to 100 and got the same each day after server restart (5:00 AM)
__________________
ScHrAnZ DiNgEnS is offline
Send a message via ICQ to ScHrAnZ DiNgEnS Send a message via AIM to ScHrAnZ DiNgEnS
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-03-2010 , 10:40   Re: How to make random Numbers with Random function?
Reply With Quote #15

With random or random_num ?
__________________
Arkshine is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-03-2010 , 10:43   Re: How to make random Numbers with Random function?
Reply With Quote #16

Try this I know its pure crap
Code:
const YourNum = 100; new i = ( ( random( YourNum * 6 ) + random( YourNum * 2 ) ) % YourNum );
__________________
xPaw is offline
ScHrAnZ DiNgEnS
Senior Member
Join Date: Sep 2007
Old 01-03-2010 , 13:29   Re: How to make random Numbers with Random function?
Reply With Quote #17

Quote:
Originally Posted by xPaw View Post
Try this I know its pure crap
Code:
const YourNum = 100; new i = ( ( random( YourNum * 6 ) + random( YourNum * 2 ) ) % YourNum );
this is the scripting help forum, if u not want to help me post your craps on some other place please, THANKS !
__________________
ScHrAnZ DiNgEnS is offline
Send a message via ICQ to ScHrAnZ DiNgEnS Send a message via AIM to ScHrAnZ DiNgEnS
Reply



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 23:14.


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