sscanf warning. - 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 warning. (
/showthread.php?tid=562162)
sscanf warning. -
LeXuZ - 07.02.2015
I have made a chat system, it all works but in server logs it shows a warning with sscanf but I have not used any of the symbols in the warning:
Quote:
[12:13:30] sscanf warning: sscanf specifiers do not require '' before them.
|
Rep given to problem solver.
pawn Код:
CMD:g(playerid, params[])
{
new str[150], text[128];
if(sscanf(params, "%s[128]", text)) return SCM(playerid, -1, "Usage: /g <text>");
format(str, sizeof(str), "["GREEN"Global"WHITE"] "GREY"%s "WHITE"("GREY"%i"WHITE"): %s", GetName(playerid), playerid, text);
SendClientMessageToAll(COLOR_WHITE, str);
return 1;
}
Re: sscanf warning. -
HazardouS - 07.02.2015
pawn Код:
if(sscanf(params, "%s[128]", text)) return SCM(playerid, -1, "Usage: /g <text>");
You placed an additional '%'. This is how you do it right:
pawn Код:
if(sscanf(params, "s[128]", text)) return SCM(playerid, -1, "Usage: /g <text>");
Re: sscanf warning. -
LeXuZ - 07.02.2015
Thanks, it worked, +rep