sscanf warning
#1

pawn Код:
[22:38:04] sscanf warning: No default value found.
[22:38:04] sscanf warning: Unknown format specifier '[', skipping.
[22:38:04] sscanf warning: Unknown format specifier '2', skipping.
[22:38:04] sscanf warning: Unknown format specifier '0', skipping.
[22:38:04] sscanf warning: Unknown format specifier ']', skipping.
[22:38:04] sscanf warning: Format specifier does not match parameter count.
[22:38:07] sscanf warning: No default value found.
[22:38:16] sscanf warning: No default value found.
pawn Код:
CMD:clan(playerid, params[])
{
    new sub[3][20];
    if(sscanf(params, "s[20]S[20]", sub[0], sub[1])) return Message2(playerid, Red, "/Clan [Create/Remove/Invite/Join/Leave/Kick/Skin/DSkin/Mute/UnMute/"white"Help"red"]");
    if(!strcmp(sub[0], "create", true))
    {
        new newclan[48];
        if(DOF2_GetInt(PFile(playerid), "HaveClan") == 1) return Message(playerid, Red, "[Clan Message]: [%s] .יש לך כבר קלאן קיים", GetPlayerClan(playerid));
        if(AC_GetMoney(playerid) < ClanPrice) return Message(playerid, Red, "[Clan Message]: [%s$] .אין לך מספיק כסף בכדי ליצור קלאן", GetNum(ClanPrice));
        if(sscanf(sub[1], "s[40]", ClanName)) return Message2(playerid, Red, "[Clan Message]: /ClanCreate [Clan Name]");
        format(newclan, 48, "Clans/%s.ini", ClanName);
        if(DOF2_FileExists(newclan)) return Message(playerid, Red, "[Clan Message]: .\"%s\" קיים קלאן בשם", ClanName);
        DOF2_CreateFile(newclan);
        DOF2_SetString(newclan, "Founder", GetName(playerid));
        DOF2_SetInt(newclan, "Players", 1);
        DOF2_SetString(newclan, "Date", GetDateEx());
        DOF2_SetString(newclan, "Time", GetTimeEx());
        DOF2_SetInt(newclan, "Bank", 0);
        DOF2_SetInt(newclan, "Chat", 0);
        DOF2_SetInt(PFile(playerid), "HaveClan", 1);
        DOF2_SetString(PFile(playerid), "Clan", ClanName);
        DOF2_SetInt(PFile(playerid), "ClanLevel", 6);
        DOF2_SetString(PFile(playerid), "ClanTag", "Founder");
        DOF2_SaveFile();
        AC_GiveMoney(playerid, -ClanPrice);
        Message(playerid, Pink, "[Clan Message]: /ClanHelp לעזרה במערכת הקש .\"%s\" מזל טוב ! יצרת קלאן חדש בשם", ClanName);
        return true;
    }
    else if(!strcmp(sub[0], "skin", true))
    {
        if(sscanf(sub[1],"i",id)) return Message2(playerid,Red,"/Clan Skin [id]");
        SetPlayerSkin(playerid, id);
        return true;
    }
    else if(!strcmp(sub[0], "setlevel", true))
    {
        new level;
        if(sscanf(sub[1], "ud", id, level)) return Message2(playerid, Red, "/Clan SetLevel [id] [level]");
        SetPlayerSkin(id, level);
        return true;
    }
    return Message2(playerid, Red, "/Clan [Create/Remove/Invite/Join/Leave/Kick/Skin/DSkin/Mute/UnMute/"white"Help"red"]");
}
Reply
#2

What version of sscanf are you using?
Reply
#3

Quote:
Originally Posted by -Luis
Посмотреть сообщение
What version of sscanf are you using?
2.8.1
Quote:
Originally Posted by ******
Посмотреть сообщение
All the errors are detailed in the sscanf topic.
I do not understand what you mean noted:
Quote:

You have no default value on an optional specifier:
pawn Код:
I
Instead of:
pawn Код:
I (42)
Reply
#4

Код:
if(sscanf(params, "s[20]S[20]", sub[0], sub[1]))
Use
Код:
if(sscanf(params, "s[20]s[20]", sub[0], sub[1]))
Reply
#5

Quote:
Originally Posted by SDraw
Посмотреть сообщение
Код:
if(sscanf(params, "s[20]S[20]", sub[0], sub[1]))
Use
Код:
if(sscanf(params, "s[20]s[20]", sub[0], sub[1]))
http://forum.sa-mp.com/showpost.php?...00&postcount=9
http://forum.sa-mp.com/showpost.php?...8&postcount=10
Reply
#6

If you use "S", you must set default text (plugin description). How I see you don't set deafult and plugin says about it...
Reply
#7

Quote:
Originally Posted by SDraw
Посмотреть сообщение
If you use "S", you must set default text (plugin description). How I see you don't set deafult and plugin says about it...
If I do "s" so it always sends me this message:
"/ Clan [Create / Remove / Invite / Join / Leave / Kick / Skin / DSkin / Mute / UnMute /" white "Help" red "]"
Reply
#8

Help me please ..
Reply
#9

No one knows to fix it? ..
Please if anyone knows tell me I've been stuck because of it ..
Reply
#10

Quote:
Originally Posted by ******
Посмотреть сообщение
Yes, and we even told you where to find extensive documentation on all the specifiers and errors!
But I did not know what to do ..
Maybe instead of giving me hints tell me what the problem is? Please ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)