SA-MP Forums Archive
Sscanf errors - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Sscanf errors (/showthread.php?tid=216012)



Sscanf errors - Fool - 24.01.2011

Im using Sscanf2 I get a bit of warnings on Console
CMD:

pawn Код:
IRCCMD:addarmy(botid, channel[], user[], host[], params[])
{
   
    if (IRC_IsAdmin(botid, channel, user))
    {
        new
            playerid,
            reason[64];

        if (sscanf(params, "ds", playerid, reason))
        {
            return 1;
        }
        if (IsPlayerConnected(playerid))
        {
            new
                msg[128],
                name[MAX_PLAYER_NAME];
            if (isnull(reason))
            {
                format(reason, sizeof(reason), "<no reason defined>");
            }
            if(PlayerInfo[playerid][IsArmy] == 1) {
            IRC_GroupSay(gGroupID, channel, "ERROR: This Player is already Army!"); }
            else {
            GetPlayerName(playerid, name, sizeof(name));
            format(msg, sizeof(msg), "02*** %s has been maded Army by %s on IRC. (%s)", name, user, reason);
            IRC_GroupSay(gGroupID, channel, msg);
            PlayerInfo[playerid][IsArmy] = 1;
            }


        }
    }

    return 1;
}
This is What i get in the console:

[21:56:19] sscanf warning: Strings without a length are deprecated, please add a destination size.


Re: Sscanf errors - blackwave - 24.01.2011

pawn Код:
if (sscanf(params, "ds[64]", playerid, reason))



Re: Sscanf errors - Fool - 24.01.2011

Quote:
Originally Posted by blackwave
Посмотреть сообщение
pawn Код:
if (sscanf(params, "ds[64]", playerid, reason))
i need to check the strings? wow, never mind