how to make command work in certain coords?
#1

i have certin coords where i want command to work how can i make like that?
Reply
#2

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

In your command, you can call this function to check if they are within a certain range of coordinates. Unless you want it to only work in a square area.

pawn Код:
stock IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)
{
    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);
}
Reply
#4

Got it working Thnx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)