SA-MP Forums Archive
RCON: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: RCON:sscanf warning (/showthread.php?tid=342646)



RCON:sscanf warning - dannyk0ed - 14.05.2012

When someone does /pm this shows in my RCON

Код:
[18:58:13] sscanf warning: Format specifier does not match parameter count.



Re: RCON:sscanf warning - AlTy - 14.05.2012

show the PM cmd


Re: RCON:sscanf warning - ViniBorn - 14.05.2012

Example :

pawn Код:
if(sscanf(params, "s[80])", params)) // Error
pawn Код:
if(sscanf(params, "s[80]", params)) // No error



Re: RCON:sscanf warning - dannyk0ed - 14.05.2012

Sorry
pawn Код:
CMD:pm(playerid,params[])
{
    new id;
    new string[256];
    new pName[MAX_PLAYER_NAME];
    new pName2[MAX_PLAYER_NAME];
    if(sscanf(params,"us[128]",id)) return SendClientMessage(playerid,COLOR_YELLOW,"Usage:/pm [ID] [Text]");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player ID Doesn't Exist");
    {
        GetPlayerName(playerid,pName,sizeof(pName));
        GetPlayerName(id,pName2,sizeof(pName2));
        format(string,sizeof(string),"Private Message Recived From: [%s]: %s",pName,params);
        SendClientMessage(id,COLOR_YELLOW,string);
        format(string,sizeof(string),"Private Message Sent To: [%s]: %s",pName2,params);
        SendClientMessage(playerid,COLOR_YELLOW,string);
        format(string,sizeof(string),"%s wrote a private message to: %s! Text: %s ",pName,pName2,params);
        Log("logs/PMLog.log",string);
    }
    return 1;
}



Re: RCON:sscanf warning - Jonny5 - 14.05.2012

pawn Код:
if(sscanf(params,"us[128]",id))
you are expecting a userid and a string but only give a id var

you need a string
pawn Код:
if(sscanf(params,"us[128]",id,STRINGHERE))
the error
sscanf warning: Format specifier does not match parameter count.
gave it away