15.07.2012, 18:19
How would i do /admins to display all online admins
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;
}