sscanf warning
#1

Hello,

I get this in my console :

Код:
[20:19:05] sscanf warning: No default value found.
[20:19:05] sscanf warning: Unknown format specifier '[', skipping.
[20:19:05] sscanf warning: Unknown format specifier '6', skipping.
[20:19:05] sscanf warning: Unknown format specifier '4', skipping.
[20:19:05] sscanf warning: Unknown format specifier ']', skipping.
[20:19:05] sscanf warning: Format specifier does not match parameter count.
This happens when i do my /ban command, the command works fine but i want to fix the warnings too!

Command :

pawn Код:
CMD:ban(playerid, params[])
{
    new ReAson[64];
    if(PlayerInfo[playerid][pAdmin] < 5)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to be Level 5 to use this command!");
    else if(sscanf(params, "dS[64]", bID, ReAson))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Usage: /ban <playerid> <reason>");
    else if(bID == playerid)
        return SendClientMessage(playerid, COLOR_LIGHTRED, "You can't ban yourself!");
    else if(!IsPlayerConnected(bID))
        return SendClientMessage(playerid, COLOR_LIGHTRED, "Player not found!");
    else
    {
        new pName[24];
        new str[128];
        GetPlayerName(playerid, pName, 24);
        format(str, 128, "Adminstrator %s banned you! (Reason : %s)", pName, ReAson);
        SendClientMessage(bID, COLOR_ORANGE, str);
        new pNaMe[24];
        new rName[24];
        new sTr[128];
        GetPlayerName(playerid, pNaMe, 24);
        GetPlayerName(bID, rName, 24);
        format(sTr, 128, "Adminstrator %s banned %s! (Reason : %s)", pNaMe, rName, ReAson[0] ? ReAson : "No Reason Given");
        SendClientMessageToAll(COLOR_ORANGE, sTr);
        SetTimerEx("BanPlayer", 100, false, "i", playerid);
    }
    return 1;
}
BanPlayer Timer :

pawn Код:
forward BanPlayer(playerid);
public BanPlayer(playerid)
{
    Ban(bID);
    return 1;
}
Please help!
Reply
#2

i saw ****** said once becuase you type capital latters try s small latter not S
Reply
#3

If i type s it is fixed but,

i want the reason to be optional and when i use z

it gives me this :

Код:
sscanf warning: 'z' is deprecated, consider using 'S' instead.
Reply
#4

If you want it optional you can use

S(No reason given)[size]
Reply
#5

Gives me the same warnings in the first post.

EDIT : i fixed it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)