SSCANF unknown format - 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 unknown format (
/showthread.php?tid=610278)
[FIXED] SSCANF unknown format -
MotherDucker - 22.06.2016
Hello all,
I'm trying to make a command which takes parameters, and I am using sscanf to process the parameters, however, the reason needs to be 256 characters long. I have used the correct formatting to specify this but it just returns as an unknown format warning.
Код:
if(sscanf(params, "iS["#STR_SIZE"]", kickid, reason)) return SCM(playerid, GREY, "[Usage]: /kick [playerid] [reason]");
Код:
sscanf warning: No default value found.
sscanf warning: Unknown format specifier '[', skipping.
sscanf warning: Unknown format specifier '2', skipping.
sscanf warning: Unknown format specifier '5', skipping.
sscanf warning: Unknown format specifier '6', skipping.
sscanf warning: Unknown format specifier ']', skipping.
sscanf warning: Format specifier does not match parameter count.
The command does work in game, however, it just displays a bunch of warnings within the console, I do not understand what is wrong with this; so could anyway give me some pointers if they can please.
Re: SSCANF unknown format -
oMa37 - 22.06.2016
This should work:
PHP код:
if(sscanf(params, "iS()["#STR_SIZE"]", kickid, reason)) return SCM(playerid, GREY, "[Usage]: /kick [playerid] [reason]");
Re: SSCANF unknown format -
MotherDucker - 22.06.2016
Quote:
Originally Posted by oMa37
This should work:
PHP код:
if(sscanf(params, "iS()["#STR_SIZE"]", kickid, reason)) return SCM(playerid, GREY, "[Usage]: /kick [playerid] [reason]");
|
Yes it did, thank you.
Rep++