03.08.2011, 13:03
Hi,
I want to put this, when a admin is online, i want one admin under other one,
Incorrect: Admins online: Player1, Player2, Player3
Correct: Admin Online:
Player 1
Player2
Player3
I want the correct one
I want to put this, when a admin is online, i want one admin under other one,
Incorrect: Admins online: Player1, Player2, Player3
Correct: Admin Online:
Player 1
Player2
Player3
I want the correct one
pawn Код:
dcmd_admins(playerid,params[]) {
#pragma unused params
new Count[2], i, string[128];
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
if(PlayerInfo[i][Level] > 0) Count[0]++;
if(IsPlayerAdmin(i)) Count[1]++;
}
#if defined HIDE_ADMINS
if(PlayerInfo[playerid][Level] == 0) {
if(Count[0] >= 1) {
format(string, sizeof(string), "There are %d Administrators online. Use /report <id> <reason> if you suspect a player of cheating", Count[0]);
return SendClientMessage(playerid, COLOR_DRED, string);
} else return SendClientMessage(playerid, COLOR_DRED, "Admins Online:");
}
#endif
if( (Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][Level] == 0) ) return SendClientMessage(playerid, COLOR_DRED, "Admins Online:");
if(Count[0] == 1) {
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Level] > 0) {
format(string, sizeof(string), "Admins Online: %s [%d]", PlayerName2(i), PlayerInfo[i][Level] ); SendClientMessage(playerid, COLOR_DRED, string);
}
}
if(Count[0] > 1) {
new x; format(string, sizeof(string), "Admins Online: ");
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Level] > 0)
{
format(string,sizeof(string),"%s%s [%d]",string,PlayerName2(i),PlayerInfo[i][Level]);
x++;
if(x >= 5) {
SendClientMessage(playerid, COLOR_DRED, string); format(string, sizeof(string), "Admins Online: "); x = 0;
}
else format(string, sizeof(string), "%s, ", string);
}
if(x <= 4 && x > 0) {
string[strlen(string)-3] = '.';
SendClientMessage(playerid, COLOR_DRED, string);
}
}
if( (Count[1] == 1) && (PlayerInfo[playerid][Level] > 0) ) {
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i)) {
format(string, sizeof(string), "RCON Admin: (%d)%s", i, PlayerName2(i)); SendClientMessage(playerid, COLOR_LIGHTRED, string);
}
}
if(Count[1] > 1) {
new x; format(string, sizeof(string), "RCON Admins: ");
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
{
format(string,sizeof(string),"%s(%d)%s",string,i,PlayerName2(i));
x++;
if(x >= 5) {
SendClientMessage(playerid, COLOR_LIGHTRED, string); format(string, sizeof(string), "RCON Admins: "); x = 0;
}
else format(string, sizeof(string), "%s, ", string);
}
if(x <= 4 && x > 0) {
string[strlen(string)-3] = '.';
SendClientMessage(playerid, COLOR_LIGHTRED, string);
}
}
return 1;
}