SA-MP Forums Archive
RangeOfPoint - 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)
+--- Thread: RangeOfPoint (/showthread.php?tid=454569)



RangeOfPoint - RandomDude - 29.07.2013

So I created a gang zone
pawn Код:
new GZ_ZONE1;
GZ_ZONE1 = GangZoneCreate(-128.90625,2371.09375,492.1875,2617.1875);
GangZoneShowForAll(GZ_ZONE1, 0x00FF0083);
But it is not a gang zone so let me change that.

pawn Код:
new HOME1;
HOME1 = GangZoneCreate(-128.90625,2371.09375,492.1875,2617.1875);
GangZoneShowForAll(HOME1, 0x00FF0083);
If the player is in this area how would I do it
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, -128.90625,2371.09375,492.1875,2617.1875)
Would I do it like this?

Basically what I want to do is if the player is in that area he is not allowed to spawn any planes/helicopters I think I know how to do that bit.

pawn Код:
CMD:plane(playerid)
{
          if(IsPlayerInRangeOfPoint(playerid, -128.90625,2371.09375,492.1875,2617.1875)
           {
// GIVE THE PLAYER THE VEHICLE
         }
         else SendClientMessage(playerid, RED, "You are not allowed to spawn a airplane here...");
         return 1;
}
Would that be correct?


Re: RangeOfPoint - -Prodigy- - 29.07.2013

Take a look at this: https://sampforum.blast.hk/showthread.php?tid=222283


Re: RangeOfPoint - RandomDude - 29.07.2013

pawn Код:
if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY) {
Can someone explain it a bit more

And thank you Prodigy thats just what I was looking for.