Loop + Dialog question.
#6

Код:
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");
	        }
		}
Reply


Messages In This Thread
Loop + Dialog question. - by ikbenremco - 24.06.2014, 17:31
Re: Loop + Dialog question. - by Threshold - 25.06.2014, 04:30
Re: Loop + Dialog question. - by Faisal_khan - 25.06.2014, 06:33
Re: Loop + Dialog question. - by ikbenremco - 25.06.2014, 09:10
Re: Loop + Dialog question. - by RenovanZ - 25.06.2014, 09:22
Re: Loop + Dialog question. - by ikbenremco - 25.06.2014, 10:30
Re: Loop + Dialog question. - by ikbenremco - 25.06.2014, 20:22
Re: Loop + Dialog question. - by d3ll - 25.06.2014, 21:15
Re: Loop + Dialog question. - by ikbenremco - 26.06.2014, 07:12

Forum Jump:


Users browsing this thread: 1 Guest(s)