SA-MP Forums Archive
[SOLVERD]dcmd_admins - 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: [SOLVERD]dcmd_admins (/showthread.php?tid=120855)



[SOLVERD]dcmd_admins - `FuTuRe- - 13.01.2010

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;
}



Re: dcmd_admins - Flo_White - 13.01.2010

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



Re: dcmd_admins - Correlli - 13.01.2010

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


Re: dcmd_admins - `FuTuRe- - 13.01.2010

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


Re: dcmd_admins - Correlli - 13.01.2010

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



Re: dcmd_admins - `FuTuRe- - 13.01.2010

Tyvm,


Re: [SOLVERD]dcmd_admins - Niixie - 13.01.2010

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


Re: [SOLVERD]dcmd_admins - `FuTuRe- - 13.01.2010

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