30.10.2014, 17:02
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
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;
}