10.10.2015, 21:09
hello. Is it possible to make random pickups on a map ( made with map constructor above the sky ) without taking a lot of coordinates by myself?
stock GetRandomPointInCube(Float:minx,Float:miny,Float:minz,Float:maxx,Float:maxy,Float:maxz,&Float:x,&Float:y,&Float:z){
new cx,cy,cz;
cx = floatround(floatsqroot(floatpower(minx-maxx,2)));
cy = floatround(floatsqroot(floatpower(miny-maxy,2)));
cz = floatround(floatsqroot(floatpower(minz-maxz,2)));
x = random(cx)-(cx/2);
y = random(cy)-(cy/2);
z = random(cz)-(cz/2);
}
new Float:myx, Float:myy, Float:myz;
GetRandomPointInCube(-3000.0,-3000.0,1.0,3000.0,3000.0,500.0,myx,myy,myz);
MapAndreas_FindZ_For2DCoord(myx,myy,myz);
myz += 1.0; //match