25.06.2014, 10:30
Код:
CMD:editfaction(playerid, params[]) // Edits the faction through a dialog { if(CharacterData[playerid][pAdmin] >= 5) { new totalfac = 0, largestring[504]; for(new i = 1; i < MAX_FACTIONS; i++) { if(FactionData[i][fac_Taken] == 1) { format(largestring, sizeof(largestring), "%s ID %d) %s\n", largestring, i, FactionData[i][fac_Name]); totalfac ++; } } if(totalfac == 0) return ErrorMessage(playerid, "No factions have been created yet"); ShowPlayerDialog(playerid, DIALOG_EDITFACTION_ID, DIALOG_STYLE_LIST, "Select the faction which you would like to edit", largestring, "Select", "Cancel"); } else { return ErrorMessage(playerid, "You are not authorized to use that command!"); } return 1; }
Код:
case DIALOG_EDITFACTION_ID: { new title[64], availablefacs[MAX_FACTIONS+1], factionID; if(!response) return 1; if(response) { for(new i = 1; i < MAX_FACTIONS; i++) { if(FactionData[i][fac_Taken] == 1) { availablefacs[i] = i; } } for(new i = 1; i < MAX_FACTIONS; i++) { if(FactionData[i][fac_Taken] == 1) { i = factionID; } } for(new i = AtFaction[playerid]; i < sizeof(availablefacs[i]); i++) { } format(title, sizeof(title), "Editting faction: %s(ID: %d)", FactionData[factionID][fac_Name], factionID); ShowPlayerDialog(playerid, DIALOG_EDITFACTION, DIALOG_STYLE_LIST, title, "Change Name\nChange Rank Names\nFaction Type\nFaction Color\nDelete Faction", "Select", "Cancel"); } }