#1

Admin cmd like this:

pawn Код:
dcmd_admins(playerid,params[])
{
    #pragma unused params
        new count = 0;
        new string[128];
        SendClientMessage(playerid, green, " ");
        SendClientMessage(playerid, green, "___________ |- Online Admins -| ___________");
        SendClientMessage(playerid, green, " ");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if (IsPlayerConnected(i))
        {
        if(AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0)
        {
        if(AccInfo[i][Level] > 5) {
        AdmRank = "Professional Admin";
        }
        if(IsPlayerAdmin(i)) AdmRank = "RCON Administrator";
        else
        switch(AccInfo[i][Level])
        {
        case 1: AdmRank = "Basic Moderator";
        case 2: AdmRank = "Moderator";
        case 3: AdmRank = "Master Moderator";
        case 4: AdmRank = "Administrator";
        case 5: AdmRank = "Master Administrator";
        }
        format(string, 128, "%s (Id:%i) | Level: %d - %s",PlayerName2(i),i,AccInfo[i][Level], AdmRank);
        SendClientMessage(playerid, LIGHTBLUE2, string);
        count++;
        }
        }
        }
        if (count == 0)
        SendClientMessage(playerid,red,"No admin online in the list");
        SendClientMessage(playerid, green, " _______________________________________");
        return 1;
}
But in strmp How to make it?
Reply
#2

pawn Код:
if(!strcmp(cmdtext, "/admins", true))
{
   new count = 0;
   new string[128];
   SendClientMessage(playerid, green, " ");
   SendClientMessage(playerid, green, "|- Online Admins -| ___________");
   SendClientMessage(playerid, green, " ");
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
      if (IsPlayerConnected(i))
      {
         if(AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0)
         {
            if(AccInfo[i][Level] > 5)
            {
               AdmRank = "Professional Admin";
            }
            if(IsPlayerAdmin(i)) AdmRank = "RCON Administrator";
            else switch(AccInfo[i][Level])
            {
               case 1: AdmRank = "Basic Moderator";
               case 2: AdmRank = "Moderator";
               case 3: AdmRank = "Master Moderator";
               case 4: AdmRank = "Administrator";
               case 5: AdmRank = "Master Administrator";
            }
            format(string, 128, "%s (Id:%i) | Level: %d - %s",PlayerName2(i),i,AccInfo[i][Level], AdmRank);
            SendClientMessage(playerid, LIGHTBLUE2, string);
            count++;
         }
      }
   }
   if (count == 0)
   SendClientMessage(playerid,red,"No admin online in the list");
   SendClientMessage(playerid, green, " _______________________________________");
   return 0x1;
}
Reply
#3

The thing is....I just have 1 lvl in my server how I can set it that if there is any admin online then just say the name?

pawn Код:
C:\Users\Alex\Desktop\Untitled.pwn(125) : error 017: undefined symbol "AccInfo"
C:\Users\Alex\Desktop\Untitled.pwn(125) : warning 215: expression has no effect
C:\Users\Alex\Desktop\Untitled.pwn(125) : error 001: expected token: ";", but found "]"
C:\Users\Alex\Desktop\Untitled.pwn(125) : error 029: invalid expression, assumed zero
C:\Users\Alex\Desktop\Untitled.pwn(125) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)