floats with random
#1

(1449) : warning 213: tag mismatch
C:\DOCUME~1\Karim\MYDOCU~1\GRANDT~1\SA-MPS~1\GAMEMO~1\COPSAR~1.pwn(1449) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.


new randfuel = minrand(25.00,100.00);
CarFuel[v] = randfuel; // This sets the fuel

i need it to be a float for the random fuelor it will crash my server help?
Reply
#2

You cant generate float with "minrand()" because it's only for integer
Reply
#3

argh ok no way to make a random for floats?
Reply
#4

Now I know new thing, what I will also say for you

new Float:rand = float(random(Your Random));
Reply
#5

pawn Код:
new randfuel = minrand(25,100);
CarFuel[v] = float(randfuel); // This sets the fuel
or

pawn Код:
stock Float:minrand(min, max)
{
    return float(random(max-min))+float(min);
}
CarFuel[v] = minrand(25,100);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)