Shit ton of sscanf warning
#1

whenever i start my server i get this

sscanf warning: Format specifier does not match
sscanf warning: Format specifier does not match
sscanf warning: Format specifier does not match
sscanf warning: Format specifier does not match
sscanf warning: Format specifier does not match
sscanf warning: Format specifier does not match
sscanf warning: Format specifier does not match

about 1000 times but server stills loads how to remove that annoying message?
Reply
#2

Do you get any errors while compiling?
Reply
#3

I'm pretty sure it's referring to this kind of line:
pawn Код:
if(sscanf(params, "u", id)) return..
etc.

I'm not sure, but just post a couple of those lines, or wherever you use sscanf in some major callbacks.
Reply
#4

CMD:approvename(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_GREY, "You're not authorised to use this command.");

new
iTarget,
szQuery[128];

if(sscanf(params, "u", iTarget))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /approvename [playerid/partOfName]");

if(iTarget == INVALID_PLAYER_ID)
return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");

if(GetPVarInt(iTarget, "RequestingNameChange") == 0)
return SendClientMessage(playerid, COLOR_GREY, "The specified player isn't requesting a name change.");

new
szPlayerName[MAX_PLAYER_NAME];

GetPVarString(iTarget, "NewNameRequest", szPlayerName, MAX_PLAYER_NAME);
SetPVarInt(iTarget, "requestby", playerid);

mysql_real_escape_string(szPlayerName, szPlayerName, g_MySQLConnections[0]);

SetPVarString(iTarget, "requestedname", szPlayerName);

format(szQuery, sizeof(szQuery), "SELECT Username FROM players WHERE Username = '%s'", szPlayerName);
mysql_query(szQuery, THREAD_CHECK_NEW_NAME, iTarget, g_MySQLConnections[0]);
return 1;
}
Reply
#5

press ctrl+h (search), and type in the string "sscan(" and compare the amount of specifiers like %d %s[32] %i etc in the parentheses, they arent matching the parameter count. here its only 1 parameter, 1 specifier:;
pawn Код:
new type;
    if(!sscanf(params,"d",type))
so your example could either look like
pawn Код:
new type;
    if(!sscanf(params,"dd",type))
or
pawn Код:
new type;
    if(!sscanf(params,"d",type,irrelevant))
... so maybe most of your command will not work properly / miss a parameter / set some parameters to 0 or "" (empty string) cause they arent getting filled with data.

erm.. to be ignored: maybe i missed something, like asking if you have updated the plugin/include/compiled your scripts with them.. but i wont bother to do that, since theres nothing indicating so ^^

edit: weird. 4 posts already - your code looks correct so far...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)