Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Random Number Function Help Please

Author
Message
Erratis
20
Years of Service
User Offline
Joined: 25th Dec 2003
Location:
Posted: 27th Dec 2003 20:01
Hello, I have a random number function, and when i call if It give me a number like 50954905948594 instead of the between 0 and 100 i have specified, and it ill not subtract the number given from the the health bar, any help would be great!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 27th Dec 2003 20:06
dbp help:

RND
This command will return a random number between 0 and the range provided. The integer range will be
the highest number you want returned. The return value will be an integer number.

SYNTAX
Return Float=RND(Range Value) <---help is wrong, should be integer not float.


dim intRand as integer
randomize timer()
intRand=RND(Range Value) :`use + 1 here if you do not want zero returned

-RUST-

VB.NET makes me all goose-pimply! http://www.mod2software.com
Alastair Zotos
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location: a bin
Posted: 31st Dec 2003 12:43
number$=rnd(100)
print "Random Number= ";number$

fart like you've never farted before!!!
(five seconds later)
Dude that stinks!!! get out of my house!
Alastair Zotos
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location: a bin
Posted: 31st Dec 2003 12:45
oops, sorry, i meant
number=rnd(100)
print "Random number: ";number

fart like you've never farted before!!!
(five seconds later)
Dude that stinks!!! get out of my house!

Login to post a reply

Server time is: 2024-11-25 22:21:21
Your offset time is: 2024-11-25 22:21:21