SSCANF unknown format
#1

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.
Reply
#2

This should work:
PHP код:
if(sscanf(params"iS()["#STR_SIZE"]", kickid, reason)) return SCM(playerid, GREY, "[Usage]: /kick [playerid] [reason]"); 
Reply
#3

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++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)