Heal in red marker
#10

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..
Reply


Messages In This Thread
Heal in red marker - by killdahobo99 - 15.06.2009, 21:44
Re: Heal in red marker - by miokie - 15.06.2009, 21:45
Re: Heal in red marker - by joeri55 - 15.06.2009, 21:56
Re: Heal in red marker - by killdahobo99 - 15.06.2009, 23:27
Re: Heal in red marker - by steven_italy - 16.06.2009, 00:49
Re: Heal in red marker - by yezizhu - 16.06.2009, 01:05
Re: Heal in red marker - by killdahobo99 - 16.06.2009, 01:08
Re: Heal in red marker - by sidhu123 - 16.06.2009, 01:10
Re: Heal in red marker - by killdahobo99 - 16.06.2009, 01:35
Re: Heal in red marker - by Moustafa - 16.06.2009, 01:49

Forum Jump:


Users browsing this thread: 1 Guest(s)