Loop and dialogs
#1

I can't figure out what I have to change to make this code do the right thing, so what it's supposed to do is to list down the male names under "Male Names" and female names under "Female Names" the picture below code is result, for some reason there's something messy :/ - It shows double male names and there's a huge blank spot at female names, but under those everything is fine? (see picture) sooo how can I fix that?

Код:
showNameSuggestions(playerid)  {
	new msg[128];
	new female[128];
	new male[128];
	dialogstr[0] = 0;
	strcat(dialogstr,"Male Names\tFemale Names\n",sizeof(dialogstr));
	for(new i=0;i<sizeof(NameSuggestions); i++) {
		if(NameSuggestions[i][ENameSugID] == 1) {
			format(male,sizeof(male), "%s",NameSuggestions[i][ENameSug]);
		} else if(NameSuggestions[i][ENameSugID] == 2) {
			format(female,sizeof(female), "%s",NameSuggestions[i][ENameSug]);
		}
		format(msg,sizeof(msg), "%s\t%s\n",male,female);
		strcat(dialogstr,msg,sizeof(dialogstr));
	}
	ShowPlayerDialog(playerid, DIALOG_NAME, DIALOG_STYLE_TABLIST_HEADERS, "Suggested Names", dialogstr, "Choose!","Quit");
}
In case you need this part of code:
Код:
new NameSuggestions[][ENameSuggestions] = {
	{"MaleNameEX",1},
	{"MaleNameEX",1},
	{"MaleNameEX",1},
	{"MaleNameEX",1},
	{"MaleNameEX",1},
	{"MaleNameEX",1},
	{"MaleNameEX",1},
	{"FemaleNameEX",2},
	{"FemaleNameEX",2},
	{"FemaleNameEX",2},
	{"FemaleNameEX",2},
	{"FemaleNameEX",2},
	{"FemaleNameEX",2},
	{"FemaleNameEX",2}
};
This is the result:
Reply


Messages In This Thread
Loop and dialogs - by Lajko1 - 18.04.2017, 13:35
Re: Loop and dialogs - by RIDE2DAY - 18.04.2017, 17:38

Forum Jump:


Users browsing this thread: 1 Guest(s)