Can someone teach me this.
#2

IsPlayerInRangeOfPoint(playerid, range, X, Y, Z)

check playerid in range of X , Y , Z coordinates with radius range.

for example you want to make a " /heal " command that work just near hospital. (max distance is 10)

hospital coord is :
1212.258, -1326.565, 15.0

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/heal", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,1212.258, -1326.565, 15.0))
        {
          SetPlayerHealth(playerid,100.0);
        }
        else
        {
         SendClientMessage(playerid,-1,"{FF0000}you should near hospital to use this command.");
        }
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Can someone teach me this. - by kingcrome - 30.10.2014, 16:47
Re: Can someone teach me this. - by M4D - 30.10.2014, 17:02
Re: Can someone teach me this. - by Rudy_ - 30.10.2014, 17:06

Forum Jump:


Users browsing this thread: 1 Guest(s)