02.08.2012, 16:07
The command is working but if its 2 players online it will send the "admins online" twice, and if its 1 online once, and if its 3 online it will send it 3 times. Help? Thanks!
Код:
YCMD:admins(playerid, params[], help)
{
#pragma unused help
new
string[128];
foreach(Player, i) {
if(P_Data[i][pAdmin] == 1) { format(string,sizeof(string),""COL_GREEN"Helper %s",GetName(i)); }
else if(P_Data[i][pAdmin] == 2) { format(string,sizeof(string),""COL_GREEN"Jr.Moderator %s",GetName(i)); }
else if(P_Data[i][pAdmin] == 3) { format(string,sizeof(string),""COL_GREEN"Moderator %s",GetName(i)); }
else if(P_Data[i][pAdmin] == 4) { format(string,sizeof(string),""COL_GREEN"Admin %s",GetName(i)); }
else if(P_Data[i][pAdmin] == 5) { format(string,sizeof(string),""COL_GREEN"Owner %s",GetName(i)); }
if(IsPlayerAdmin(i)) { format(string,sizeof(string),""COL_GREEN"RCON Admin %s",GetName(i)); }
SCM(playerid,-1,"Admins online:");
SCM(playerid,-1,string); }
return 1;
}


