13.04.2011, 13:21
How can i make like, random a position from max x max y and min x and min y?
SafeSetPlayerPos(playerid, grandomxyz[rand][0], grandomxyz[rand][1], grandomxyz[rand][2]);//example new Float:grandomxyz[2][3] = {//first number = number of checkpoints 3= x,y,z {216.9725,79.1339,1005.0391}, {219.8852,75.5487,1005.0391} };
RandomX = RandomEx(maxX, minX);
RandomY = RandomEx(maxY, minY);
stock RandomEx(min, max) //******
{
return random(max - min) + min;
}
RandomX = RandomEx(maxX, minX); //Returns a random X value
RandomY = RandomEx(maxY, minY); //Returns a random Y value
SetPlayerPos(playerid, RandomX, RandomY, 1); //This is just an example, it will set player pos. in a random area