You could modify the function in my sig, i haven't tested this but i think it should work.
pawn Code:
stock RandPosInArea( Float: minx, Float: miny, Float: maxx, Float: maxy, &fDestX, &fDestY )
{
new
iMin, iMax,
Float:mul = floatpower(10.0, 4)
;
iMin = floatround(minx * mul);
iMax = floatround(maxx * mul);
fDestX = float(random(iMax - iMin) + iMin) / mul;
iMin = floatround(miny * mul);
iMax = floatround(maxy * mul);
fDestY = float(random(iMax - iMin) + iMin) / mul;
}
Usage:
pawn Code:
//create variables to store co-ordinates
new RandX, RandY;
//first 4 arguments are the area (minx, miny, maxx, maxy)
//last 2 arguments are the variables to store the random co-ordinates passed by reference
RandPosInArea( -840.807, -1272.888, 665.6389, 373.692, RandX, RandY );
//RandX and RandY hold the 2D co-ordinates
This doesn't work for the
z axis (height) you would need to use mapandreas plugin for that. Or know the height in advance.
EDIT: This wouldn't work well for a whole city. But with this you could create several areas in a city and choose one at random, then create a fire at a random point in that area. But like i said it would need to be flat ground so you know the height, or use mapandreas plugin to get the height.