24.05.2016, 15:24
When I Type /admins it shows the names of online admins but i want to show then in a box here is my code for admins command.
When I Type /vips it shows the names of online vips but i want to show then in a box here is my code for vips command.
When I Type /moderators it shows the names of online moderators but i want to show then in a box here is my code for moderators command.
Please Help Me Fixing All There Three Errors.Remember That I Want That When A Person Type These Commands A Box Comes Up.
Code:
CMD:admins(playerid,params[]) { new count = 0, string[256], AdmRank[500]; SendClientMessage(playerid,red,""); SendClientMessage(playerid,COLOR_ORANGE,"»»Online Admins»»"); new ChangeColor; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][Level] > 0) { if(PlayerInfo[i][Level] == 1) { AdmRank = "Junior Admin"; ChangeColor = Color_Trial_Admin; } else if(PlayerInfo[i][Level] == 2) { AdmRank = "Senior Admin"; ChangeColor = Color_Server_Admin; } else if(PlayerInfo[i][Level] == 3) { AdmRank = "Head Admin"; ChangeColor = Color_Senior_Admin; } else if(PlayerInfo[i][Level] == 4) { AdmRank = "Management(Server Team)"; ChangeColor = Color_Lead_Admin; } else if(PlayerInfo[i][Level] == 5) { AdmRank = "Server Owner(Rcon Admin)"; ChangeColor = Color_Global_Admin; } else if(PlayerInfo[i][Level] == 6) { AdmRank = "Community Developer/Scripter"; ChangeColor = Color_Server_Owner; } else if(PlayerInfo[i][Level] >= 7) { AdmRank = "Community Owner"; ChangeColor = Color_RCON_Administrator; } else if(PlayerInfo[i][Level] >= 8) { AdmRank = "Community Owner"; ChangeColor = Color_RCON_Administrator; } new Name[MAX_PLAYER_NAME]; GetPlayerName(i,Name,sizeof(Name)); { format(string, sizeof(string), "Level: %d | Name: %s (ID:%i) | Rank: %s", PlayerInfo[i][Level], Name, i, AdmRank); SendClientMessage(playerid,ChangeColor,string); count++; } } } } if(count == 0) SendClientMessage(playerid,red,"No Admins online!"); SendClientMessage(playerid,COLOR_ORANGE,"________________________"); return 1; }
Code:
CMD:vips(playerid, params[]) { #pragma unused params new count = 0, string[800]; for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { if(PlayerInfo[i][dRank] >= 1) { format(string, 500, "%s %s [ID:%i] | DonorLevel: %d\n", string, PlayerName2(i), i, PlayerInfo[i][dRank]); //We are appending the string, so put %s before any new data is added, //and that parameter actually refers to the string itself. count++; } } } if (count == 0) ShowPlayerDialog(playerid, 800, DIALOG_STYLE_MSGBOX, "{F81414}=Online Donators=", "{00FFEE}No Donators Online\n{00FF00}_____", "Close", ""); else ShowPlayerDialog(playerid, 800, DIALOG_STYLE_MSGBOX, "{F81414}=Online Donators=", string, "Close", ""); return 1; }
Code:
CMD:moderators(playerid, params[]) { new count = 0, string[256]; SendClientMessage(playerid, blue,"Current online moderators:"); for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][Helper] == 1) { format(string, sizeof(string),"Moderator: [%d]%s", i, PlayerName2(i)); SendClientMessage(playerid, blue, string); count++; } } } if(count == 0) { SendClientMessage(playerid, blue,"No moderators are online right now!"); } return 1; }