healing if in ambulance
#7

ok... i got most of it all sorted out now but for some reason it dosent seam to work as well. anyone can do /heal but it wont acculy work it will only show this [INFO:] /heal [playerid/PartOfName] ,im not sure what is holding it up now

pawn Код:
if(strcmp(cmd, "/heal", true) == 0)
  {
    if(IsPlayerConnected(playerid))
    {
      if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 2)
      {
                giveplayerid = ReturnUser(tmp);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[INFO:] /heal [playerid/PartOfName]");
            return 1;
        }
        tmp = strtok(cmdtext, idx);
        if (giveplayerid == playerid)
                {
            SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You can not heal yourself!");
            return 1;
        }
        if(giveplayerid != INVALID_PLAYER_ID)
        {
            new giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME];
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new giveambu = GetPlayerVehicleID(giveplayerid);
            new playambu = GetPlayerVehicleID(playerid);
            {
            if (IsAnAmbulance(playambu) && playambu == giveambu)
            {
                new Float:tempheal;
                GetPlayerHealth(giveplayerid,tempheal);
                if(tempheal >= 100.0)
                {
                SendClientMessage(playerid, COLOR_LIGHTYELLOW2," [ERROR:]That person is fully healed.");
                return 1;
                }
                GameTextForPlayer(playerid, string, 5000, 1);
                new hp = 100;
                SetPlayerHealth(giveplayerid, 100);
                format(string, sizeof(string), "[INFO:]You have been healed to %d health",hp);
                SendClientMessage(giveplayerid, COLOR_LIGHTYELLOW2,string);
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[INFO:]One of you is not in the Ambulance / Chopper!");
                return 1;
            }
            }
        }
        else
        {
            format(string, sizeof(string), "[ERROR:]%d is not an active player.", giveplayerid);
            SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string);
                }
      }
      else
        {
            SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Invalid Faction.");
            return 1;
        }
    }
    return 1;
  }
Reply


Messages In This Thread
healing if in ambulance - by [LCG]TANKER - 16.04.2009, 22:43
Re: healing if in ambulance - by Snyper18 - 16.04.2009, 22:45
Re: healing if in ambulance - by [LCG]TANKER - 16.04.2009, 22:51
Re: healing if in ambulance - by DMSOrg - 16.04.2009, 22:56
Re: healing if in ambulance - by RobertGraham - 16.04.2009, 22:59
Re: healing if in ambulance - by [LCG]TANKER - 16.04.2009, 23:01
Re: healing if in ambulance - by [LCG]TANKER - 17.04.2009, 02:41

Forum Jump:


Users browsing this thread: 2 Guest(s)