/makeadmin Help +REP
#1

Why When I Type /makeadmin It Normally Sets The Player That Has Typed It To Level 0,Without Typing /makeadmin [playerid] [1 - 10] only /makeadmin in these codes:

PHP код:
COMMAND:makeadmin(playeridparams[])
{
        new 
giveplayeridlevelMessage4[128], PNAME[MAX_PLAYER_NAME], PNAME2[MAX_PLAYER_NAME];
        if(
sscanf(params"ud"giveplayeridlevel))
        {
          
SendClientMessage(playerid, -1"USAGE: /makeadmin <playerid> <Admin level 1 - 10>");
          
SendClientMessage(playerid0x008CFFFF"NOTE: Admin Level 1 = Trial Moderator, Admin Level 2 = Moderator, Admin Level 3 = Master Moderator");
          
SendClientMessage(playerid0x008CFFFF"NOTE: Admin Level 4 = Trial Adminstrator, Admin Level 5 = Adminstrator, Admin Level 6 = Master Adminstrator");
          
SendClientMessage(playerid0x008CFFFF"NOTE: Admin Level 7 = Head Adminstrator, Admin Level 8 = Trusted Adminstrator, Admin Level 9 = Co-Owner, Admin Level 10 = Owner");
        }
        if(
PlayerInfo[playerid][pAdmin] < 10) return SendClientMessage(playerid0xFF0000FF"You Are Not The Owner!");
        if(!
IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid0xFF0000FF"Player Is Not Connected!");
        if(
level 10 || level 0) return SendClientMessage(playerid0xFF0000FF"Admin Levels Cannot Be More Than 10 Or Less Than 1!");
        
GetPlayerName(giveplayeridPNAMEMAX_PLAYER_NAME);
        
GetPlayerName(playeridPNAME2MAX_PLAYER_NAME);
        if(
PlayerInfo[giveplayerid][pAdmin] > 0)
        {
          switch(
PlayerInfo[giveplayerid][pAdmin])
          {
          case 
1AdmRank "Trial Moderator";
          case 
2AdmRank "Moderator";
          case 
3AdmRank "Master Moderator";
             case 
4AdmRank "Trial Administrator";
          case 
5AdmRank "Administrator";
          case 
6AdmRank "Master Adminstrator";
          case 
7AdmRank "Head Adminstrator";
          case 
8AdmRank "Trusted Adminstrator";
          case 
9AdmRank "Co-Owner";
          case 
10AdmRank "Owner";
          }
          if(
PlayerInfo[giveplayerid][pAdmin] < level)
          {
            
format(Message4sizeof(Message4), "You Have Been Promoted To Level {00FFFB}%d - %s{FF5900}."PlayerInfo[playerid][pAdmin], AdmRank), SendClientMessage(giveplayerid0xFF5900FFMessage4);
            
format(Message4sizeof(Message4), "%s (%d) Has Been Promoted To Level {00FFFB}%d - %s{00FFFF}."PNAME ,PlayerInfo[playerid][pAdmin], AdmRank), SendClientMessageToAll(0x00FFFFFFMessage4);
            
PlayerInfo[giveplayerid][pAdmin] = level;
            
GameTextForPlayer(giveplayerid"~g~Promoted"50004);
            foreach(
Playeri)
            {
              if(
PlayerInfo[i][pAdmin] > 0)
              {
                
format(Message4sizeof(Message4), "The Owner %s (%d) Has Made %s (%d) An Admin Level {00FFFB}%d - %s{FF5900}.",PNAME2playeridPNAMEgiveplayeridPlayerInfo[playerid][pAdmin], AdmRank), SendClientMessage(i0xFF5900FFMessage4);
              }
            }
          }
          else if(
PlayerInfo[giveplayerid][pAdmin] > level)
          {
            
format(Message4sizeof(Message4), "You Have Been Demoted To Level {00FFFB}%d - %s{FF5900}."PlayerInfo[playerid][pAdmin], AdmRank), SendClientMessage(giveplayerid0xFF5900FFMessage4);
            
format(Message4sizeof(Message4), "%s (%d) Has Been Demoted To Level {00FFFB}%d - %s{00FFFF}."PNAME ,PlayerInfo[playerid][pAdmin], AdmRank), SendClientMessageToAll(0x00FFFFFFMessage4);
            
PlayerInfo[giveplayerid][pAdmin] = level;
            
GameTextForPlayer(giveplayerid"~r~Demoted"50004);
            foreach(
Playeri)
            {
              if(
PlayerInfo[i][pAdmin] > 0)
              {
                
format(Message4sizeof(Message4), "The Owner %s (%d) Has Made %s (%d) An Admin Level {00FFFB}%d - %s{FF5900}.",PNAME2playeridPNAMEgiveplayeridPlayerInfo[playerid][pAdmin], AdmRank), SendClientMessage(i0xFF5900FFMessage4);
              }
            }
          }
        }
        return 
1;

Reply


Messages In This Thread
/makeadmin Help +REP - by Youssef214 - 14.06.2014, 05:38
Re: /makeadmin Help +REP - by BroZeus - 14.06.2014, 06:26
Re: /makeadmin Help +REP - by 1FreeHost - 14.06.2014, 06:29
Re: /makeadmin Help +REP - by BroZeus - 14.06.2014, 06:36
Re: /makeadmin Help +REP - by Threshold - 14.06.2014, 06:51
Re: /makeadmin Help +REP - by Youssef214 - 14.06.2014, 09:38
Re: /makeadmin Help +REP - by Threshold - 14.06.2014, 09:52

Forum Jump:


Users browsing this thread: 1 Guest(s)