11.05.2015, 18:13
I made This code but when there more than 2 admins online the server owner and scripter thin is printed again and again. I mean if there are 2 admins its printed 2 times and if there are 3 3 times and its annoying Can anyone help me please
Код:
CMD:admins(playerid, params[]) { #pragma unused params new count = 0, string[800], AdmRank[500]; for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { if(PlayerInfo[i][Level] >= 1 && PlayerInfo[i][Hide] == 0) { if(IsPlayerAdmin(i)) AdmRank ="{F3FF02}[The Server Guy!]"; else { switch(PlayerInfo[i][Level]) { case 1: AdmRank = "{FFD700}[Trial Admin]"; case 2: AdmRank = "{FF4500}[Server Admin]"; case 3: AdmRank = "{1E90FF}[Senior Admin]"; case 4: AdmRank = "{0000CD}[Lead Admin]"; case 5: AdmRank = "{00FF00}[Head Admin]"; case 6: AdmRank = "{4B0082}[Server Manager]"; case 7: AdmRank = "{F08080}[Server Co-Owner]"; case 8: AdmRank = "{FF1493}[Sever Owner]"; case 9: AdmRank = "{800000}[Community Co-Owner]"; case 10: AdmRank = "{FF0000}[Community Owner]"; } new nameee[128]; GetPlayerName(i, nameee, 16); if(!strcmp(nameee, "[XP]IzZaN", true)) GetPlayerName(i, nameee, 16); if(!strcmp(nameee, "Admin", true)) GetPlayerName(i, nameee, 16); if(!strcmp(nameee, "[XP]IzZaN", true)) { AdmRank = "{B22222}[Community Owner And Scripter]"; } GetPlayerName(i, nameee, 16); if(!strcmp(nameee, "NONE-NOBODY", true)) { AdmRank = "{FF4500}[Server Owner]"; } if(!strcmp(nameee, "NONE-NOBODY", true)) { AdmRank = "{FF4500}[Co-Owner]"; } GetPlayerName(i, nameee, 16); if(!strcmp(nameee, "[XP]Perfect_Boy", true)) { AdmRank = "{FA8072}[Community Owner]"; } } format(string, 500, ""cred"\nServer Scripter: [XP]IzZaN\n\n Server Owner [XP]Perfect_Boy\n\n\n%s{F81414}%s [ID:%i] | Level: %d - %s\n\n", string, PlayerName2(i), i, PlayerInfo[i][Level], AdmRank); //We are appending the string, so put %s before any new data is added, //and that parameter actually refers to the string itself. count++; } } }