Random Float?
#1

Is there a function that creates a random float?
I searched the forum but can't find one
Reply
#2

Try this one:

Code:
new Float:YourFunction[7][3] = //[7] number of random (@ my is 7) && [3] number of Values (0.0,0.0,0.0) @ mine 3
{
	{-1130.9011,1076.9305,1353.4279}, //Put here your random whatever I added coords
	{-1136.5948,1077.3739,1345.8052},
	{-1083.2759,1045.3164,1343.3174},
  {-1059.1899,1056.0432,1344.1494}},
  {-1017.5864,1050.0138,1342.8647},
  {-974.0999,1061.7153,1345.6708},
  {-972.9766,1022.9188,1345.0541}
};
Bearfist
Reply
#3



try
pawn Code:
float(random(20000000)) / 1000
But why you need that?
Reply
#4

I got a open dm field, and i want the play to spawn random in the field, because the z is everywhere the same and there are no obstacles, and it's nicer to spawn completely random :P

The random float must be between (float)... and (float)..., so the spawn is completely random so nobody spawns in eachoter

P.S. Srry for my bad english, i am dutch
Reply
#5

Srry for double post, but i want to let you guys know il have found a solution for this.

I just use:
pawn Code:
new Float:x = 1.0 + random(10);
new Float:y = 2.0 + random(11);
new Float:z = 4.0;
It's just an example, so it's not useable :P
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)