17.09.2012, 17:48
I need /admin command if someone writing this command he'll see all of the /online/ admins.
Thanks!
Thanks!
COMMAND:admins(playerid,params[])
{
SendClientMessage(playerid, ORANGE, " ");
SendClientMessage(playerid, ORANGE, "----' Online Admins '----");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][Adminlevel] >= 1 || pInfo[i][Adminlevel] <= 5)
{
new admtext[64], id[MAX_PLAYER_NAME], string[256];
if(pInfo[i][Adminlevel] == 1) {admtext = "Level: 1 (Administrator)";}
else if(pInfo[i][Adminlevel] == 2) {admtext = "Level: 2, (Master Administrator)";}
else if(pInfo[i][Adminlevel] == 3) {admtext = "Level: 3, (Lead Moderator)";}
else if(pInfo[i][Adminlevel] == 4) {admtext = "Level: 4, (Master Moderator)";}
else if(pInfo[i][Adminlevel] == 5) {admtext = "Level: 5, (Owner)";}
else if(IsPlayerAdmin(i)) {admtext = "RCON Administrator";}
else {admtext = "No admins online";}
GetPlayerName(i, id, sizeof(id));
format(string, 256, "%s ( %s )", id, admtext);
SendClientMessage(playerid, GREEN, string);
}
}
}
return 1;
}
CMD:admins(playerid, params[]) { new string[128]; new count = 0; SendClientMessage(playerid, COLOR_PURPLE, "|____________________Admins Online____________________|"); { if(PlayerInfo[playerid][pAdminLevel] == 1) { format(string, 256, "Administrator: %s - [Administrator: %s]",RPALN(playerid), RPN(playerid)); SendClientMessage(playerid, COLOR_WHITE, string); count++; } } return 1; }
CMD:admins(playerid, params[])
{
new string[128];
new count = 0;
SendClientMessage(playerid, COLOR_PURPLE, "|____________________Admins Online____________________|");
{
if(IsPlayerAdmin(playerid))
{
format(string, sizeof(string), "Administrator: %s ",adminid(admin)); // replace it with your admin variable
SendClientMessage(playerid, -1, string);
count++;
}
}
return 1;
}
pawn Code:
And please whenever you copy-paste code from your scripts, atleast try to change your variable to their adjustments. |
warning 203: symbol is never used: "admins" |
CMD:admins(playerid, params[])
{
foreach(Player, i)
{
new level[16], string[256], name[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
if(pInfo[i][Admin] > 0)
{
switch(pInfo[i][Admin])
{
case 1: level = "Admin Level 1";
case 2: level = "Admin Level 2";
case 3: level = "Admin Level 3";
case 4: level = "Lead Admin";
case 1337: level = "Owner";
}
format(string, sizeof(string), ""COL_BLUE"%s - "COL_WHITE"%s\n", level, name);
ShowPlayerDialog(playerid, D_ADMINS, DIALOG_STYLE_MSGBOX, "Admins online (Level - Nick)", string, "Close", "");
}
}
return 1;
}