Here you are:
Put this at the bottom of your script:
pawn Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}
and then, at public OnPlayerCommandText(playerid, cmdtext[]) type this:
pawn Код:
if(strcmp(cmdtext,"/heal",true ) == 0 )
{
if (PlayerToPoint(2, playerid, x, y, z)) // Replace X, Y, Z with the Co-Ords where you should be to do /heal
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR, " MESSAGE"); // Replace color with a color code, and replace message with any message you want
return 1;
}
And about the checkpoint do as what steve_italy told you.. Good luck!
PS: If it didn't work, please tell me..