AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Random Numbers? (https://forums.alliedmods.net/showthread.php?t=2398)

FroXeN 06-03-2004 20:42

Random Numbers?
 
How can i make a random generator for random numbers ?

like every secound?

devicenull 06-03-2004 22:34

Use this
For numbers between A and B
randomnumber = Int((A-B)*rnd+A)
works nicely

I think rnd is correct, you want whatever function returns a random decimal between 0-1

Dygear 06-03-2004 22:58

why not grab the a decimal from the time :).

Girthesniper 06-03-2004 22:59

WTF?! Why would you need this?

Dygear 06-03-2004 23:02

Why not?

Burnzy 06-04-2004 01:30

u can use it for example... to make sumones name Llama32
It does a random number between 1-100
So like u dont got it (1)Llama and (2)Llama and Llama
Kinda shitty!

BAILOPAN 06-04-2004 01:36

It's useful for certain effects, like say throwing a user in a random direction or dealing random amounts of damage

FroXeN 06-04-2004 02:41

you'll all see :)


So if i was doing some numbers i would use that to do it and it did it like every secound too?

numbers 1-255? i am making a cool plugin..

QwertyAccess 06-04-2004 04:20

Quote:

Originally Posted by BAILOPAN
It's useful for certain effects, like say throwing a user in a random direction or dealing random amounts of damage

Yea its a very useful, some of my plugins use a random number for pushing a player a certain amount.

FroXeN 06-04-2004 06:31

Quote:

Originally Posted by QwertyAccess
Quote:

Originally Posted by BAILOPAN
It's useful for certain effects, like say throwing a user in a random direction or dealing random amounts of damage

Yea its a very useful, some of my plugins use a random number for pushing a player a certain amount.

Might you help me with my plugin?


All times are GMT -4. The time now is 14:48.

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