17.10.2012, 19:16
I wouldn't use the one Roel used, because this will look like this with 4 RCON admins:
Rcon Admin: KwardeRcon Admin:KevinRcon Admin: PlayerRcon Admin:Admin
I'd prefer this one:
When no RCON admins are logged in, you'll get a red text saying * No RCON admins online!. Otherwise, with 4 RCON admins, it'd look like this:
* Online RCON admin(s):
Kwarde , Kevin , Player , Admin
Rcon Admin: KwardeRcon Admin:KevinRcon Admin: PlayerRcon Admin:Admin
I'd prefer this one:
pawn Код:
CMD:admins(playerid, params[])
{
new str[128], pName[MAX_PLAYER_NAME], adminCount;
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (!IsPlayerConnected(i) || !IsPlayerAdmin(i)) continue; //Skip non-RCON admins and non-connected players
adminCount++;
GetPlayerName(i, pName, MAX_PLAYER_NAME);
if (adminCount == 1) format (str, 128, "%s", pName);
else if(adminCount > 1) format(str, 128, "%s , %s", str, pName);
}
if (adminCount >= 1)
{
SendClientMessage(playerid, 0x00FF00AA, "* Online RCON admin(s):");
SendClientMessage(playerid, 0xFFFFFFAA, str);
}
else SendClientMessage(playerid, 0xFF0000AA, "* No RCON admins online!");
return 1;
}
* Online RCON admin(s):
Kwarde , Kevin , Player , Admin