Need help with 2 cmds..
#7

Код:
CMD:tempadmin(playerid, params[])
{
   new Player, tempadmin;
   if(sscanf2(params, "ui", Player, Level))
   {
   if(PlayerInfo[playerid][pAdminLevel] > 4)
   {
   if(IsPlayerConnected(playerid) && IsPlayerConnected(Player))
   {
      if(gPlayerLogged[playerid] == 1)
      {
          new Player;
           new Level;
          {
              if(Player == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!" );
            if(Level > 3) return SendClientMessage(Playerid, COLOR_RED, "SERVER: Maximum level is 2!" );
                if(Player == INVALID_PLAYER_ID) return SendClientMessage(playerid,red,"ERROR: Wrong player ID");
                if(PlayerInfo[Player][pAdminLevel] >= PlayerInfo[playerid][pAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cant perform this on Admins that are equal or higher than your level!");
            PlayerInfo[Player][pAdminLevel] = Level;
            PlayerInfo[Player][pTempLevel] = Level;
            new tname[MAX_PLAYER_NAME];
            GetPlayerName(Player,tname,sizeof(tname));
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(playerid,pname,sizeof(pname));
            new MyString[128];
            new TargetString[128];
            format(MyString,sizeof MyString, "You have set %s temporary Admin Level to %i!", tname, Level);
            format(TargetString,sizeof TargetString, "You are now temporary Admin Level %i, thanks to %s!", Level, pname || Any kind of abuse will get you warned/banned from server);
            SendClientMessage(Target, COLOR_RED, TargetString);
            SendClientMessage(playerid, COLOR_GREEN, MyString);
            new File:Log = fopen(adminPATH, io_append);
             new logData[128];
            new fTime[6];
            getdate(fTime[0], fTime[1], fTime[2]);
            gettime(fTime[3], fTime[4], fTime[5]);
            format(logData, sizeof logData, "[%02d/%02d/%04d || %02d:%02d:%02d]%s made %s temporary Admin Level: %d!\r\n", fTime[2], fTime[1], fTime[0], fTime[3], fTime[4], fTime[5], pname, tname, Level);
            fwrite(Log, logData);
            fclose(Log);
          }
          else SendClientMessage(playerid, COLOR_RED, "USAGE: /tempadmin <playerid> <temp-level>");
      }
      else SendClientMessage(playerid,red,"ERROR: You must be logged in to perform this command!");
   }
   else SendClientMessage(playerid, red, "ERROR: You have to be an Admin level 4 or higher to perform this command!");
   return 1;
}
Код:
CMD:tempvip(playerid, params[])
{
   new Player, TempPrem;
   if(sscanf2(params, "ui", Player, Level))
   if(PlayerInfo[playerid][pAdminLevel] > 4)
   {
   if(IsPlayerConnected(playerid) && IsPlayerConnected(Player))
   {
      if(gPlayerLogged[playerid] == 1)
      {
          new Player;
           new Level;
          {
              if(Player == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!" );
            if(Level > 3) return SendClientMessage(playerid, COLOR_RED, "SERVER: Maximum level is 2!");
                if(Player == INVALID_PLAYER_ID) return SendClientMessage(playerid,red,"ERROR: Wrong player ID");
                if(PlayerInfo[Player][pAdminLevel] > 4) return SendClientMessage(playerid,red,"ERROR: You cant perform this on Admins that are equal or higher than your level!");
            PlayerInfo[Player][pPremiumlevel] = Level;
            PlayerInfo[Player][pTempPremium] = Level;
            new tname[MAX_PLAYER_NAME];
            GetPlayerName(Player,tname,sizeof(tname));
            new pname[MAX_PLAYER_NAME];
            GetPlayerName(playerid,pname,sizeof(pname));
            new MyString[128];
            new TargetString[128];
            format(MyString,sizeof MyString, "You have set %s temporary Premium Level to %i!", tname, Level);
            format(TargetString,sizeof TargetString, "You are now temporary Premium Level %i, thanks to %s!", Level, pname);
            SendClientMessage(Player, COLOR_RED, TargetString);
            SendClientMessage(playerid, COLOR_GREEN, MyString);
          }
          else SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /tempvip <playerid> <temp-level>");
      }
      else SendClientMessage(playerid,red,"ERROR: You must be logged in to perform this command!");
   }
   else SendClientMessage(playerid, red, "ERROR: You have to be an Admin level 4 or higher to perform this command!");
   return 1;
}
He will fire you lol.
PS: I had these commands somewhere lol.
Reply


Messages In This Thread
Need help with 2 cmds.. - by Ryan_Redfield - 18.10.2012, 18:30
Re: Need help with 2 cmds.. - by RedJohn - 18.10.2012, 19:25
Respuesta: Need help with 2 cmds.. - by AaronKillz - 18.10.2012, 19:35
Re: Need help with 2 cmds.. - by Dizzle - 18.10.2012, 19:48
Re: Need help with 2 cmds.. - by Ryan_Redfield - 19.10.2012, 09:25
Re: Need help with 2 cmds.. - by gtakillerIV - 19.10.2012, 09:27
Re: Need help with 2 cmds.. - by RanSEE - 19.10.2012, 09:30

Forum Jump:


Users browsing this thread: 1 Guest(s)