RCON:sscanf warning
#1

When someone does /pm this shows in my RCON

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

show the PM cmd
Reply
#3

Example :

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

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;
}
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)