Loop and dialogs
#2

Watch out, while it loops through the first seven names female is an empty string. On the other hand, when it arrives to the 8th row, name contains "MaleNameEX". Say thank you to this for the result you got:
PHP код:
format(msgsizeof(msg), "%s\t%s\n"malefemale);
strcat(dialogstrmsgsizeof(dialogstr)); 
Give a try to this:
PHP код:
new names[3][2][24] = { // 3 rows, 2 names per row, 24 is the max. length a name can have
    
{"male1""female1"},
    {
"male2""female2"},
    {
"male3""female3"},
    {
"male4"""// you can skip a name, don't skip a male name 'cause you'll get wrong format in the dialog.
};
/* showNameSuggestions */
dialogstr[0] = EOS;
strcat(dialogstr"Male Names\tFemale Names"sizeof(dialogstr));
for(new 
0sizeof(names); x++)
{
    
format(dialogstr"%s\n%s\t%s"dialogstrnames[x][0], names[x][1]);
}
ShowPlayerDialog(playerididstyle"title"dialogstr"ok","bye"); 
Good luck with it.
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)