18.04.2017, 13:35
(
Последний раз редактировалось Lajko1; 18.04.2017 в 15:31.
)
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?
In case you need this part of code:
This is the result:
Код:
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"); }
Код:
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} };