new Ranks[MAX_FACTIONS][MAX_RANKS] ={ {\"Gyakornok\",\"Orvos\",\"Sebész\"....}, {\"Kadét\",\"Õrmester\"....}}
if(playerInfo[playerid][LeaderWork] == 1){ if(playerInfo[playerid][LeaderRang] == 1) { rank = \"Gyakornok\"; } else if(playerInfo[playerid][LeaderRang] == 2) { rank = \"Orvos\"; }}
#define MAX_RANKS (7)#define MAX_FACTIONS (5)#define DIALOG_LEADER (1357)#define DIALOG_PLAYER (1358)#define DIALOG_RANK (1359)#define PD_OUT_OF_FACTIONS (0)#define PD_IN_THE_FACTION (1)#define COLOR_RED 0xFFAAAAFFnew Ranks[MAX_FACTIONS][MAX_RANKS][16] = // Rangok{{\"Rang1\",\"Rang2\",\"Rang3\",\"Rang4\",\"Rang5\",\"Rang6\",\"Rang7\"}, // Mentõk{\"Rang1\",\"Rang2\",\"Rang3\",\"Rang4\",\"Rang5\",\"Rang6\",\"Rang7\"},{\"Rang1\",\"Rang2\",\"Rang3\",\"Rang4\",\"Rang5\",\"Rang6\",\"Rang7\"},{\"Rang1\",\"Rang2\",\"Rang3\",\"Rang4\",\"Rang5\",\"Rang6\",\"Rang7\"},{\"Rang1\",\"Rang2\",\"Rang3\",\"Rang4\",\"Rang5\",\"Rang6\",\"Rang7\"}};new DFunc[MAX_PLAYERS] = -1; // Dialog Funckciónew DID[MAX_PLAYERS][50]; // 50 list item azonosítópublic OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){switch(dialogid){case DIALOG_LEADER:{ if(!response) { return 1; } DFunc[playerid] = listitem; if(listitem == 0) { PlayerDialog(playerid,PD_OUT_OF_FACTIONS); } else if(dialogid == 1 || dialogid == 2) { PlayerDialog(playerid,PD_IN_THE_FACTION); } return 1;}case DIALOG_PLAYER:{ if(!response) { return 1; } if(DFunc[playerid] == 0) // inv { // inv funkció // // pl: PlayerInvPlayer(playerid,DID[listitem]); } else if(DFunc[playerid] == 1) // rang { ShowPlayerRanks(DID[playerid][listitem],playerid); // ki rangját, kinek } else if(DFunc[playerid] == 2) // kick { // kick funkció // // pl: PlayerKickPlayer(playerid,DID[playerid][listitem]); } DFunc[playerid] = -1; return 1;}case DIALOG_RANK:{ playerInfo[DFunc[playerid]][LeaderRang] = listitem; // szövegek DFunc[playerid] = -1; return 1;}}return 0;}public OnPlayerCommandText(playerid,cmdtext[]){if(!strcmp(cmdtext,\"/leader\",true)){ if(playerInfo[playerid][LeaderRang] < 7) { SendClientMessage(playerid,COLOR_RED,\"Nem vagy leader !\"); return 1; }ShowPlayerDialog(playerid,DIALOG_LEADER,DIALOG_STYLE_LIST,\"Leader funkciók:\",\"Tagfelvétel\\nElõléptetés\\nKirúgás\",\"Ok\",\"Mégse\");}return 0;}forward PlayerDialog(playerid,type);public PlayerDialog(playerid,type){ new s,str[512],name[MAX_PLAYER_NAME]; // str cella száma max Slot*MAX_PLAYER_NAME legyen ha mondjuk 50 slotos a szerver akkor 50*24=1200switch(type){ case PD_OUT_OF_FACTIONS: { for(new i; i < GetMaxPlayers(); i++) { // ha azt szeretnéd hogy a játékos magát ne lássa akkor ezt is írd be: || playerid == i if(!IsPlayerConnected(i) || playerInfo[LeaderWork] < 0) { continue; } DID[playerid] = i; GetPlayerName(i,name,MAX_PLAYER_NAME); if(!s) { format(str,sizeof(str),\"%s\",name); } else { format(str,sizeof(str),\"%s\\n%s\",str,name); } s++; } } case PD_IN_THE_FACTION: { for(new i; i < GetMaxPlayers(); i++) { // ha azt szeretnéd hogy a játékos magát ne lássa akkor ezt is írd be: || playerid == i if(!IsPlayerConnected(i) || playerInfo[playerid][LeaderWork] != playerInfo[LeaderWork]) { continue; } DID[playerid] = i; GetPlayerName(i,name,MAX_PLAYER_NAME); if(!s) { format(str,sizeof(str),\"%s\",name); } else { format(str,sizeof(str),\"%s\\n%s\",str,name); } s++; } } default: { SendClientMessage(playerid,COLOR_RED,\"Hibás játékos listázás !\"); return 1; }}ShowPlayerDialog(playerid,DIALOG_PLAYER,DIALOG_STYLE_LIST,\"Játékosok:\",str,\"Ok\",\"Mégse\");return 1;}forward ShowPlayerRanks(playerid,forplayerid);public ShowPlayerRanks(playerid,forplayerid){ if(playerInfo[forplayerid][LeaderRang] < 7) { SendClientMessage(forplayerid,COLOR_RED,\"Nem vagy leader !\"); return 1; }else if(playerInfo[playerid][LeaderWork] == 0) { SendClientMessage(forplayerid,COLOR_RED,\"Ez a játékos nincs frakcióban !\"); return 1; }else if(playerInfo[playerid][LeaderWork] != playerInfo[forplayerid][LeaderWork]) { SendClientMessage(forplayerid,COLOR_RED,\"Ez a játékos nincs frakciódban !\"); return 1; }//new rstr[32],rsstr[128];DFunc[forplayerid] = playerid;GetPlayerName(playerid,rstr,MAX_PLAYER_NAME); strins(rstr,\" rangja:\",strlen(rstr),32);for(new i; i < MAX_RANKS; i++){ if(!i) { format(rsstr,64,\"%d. %s\",i,Ranks[playerInfo[forplayerid][LeaderWork]-1]); } else { format(rsstr,64,\"%s\\n%d. %s\",rsstr,i,Ranks[playerInfo[forplayerid][LeaderWork]-1]); }}//ShowPlayerDialog(forplayerid,DIALOG_RANK,DIALOG_STYLE_LIST,rstr,rsstr,\"Ok\",\"Mégse\");return 1;}
forward ShowPlayerRanks(playerid,forplayerid);public ShowPlayerRanks(playerid,forplayerid){ if(playerInfo[forplayerid][LeaderRang] < 7) { SendClientMessage(forplayerid,COLOR_RED,\"Nem vagy leader !\"); return 1; }else if(playerInfo[playerid][LeaderWork] == 0) { SendClientMessage(forplayerid,COLOR_RED,\"Ez a játékos nincs frakcióban !\"); return 1; }else if(playerInfo[playerid][LeaderWork] != playerInfo[forplayerid][LeaderWork]) { SendClientMessage(forplayerid,COLOR_RED,\"Ez a játékos nincs frakciódban !\"); return 1; }//new rstr[32],rsstr[128];DFunc[forplayerid] = playerid;GetPlayerName(playerid,rstr,MAX_PLAYER_NAME); strins(rstr,\" rangja:\",strlen(rstr),32);for(new i; i < MAX_RANKS; i++){ if(!i) { format(rsstr,64,\"%d. %s\",i,Ranks[playerInfo[forplayerid][LeaderWork]-1]); } else { format(rsstr,64,\"%s\\n%d. %s\",rsstr,i,Ranks[playerInfo[forplayerid][LeaderWork]-1]); }}//ShowPlayerDialog(forplayerid,DIALOG_RANK,DIALOG_STYLE_LIST,rstr,rsstr,\"Ok\",\"Mégse\");return 1;}
#define MAX_RANKS (7)#define MAX_FACTIONS (5)#define DIALOG_LEADER (1357)#define DIALOG_PLAYER (1358)#define DIALOG_RANK (1359)#define PD_OUT_OF_FACTIONS (0)#define PD_IN_THE_FACTION (1)#define COLOR_RED 0xFFAAAAFFnew Ranks[MAX_FACTIONS][MAX_RANKS][16] = // Rangok{{\"Rang1\",\"Rang2\",\"Rang3\",\"Rang4\",\"Rang5\",\"Rang6\",\"Rang7\"}, // Mentõk{\"Rang1\",\"Rang2\",\"Rang3\",\"Rang4\",\"Rang5\",\"Rang6\",\"Rang7\"},{\"Rang1\",\"Rang2\",\"Rang3\",\"Rang4\",\"Rang5\",\"Rang6\",\"Rang7\"},{\"Rang1\",\"Rang2\",\"Rang3\",\"Rang4\",\"Rang5\",\"Rang6\",\"Rang7\"},{\"Rang1\",\"Rang2\",\"Rang3\",\"Rang4\",\"Rang5\",\"Rang6\",\"Rang7\"}};new DFunc[MAX_PLAYERS] = -1; // Dialog Funckciónew DID[MAX_PLAYERS][50]; // 50 list item azonosítópublic OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){switch(dialogid){case DIALOG_LEADER:{ if(!response) { return 1; } DFunc[playerid] = listitem; if(listitem == 0) { PlayerDialog(playerid,PD_OUT_OF_FACTIONS); } else if(listitem == 1 || listitem == 2) { PlayerDialog(playerid,PD_IN_THE_FACTION); } return 1;}case DIALOG_PLAYER:{ if(!response) { return 1; } if(DFunc[playerid] == 0) // inv { // inv funkció // // pl: PlayerInvPlayer(playerid,DID[listitem]); } else if(DFunc[playerid] == 1) // rang { ShowPlayerRanks(DID[playerid][listitem],playerid); // ki rangját, kinek return 1; } else if(DFunc[playerid] == 2) // kick { // kick funkció // // pl: PlayerKickPlayer(playerid,DID[playerid][listitem]); } DFunc[playerid] = -1; return 1;}case DIALOG_RANK:{ playerInfo[DFunc[playerid]][LeaderRang] = listitem; // szövegek DFunc[playerid] = -1; return 1;}}return 0;}public OnPlayerCommandText(playerid,cmdtext[]){if(!strcmp(cmdtext,\"/leader\",true)){ if(playerInfo[playerid][LeaderRang] < 6) { SendClientMessage(playerid,COLOR_RED,\"Nem vagy leader !\"); return 1; }ShowPlayerDialog(playerid,DIALOG_LEADER,DIALOG_STYLE_LIST,\"Leader funkciók:\",\"Tagfelvétel\\nElõléptetés\\nKirúgás\",\"Ok\",\"Mégse\");}return 0;}forward PlayerDialog(playerid,type);public PlayerDialog(playerid,type){ new s,str[512],name[MAX_PLAYER_NAME]; // str cella száma max Slot*MAX_PLAYER_NAME legyen ha mondjuk 50 slotos a szerver akkor 50*24=1200switch(type){ case PD_OUT_OF_FACTIONS: { for(new i; i < GetMaxPlayers(); i++) { // ha azt szeretnéd hogy a játékos magát ne lássa akkor ezt is írd be: || playerid == i if(!IsPlayerConnected(i) || playerInfo[LeaderWork] > 0) { continue; } DID[playerid] = i; GetPlayerName(i,name,MAX_PLAYER_NAME); if(!s) { format(str,sizeof(str),\"%s\",name); } else { format(str,sizeof(str),\"%s\\n%s\",str,name); } s++; } } case PD_IN_THE_FACTION: { for(new i; i < GetMaxPlayers(); i++) { // ha azt szeretnéd hogy a játékos magát ne lássa akkor ezt is írd be: || playerid == i if(!IsPlayerConnected(i) || playerInfo[playerid][LeaderWork] != playerInfo[LeaderWork]) { continue; } DID[playerid] = i; GetPlayerName(i,name,MAX_PLAYER_NAME); if(!s) { format(str,sizeof(str),\"%s\",name); } else { format(str,sizeof(str),\"%s\\n%s\",str,name); } s++; } } default: { SendClientMessage(playerid,COLOR_RED,\"Hibás játékos listázás !\"); return 1; }}ShowPlayerDialog(playerid,DIALOG_PLAYER,DIALOG_STYLE_LIST,\"Játékosok:\",str,\"Ok\",\"Mégse\");return 1;}forward ShowPlayerRanks(playerid,forplayerid);public ShowPlayerRanks(playerid,forplayerid){ if(playerInfo[forplayerid][LeaderRang] < 6) { SendClientMessage(forplayerid,COLOR_RED,\"Nem vagy leader !\"); return 1; }else if(playerInfo[playerid][LeaderWork] == 0) { SendClientMessage(forplayerid,COLOR_RED,\"Ez a játékos nincs frakcióban !\"); return 1; }else if(playerInfo[playerid][LeaderWork] != playerInfo[forplayerid][LeaderWork]) { SendClientMessage(forplayerid,COLOR_RED,\"Ez a játékos nincs frakciódban !\"); return 1; }//new rstr[32],rsstr[128];DFunc[forplayerid] = playerid;GetPlayerName(playerid,rstr,MAX_PLAYER_NAME); strins(rstr,\" rangja:\",strlen(rstr),32);for(new i; i < MAX_RANKS; i++){ if(!i) { format(rsstr,64,\"%d. %s\",i,Ranks[playerInfo[forplayerid][LeaderWork]-1]); } else { format(rsstr,64,\"%s\\n%d. %s\",rsstr,i,Ranks[playerInfo[forplayerid][LeaderWork]-1]); }}//ShowPlayerDialog(forplayerid,DIALOG_RANK,DIALOG_STYLE_LIST,rstr,rsstr,\"Ok\",\"Mégse\");return 1;}