23.12.2013, 15:06
(
Last edited by Threshold; 24/12/2013 at 01:44 AM.
)
This is a more efficient usage of the code:
pawn Code:
COMMAND:admins(playerid, params[])
{
new str[30], count = 0;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(pInfo[i][pAdmin] < 1) continue;
if(count == 0) SendClientMessage(playerid,0x9BBDDEAA,"Present Staff Members:");
new name[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
format(str, sizeof(str), "%s(%d)", name, i);
SendClientMessage(playerid, 0x9BBDDEAA, str);
count++;
}
if(count == 0) return SendClientMessage(playerid,0x9BBDDEAA,"No Admins online");
return 1;
}