/heal ID
#1

Hello, I'm almost finished with my /heal command, but the only thing I must fix is that only players in a specific range of the player should be able to heal the player. How do I do it?

pawn Код:
if(strcmp(cmd, "/heal", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "/heal ID");
                return 1;
            }
            new playa;
            playa = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(HealInfo[playerid][pHealkit] == 1)
            {
              if(IsPlayerConnected(playa))
              {
                if(playa != INVALID_PLAYER_ID)
                {
                  HealInfo[playerid][pHeal] = 0;
                        SetPlayerHealth(playa, 100);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command");
            }
        }
        return 1;
    }
Reply


Messages In This Thread
/heal ID - by Crusty - 21.06.2010, 13:32
Re: /heal ID - by ViruZZzZ_ChiLLL - 21.06.2010, 13:37
Re: /heal ID - by Crusty - 21.06.2010, 13:39
Re: /heal ID - by Naxix - 21.06.2010, 13:57
Re: /heal ID - by aircombat - 21.06.2010, 14:48
Re: /heal ID - by RatHack - 21.06.2010, 14:57
Re: /heal ID - by MWF2 - 21.06.2010, 15:15

Forum Jump:


Users browsing this thread: 3 Guest(s)