SA-MP Forums Archive
Pos in Area - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Pos in Area (/showthread.php?tid=174243)



Pos in Area - willsuckformoney - 05.09.2010

Anyway to detect some coordinates inside of a certain area? Any code function or anything will help other than going into the area and /save'ing


Re: Pos in Area - iggy1 - 05.09.2010

I'm not 100% sure i know what you mean, but if you mean a way to get an area' co-ords this tool is exelent for that.
Ultimate Visual Mapper


Re: Pos in Area - willsuckformoney - 05.09.2010

Not that i mean like Get random positions in a area that is already created without some program or /save


Re: Pos in Area - Tannz0rz - 05.09.2010

pawn Код:
stock IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z) // Made by ******
{
    new
        Float:px,
        Float:py,
        Float:pz;
    GetPlayerPos(playerid, px, py, pz);
    px -= x;
    py -= y;
    pz -= z;
    return ((px * px) + (py * py) + (pz * pz)) < (range * range);
}
That what you wanted?


Re: Pos in Area - willsuckformoney - 05.09.2010

Uh maybe, i mean like you can just type some command like /boom then it will just detect some random place in certain area and make explosions


Re: Pos in Area - WillyP - 05.09.2010

isplayerincube?


Re: Pos in Area - willsuckformoney - 05.09.2010

isn't that like some streamer function?


Re: Pos in Area - Hiddos - 05.09.2010

Nope.

I'd say, use the "random()" function with GetPlayerPos to create explosions in an area near him, and use the MapAndreas plugin to get the ground positions.


Re: Pos in Area - iggy1 - 05.09.2010

He wants this, lets say LV airport is a zone. He want to be able to get a random set of co-ords from inside that zone. Unfortunatly i havn't a clue how to do that


Re: Pos in Area - Mauzen - 05.09.2010

You can calc the random points: randomx = zone_min_x + random(floatround(zone_max_x - zone_min_x));
The same for y then
But you may land in a house or so then. For good results, use MapAndreas, and set the z for the random x/y, too.