Possible inputtext bug.
#1

Hello everyone! I have been playing around with dialogs lately and I wanted for some reason to find a substring in the inputtext returned by OnDialogResponse. I am using DIALOG_STYLE_TABLIST_HEADERS so the inputtext should be whatever written on the list item.

Now my list item is something like this "int\tstring\tstring\n" and this is my code:
Код:
format(str, sizeof(str), "%d\t%s\t%s\n", ....
It's in a loop and I'm using strcat but I guess that doesn't really matter.
What I am trying to do now is try to find out using strfind if a substring stored in an array I made actually is in that second %s or not.

So I would have something like this:
Код:
new ItemName[MAX_ITEMS][] =
{
	"Something",
	"Something else",
        "Etc..."
};

// somewhere in OnDialogResponse
for(new i; i < MAX_ITEMS; i++)
{
    if(strfind(inputtext, ItemName[i], true) != -1)
    {
	  ShowItemOption(playerid, i);
	  return 1;
    }
}
So even though that should have worked, it didn't. After debugging it turned out that "1\tstring1\tstring2" that (should?) be returned in inputtext is actually just "1" and everything after that \t is missing. So is that a bug, am I doing anything wrong or that's how it's supposed to work?
Reply


Messages In This Thread
Possible inputtext bug. - by mirou123 - 19.07.2015, 06:58
Re: Possible inputtext bug. - by ][Noname][ - 19.07.2015, 07:57
Re: Possible inputtext bug. - by mirou123 - 19.07.2015, 08:04
Re: Possible inputtext bug. - by liquor - 20.07.2015, 07:34

Forum Jump:


Users browsing this thread: 1 Guest(s)