i want to make admin command
#3

pawn Код:
enum pInfo
{
      pMoney,
      pAdmin,   // we need only this one
      pAduty,   // and this one for this command
      Float:pPosX,
      Float:pPosY,
      Float:pPosZ
}
new PlayerInfo[MAX_PLAYERS][pInfo];


CMD:heal(playerid, params[])
{
         new targetid;
         if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/heal [id]");
         if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "That player isn't logged in.");
         if(PlayerInfo[playerid][pAdmin] != 1) return SendClientMessage(playerid, -1, "You aren't an admin");
         if(PlayerInfo[playerid][pAduty] != 0) return SendClientMessage(playerid, -1, "You aren't on admin duty.");
         if(targetid == playerid)
         {
               SendClientMessage(playerid, -1, "You have healed yourself");
               SetPlayerHealth(playerid, 100);
         }
         else
         {
              new pname[MAX_PLAYER_NAME], string[64];
              GetPlayerName(targetid, pname, sizeof(pname));            
              format(string, sizeof(string), "You have healed %s", pname);
              SetPlayerHealth(targetid, 100);
              SendClientMessage(playerid, -1, string);
         }
         return 1;
}
Reply


Messages In This Thread
i want to make admin command - by zZzTGTzZz - 02.11.2017, 12:43
Re: i want to make admin command - by scripter111 - 02.11.2017, 13:40
Re: i want to make admin command - by Lucases - 02.11.2017, 13:43

Forum Jump:


Users browsing this thread: 1 Guest(s)