sscanf! Help me please
#1

I got this format

format(str, sizeof(str), "#%d (%02d/%02d/%04d - %02d:%02d:%02d) %s - %s", num, day, month, year, hour, minute, second, PlayerNameEx(playerid), string);

And i need to make the #%d invisible, So it will return only the string after the number.

I've tried this format

sscanf(string, "{p<#>d}s[255]", str1);

But its doesn't work... i'll be glad if someone will help me to solve this problem :/

Have a nice day people
Reply
#2

the p<#> delimeter stays intact, even if its {quiet} i guess, so it disturbs the parsing lateron,
i suggest you to use the ' ' finding method, it seeks for the # just 1 time...
Код:
sscanf(string, "'#'{d}s[255]", str1);
is the ( and ) bracket really required before/after the string[255]? coz you could run into a problem when you try to parse 2 strings, you never know where string1 ends, and/or string 2 starts, unless you use a forbidden character as delimeter.
Reply
#3

Yes its require 255 Because the format size.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)