Getting string from inputtext
#2

Extracting data from inputtext of a list-type dialog is not safe. Players can modify the inputtext you get as response. It's not recommended unless you plan on saving the content shown in dialog first and then comparing it with the corresponding list's data. Anyway, sticking to what you've asked for - you can use sscanf with it's quiet-mode to extract the name only.
pawn Code:
new tmpName[MAX_PLAYER_NAME + 1];
inputtext[1] = ' '; //Assuming your inputtext will be from each line only. Replacing '.' to ' ' (space) to make it use for current version of sscanf.
sscanf(inputtext, "?<SSCANF_QUIET=1>{d}s[25]'\t'{s}", tmpName);
//tmpName now holds the name.
Reply


Messages In This Thread
Getting string from inputtext - by rOps - 02.02.2017, 08:10
Re: Getting string from inputtext - by Lordzy - 02.02.2017, 08:31
Re: Getting string from inputtext - by rOps - 02.02.2017, 08:44

Forum Jump:


Users browsing this thread: 1 Guest(s)