help me with this admin script please
#1

pawn Код:
if (strcmp(cmdtext, "/admins", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            SendClientMessage(playerid, COLOR_GREEN, "Admins Online:");
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pHide] == 0)
                    {
                        new admin[20];
                        if(PlayerInfo[playerid][pAdmin] == 1) { admin = "Test Admin"; }
                        else if(PlayerInfo[playerid][pAdmin] == 2) { admin = "Moderator"; }
                        else if(PlayerInfo[playerid][pAdmin] == 3) { admin = "Administrator"; }
                        else if(PlayerInfo[playerid][pAdmin] == 4) { admin = "Owner"; }
                        new sendername[MAX_PLAYER_NAME];
                        GetPlayerName(i, sendername, sizeof(sendername));
                        if(PlayerInfo[i][aDuty] == 0)
                        {
                            format(string, 256, "%s:{FFFF00}%s(ID:%d)   {FF0000}Off-Duty",admin,  sendername, i);
                            SendClientMessage(playerid, COLOR_RED, string);
                        }
                        else if(PlayerInfo[i][aDuty] == 1)
                        {
                            format(string, 256, "%s:{FFFF00}%s(ID:%d)   {00FF00}On-Duty",admin, sendername, i);
                            SendClientMessage(playerid, COLOR_GREEN, string);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_YELLOW, "No admins online!");
                        }
                    }
                }
            }
            SendClientMessage(playerid, COLOR_GREEN, "______________");
        }
        return 1;
    }
when i use command all admins have the first listed admin rank?
Reply
#2

Quote:
Originally Posted by Hugoca
Посмотреть сообщение
pawn Код:
I HAVE NO IDEA WHAT IM DOING
when i use command all admins have the first listed admin rank?
Yes, what is the problem then?
Reply
#3

Hm..The problem is this:
Owner:[KOD]MrTinder Off-Duty
Owner:wManiak Off-Duty
but the wmaniak is 2 level admin ?
Reply
#4

pawn Код:
if(PlayerInfo[playerid][pAdmin] == 1) { admin = "Test Admin"; }
                        else if(PlayerInfo[playerid][pAdmin] == 2) { admin = "Moderator"; }
                        else if(PlayerInfo[playerid][pAdmin] == 3) { admin = "Administrator"; }
                        else if(PlayerInfo[playerid][pAdmin] == 4) { admin = "Owner"; }
it should be 'i', not 'playerid'.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)