SA-MP Forums Archive
Admins Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Admins Command (/showthread.php?tid=205053)



Admins Command - HyperZ - 31.12.2010

Fixed.


Re: Admins Command - jameskmonger - 31.12.2010

pawn Код:
dcmd_admins(playerid,params[])
{
    #pragma unused params
    new count,string[255];
    new AdmRank[128];
    for(new i,g=GetMaxPlayers(); i < g; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(1 <= PlayerInfo[i][Level] <= 6)
            {
                if(IsPlayerAdmin(i)) AdmRank = "Rcon Administrator";
                switch(PlayerInfo[i][Level])
                {
                    case 1: AdmRank = "VIP";
                    case 2: AdmRank = "Co-Mod";
                    case 3: AdmRank = "Mod";
                    case 4: AdmRank = "Admin";
                    case 5: AdmRank = "Leader";
                    case 6: AdmRank = "Manager";
                }
                format(string,255, "%s %s [%s], ",string,PlayerName2(i),AdmRank);
                SendClientMessage(playerid, blue, string);
                count++;
            }
        }
    }
    if(!count) SendClientMessage(playerid,red,"No admin online in the list");
    return 1;
}
Try that.


Re: Admins Command - MadeMan - 31.12.2010

pawn Код:
dcmd_admins(playerid,params[])
{
    #pragma unused params
    new count, bool:online;
    new string[128], AdmRank[64];
    for(new i,g=GetMaxPlayers(); i < g; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(1 <= PlayerInfo[i][Level] <= 6)
            {
                online = true;
                if(IsPlayerAdmin(i)) AdmRank = "Rcon Administrator";
                switch(PlayerInfo[i][Level])
                {
                    case 1: AdmRank = "VIP";
                    case 2: AdmRank = "Co-Mod";
                    case 3: AdmRank = "Mod";
                    case 4: AdmRank = "Admin";
                    case 5: AdmRank = "Leader";
                    case 6: AdmRank = "Manager";
                }
                format(string,sizeof(string), "%s %s [%s], ",string,PlayerName2(i),AdmRank);
                count++;
                if(count == 3)
                {
                    format(string,sizeof(string),"Admins: %s",string);
                    SendClientMessage(playerid, blue, string);
                    string = "";
                    count = 0;
                }
            }
        }
    }
    if(count)
    {
        format(string,sizeof(string),"Admins: %s",string);
        SendClientMessage(playerid, blue, string);
    }
    if(!online) SendClientMessage(playerid,red,"No admin online in the list");
    return 1;
}