CMD:admins(playerid,params[]) { new Count, string[128]; SendClientMessage(playerid, COLOR_RED, "__________|Online Admins|__________"); SendClientMessage(playerid, COLOR_RED, " "); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] >=1) { format(string,sizeof(string),"| Admin: %s(ID:%d) || Level: %s(%d) |",PlayerName(i),i,AdminLevelName(i),PlayerInfo[i][pAdmin]); SendClientMessage(playerid,COLOR_RED,string); Count++; } } } if(Count == 0) SendClientMessage(playerid, COLOR_RED, "None Admin Online"); SendClientMessage(playerid, COLOR_RED, "____________________________"); return 1; }CMD:admins(playerid,params[]) { new Count, string[128]; SendClientMessage(playerid, COLOR_RED, "__________|Online Admins|__________"); SendClientMessage(playerid, COLOR_RED, " "); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] >=1) { format(string,sizeof(string),"| Admin: %s(ID:%d) || Level: %s(%d) |",PlayerName(i),i,AdminLevelName(i),PlayerInfo[i][pAdmin]); SendClientMessage(playerid,COLOR_RED,string); Count++; } } } if(Count == 0) SendClientMessage(playerid, COLOR_RED, "None Admin Online"); SendClientMessage(playerid, COLOR_RED, "____________________________"); return 1; }
stock AdminLevelName(playerid) { new adminlevelname[128]; switch(PlayerInfo[playerid][pAdmin]) { case 0: adminlevelname = "Player"; case 1: adminlevelname = "Basic Admin"; case 2: adminlevelname = "Junior Admin"; case 3: adminlevelname = "Senior Admin"; case 4: adminlevelname = "Lead Admin"; case 5: adminlevelname = "Head Admin"; case 6: adminlevelname = "Community Co-Owner"; case 7: adminlevelname = "Community Owner"; } return adminlevelname; }
// The command "/admins".
CMD:admins(playerid, params[])
{
new count = 1, string[828];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && adminLevel[i] >= 1)
{
// String
format(string, sizeof(string), "%s(%i) - Admin Level: %i\n",PlayerName(i), i, adminLevel[i]);
count ++;
}
}
if(count != 1)
{
// Shows the admins that are present
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Administrators", string, "Close", "");
}
else
{
// No admins online
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Admins", "{FFFFFF}There are no administrators online at the moment.", "OK", "");
}
}
return 1;
}
// The command "/helpers".
CMD:helpers(playerid, params[])
{
new count = 1, string[828];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && helperLevel[i] >= 1)
{
// String
format(string, sizeof(string), "%s(%i) - Helper Level: %i\n",PlayerName(i), i, helperLevel[i]);
count ++;
}
}
if(count != 1)
{
// Shows the helpers that are present
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Helpers", string, "Close", "");
}
else
{
// No helpers online
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Helpers", "{FFFFFF}There are no helpers online at the moment.", "OK", "");
}
}
return 1;
}
Well make a ShowPlayerDialog, or just get a scripter on the Scripter Request part , do not ask people to script you stuff and not appreciate it.
|
CMD:admins(playerid, params[]) {
new string[256], count = 0;
foreach(Player, i)
{
if(!PlayerInfo[ i ][ AdminLevel ]) continue;
format(string, sizeof(string), "%s\n{64CC66}%s %s{FFFFFF}(%d)", string, AdminRank(i), PlayerInfo[ i ][ PlayerName ], i), count++;
}
if(count) ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "List of online administrators" , string, "Close", "");
else ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Note" , "There aren't any online administrators.", "Close", "");
return 1;
}
stock AdminRank(playerid)
{
new string[16];
switch(PlayerInfo[ playerid ][ AdminLevel ])
{
case 0: string = "Player";
case 1: string = "Moderator";
case 2: string = "Super Moderator";
case 3: string = "Admin";
case 4: string = "Senior Admin";
case 5: string = "Head Admin";
default: string = "Unknown";
}
return string;
}