Zone check
#1

Hi guys, how can I check if the player is in a certain zone, like the yellow one in the picture and if he is then he will be able to access a certain command.



I will +rep anyone who helps
Reply
#2

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#3

You don't seem to get it, I want to check if the player is in that area, only that yellow zone, not in the range of a point.
Reply
#4

Add this to your gamemode
pawn Код:
stock IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY) return 1;
    return 0;
}
Then use IsPlayerInArea(playerid, minx, miny, maxx, maxy); as a native
Reply
#5

Thank you. +repped you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)