30.10.2014, 11:23
Hey,
I want to get random 'X,Y,Z' from area (MinX,MinY,MaxX,MaxY).
That's possible?
I want to get random 'X,Y,Z' from area (MinX,MinY,MaxX,MaxY).
That's possible?
stock Float:frandom(Float:max, Float:min = 0.0, dp = 4) // Credit to ******
{
new Float:mul = floatpower(10.0, dp),
imin = floatround(min * mul),
imax = floatround(max * mul);
return float(random(imax - imin) + imin) / mul;
}
new Float:RandomX=frandom(MaxX,MinX);
new Float:RandomY=frandom(MaxY,MinY);
new Float:RandomZ=frandom(MaxZ,MinZ);
SetPlayerPos(playerid,RandomX,RandomY,RandomZ);
pawn Код:
|