SA-MP Forums Archive
sscanf! Help me please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: sscanf! Help me please (/showthread.php?tid=291913)



sscanf! Help me please - roleplay501 - 22.10.2011

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


Re: sscanf! Help me please - Babul - 22.10.2011

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.


Re: sscanf! Help me please - roleplay501 - 22.10.2011

Yes its require 255 Because the format size.