30.10.2014, 16:47
Can someone teach me about the IfPlayerIsInRangeOfPoint code and how to put in in use in command so the player has to be near a certain point to use the command.
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;
}
CMD:heal(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 10, 1212.258, -1326.565, 15.0) return SendClientMessage(playerid, -1, "You should be near hospital to use this command.");
SetPlayerHealth(playerid, 100.0);
return 1;
}