SA-MP Forums Archive
/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)
+--- Thread: /admins (/showthread.php?tid=359897)



/admins - thefatshizms - 15.07.2012

How would i do /admins to display all online admins


Re: /admins - GSRP - 15.07.2012

This is assuming that you are using zcmd, and not strcmp.

pawn Код:
CMD:admins(playerid, params[])
{
    foreach(Player, i) // Make sure you have the 'foreach' include as well. if not, you can use for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pAdmin] >= 1) // or 2, your choice
        {
            // Assuming you don't have a function to get the players name, like RPN, or GetPlayerNameEx
            new pname[MAX_PLAYER_NAME], string[256];
            GetPlayerName(i, pname, sizeof(pname));
            format(string, sizeof(string), "Admin %s", pname);
            SendClientMessage(playerid, -1, string);
        }
    }
    return 1;
}
This is just a simple version. Does not include ranks, or anything like that. If you would like that, just message me.


Re: /admins - thefatshizms - 15.07.2012

i dont need ranks, thanks for this


Re: /admins - GSRP - 15.07.2012

Quote:
Originally Posted by thefatshizms
Посмотреть сообщение
i dont need ranks, thanks for this
No problem. Glad to help