04.07.2014, 21:57
How to integrate these 2 commands to be one command /admins:
Код:
CMD:admins(playerid,params[]) { new bool:First2 = false; new Count, i; new string[1024]; new adminname[MAX_PLAYER_NAME]; for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && pInfo[i][Admin] > 0 && pInfo[i][Hide] == 0) Count++; if(Count == 0) return ShowPlayerDialog(playerid,9000,DIALOG_STYLE_MSGBOX,"SPA - Online Admins:","{FF0000}No Admins Online!","Ok",""); for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && pInfo[i][Admin] > 0 && pInfo[i][Hide] == 0) { if(IsPlayerAdmin(i)) { pARank = "RCON Manager"; } else if (pInfo[i][Admin] > 0) { switch(pInfo[i][Admin]) { case 1: pARank = "Level 1 - Helper"; case 2: pARank = "Level 2 - Mod"; case 3: pARank = "Level 3 - Admin "; case 4: pARank = "Level 4 - Admin"; case 5: pARank = "Level 5 - Leader"; case 6: pARank = "Level 6 - Head Administrator"; } } GetPlayerName(i, adminname, sizeof(adminname)); if(!First2) { format(string, sizeof(string), "{00FF00}SPA - Online Admins:\n{F11100}%s (ID %d)\t{FFFFFF}[%s]", pName(i),i,pARank); First2 = true; } else format(string,sizeof(string),"%s\n{F11100}%s (ID %d)\t{FFFFFF}[%s]",string,pName(i),i,pARank); } return ShowPlayerDialog(playerid,9000,DIALOG_STYLE_MSGBOX,"SPA - Online Admins:",string,"Ok",""); }
Код:
CMD:vips(playerid,params[]) { new bool:First2 = false; new Count, i; new string[1024]; new adminname[MAX_PLAYER_NAME]; for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && pInfo[i][Vip] > 0) Count++; if(Count == 0) return ShowPlayerDialog(playerid,9000,DIALOG_STYLE_MSGBOX,"Vips Online","{FF0000}No VIPS Online, Try to donate your self.","Ok","Back"); for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && pInfo[i][Vip] > 0) { switch(pInfo[i][Vip]) { case 1: pVRank = "FREE"; case 2: pVRank = "Donator"; case 3: pVRank = "Silver"; case 4: pVRank = "Gold"; case 5: pVRank = "CO-Gold"; case 6: pVRank = "Head Donator"; } GetPlayerName(i, adminname, sizeof(adminname)); if(!First2) { format(string, sizeof(string), "{FFFF00}|_________________VIPS Online_________________|{FFFFFF}\n{FFFF00}%s (ID %d)\t{FFFFFF}[%s]", pName(i),i,pVRank); First2 = true; } else format(string,sizeof(string),"%s\n{F11100}%s (ID %d)\t{FFFFFF}[%s]",string,pName(i),i,pVRank); } return ShowPlayerDialog(playerid,9001,DIALOG_STYLE_MSGBOX,"Vips Online",string,"Ok","Back"); }