[SOLVERD]dcmd_admins
#1

Correct code = back in request of Niixie

pawn Код:
dcmd_admins(playerid, params[])
{
    #pragma unused params
    new string[128];
    if(IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid, COLOR_NOTICE, "[Online Administrators]");
        for (new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(pInfo[i][level] > 0 || pInfo[i][perfect] == 1)
                {
                    GetPlayerName(i , sendername, sizeof(sendername));
                    format(string, sizeof(string),"Administrator: %s", sendername);
                    SendClientMessage(playerid,chat, string);
                }
            }
        }
    }
    return 1;
}
Reply
#2

Код:
if(pInfo[playerid][level] > 0 || pInfo[playerid][perfect] == 1)
should be
Код:
if(pInfo[i][level] > 0 || pInfo[i][perfect] == 1)
Reply
#3

That's because you're checking your own admin level and name in the players loop.
Reply
#4

Quote:
Originally Posted by Flo_White
Код:
if(pInfo[playerid][level] > 0 || pInfo[playerid][perfect] == 1)
should be
Код:
if(pInfo[i][level] > 0 || pInfo[i][perfect] == 1)
I have done this.
Now if i am logged in and type /admins and my m8 is on it shows me 1 time.
But when my m8 types /admins he see's himself as admin which he is not.
Also when i make him admin i see myself twice in the list
Reply
#5

Quote:
Originally Posted by Don Correlli
That's because you're checking your own name in the players loop.
Reply
#6

Tyvm,
Reply
#7

Quote:
Originally Posted by `FuTuRe-
Fixed.
Dont delete your post just because its solved. Maybe other players should use what you've learned
Reply
#8

Fixed code = back since i don't got the deleted post
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)