23.08.2014, 11:26
When Made this /admins Commands in dialog box from luxadmin... If i type /admins and the admins are online then server unkown command message comes but when there are no admins then nothing comes... So i want to know that what is wrong in this code..?
Код:
CMD:admins(playerid,params[]) { #pragma unused params new count = 0; new string[128]; new ChangeColor; for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { if(AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0) { if(AccInfo[i][Level] > 5) { AdmRank = "Management"; ChangeColor = Color_Professional_Admin; } if(IsPlayerAdmin(i)) { AdmRank = "RCON Administrator"; ChangeColor = Color_RCON_Administrator; } else { switch(AccInfo[i][Level]) { case 1: { AdmRank = "Basic Moderator"; ChangeColor = Color_Basic_Moderator; } case 2: { AdmRank = "Moderator"; ChangeColor = Color_Moderator; } case 3: { AdmRank = "Master Moderator"; ChangeColor = Color_Master_Moderator; } case 4: { AdmRank = "Head Moderator"; ChangeColor = Color_Administrator; } case 5: { AdmRank = "Junior Administrator"; ChangeColor = Color_Master_Administrator; } case 6: { AdmRank = "Administrator"; ChangeColor = Color_Master_Administrator; } case 7: { AdmRank = "Master Administrator"; ChangeColor = Color_Master_Administrator; } case 8: { AdmRank = "Head Administrator"; ChangeColor = Color_Master_Administrator; } case 9: { AdmRank = "Beta Tester"; ChangeColor = Color_Master_Administrator; } case 10: { AdmRank = "Management"; ChangeColor = Color_Master_Administrator; } } } switch(AccInfo[i][OnDuty]) { case 0: AdmDuty = "Playing!"; case 1: AdmDuty = "On Duty!"; } format(string, 128, "Level: %d - %s [Id:%i] | %s | %s \n\n\nRemember Admins Are Also Watching You From \nServer IRC #Gz[0.3c]\n\n",AccInfo[i][Level], PlayerName2(i),i,AdmRank,AdmDuty); ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Online Admins",string, "Back"); count++; } } } if (count == 0) ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Online Admins","No Admins Online But Admins Can Also Be Hidden\n\n\nRemember Admins Are Also Watching You From \nServer IRC #Gz[0.3c]\n\n", "Back"); return 1; }