23.09.2018, 11:13
Quote:
From YSI:
Код:
new Float:x = FloatRandom(minx, maxx); new Float:y = FloatRandom(miny, maxy); |
Is it something like this?
PHP код:
frandom(Float:max, Float:min = 0.0, dp = 4)
{
new
// Get the multiplication for storing fractional parts.
Float:mul = floatpower(10.0, dp),
// Get the max and min as integers, with extra dp.
imin = floatround(min * mul),
imax = floatround(max * mul);
// Get a random int between two bounds and convert it to a float.
return float(random(imax - imin) + imin) / mul;
}