Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static labels[][] = {"Moderators: ", "Junior Administrators: ", "Senior Administrators: ", "Lead Administrators: ", "Sever Managers: ", "Lead Managers: ", "Community Managers: ", "Community Owners: "};
- static str[144];
- new bool:add_comma = false, str_pos, total_admins, total_on_duty_admins,
- tmp[MAX_PLAYER_NAME + 6 + 2 + 16 + 1]; //{XXXXXX} + MAX_PLAYER_NAME + (xxxx) + {XXXXXX} + NULL ; xxxx? future proof the code to work when COD GW expands to a 1000 player server;
- SendClientMessage(playerid, ADMIN_BLUE, "Online staff:");
- for(new level = 8; level >= 1; level--)
- {
- add_comma = false;
- str[0] = 0;
- str_pos = strcat(str, labels[level - 1]);
- foreach(Player : i)
- {
- if(IsPlayerFlagSet(i, PLAYER_ADMIN_HIDDEN)) continue;
- if(levels[i] == level)
- {
- if(add_comma)
- {
- if(IsAdminOnDuty(i))
- {
- format(tmp, sizeof(tmp), ", {00D619}%s(%d){FFFFFF}", names[i], i);
- total_on_duty_admins++;
- }
- else
- format(tmp, sizeof(tmp), ", %s(%d)", names[i], i);
- }
- else
- {
- if(IsAdminOnDuty(i))
- {
- format(tmp, sizeof(tmp), "{00D619}%s(%d){FFFFFF}", names[i], i);
- total_on_duty_admins++;
- }
- else
- format(tmp, sizeof(tmp), "%s(%d)", names[i], i);
- }
- add_comma = true;
- if((str_pos += strcat(str, tmp)) > (144 - sizeof(tmp)))
- {
- SendClientMessage(playerid, WHITE, str);
- str[0] = 0;
- str_pos = strcat(str, labels[level - 1]);
- add_comma = false;
- }
- total_admins++;
- }
- }
- if(add_comma) SendClientMessage(playerid, WHITE, str);
- }
- if(total_on_duty_admins) SendClientMessage(playerid, WHITE, "The administrators who are coloured {00D619}GREEN{FFFFFF} are on duty.");
- if(!total_admins) SendClientMessage(playerid, WHITE, "None.");
- }
Add Comment
Please, Sign In to add comment