Sscanf warning: Strings without a length are deprecated, please add a destination size.
#1

Hello guys, so i'm not good at sscanf, and can't figure out what i've done wrong. But whenever i make a pm, i get this error in my server log: scanf warning: Strings without a length are deprecated, please add a destination size.
Well I do know that i need to add a string some where, but where exactly?

Could anyone help? Thanks.

Code:

PHP код:
CMD:pm(playeridparams[])
{
    new 
pIDtext[210], string[230];
    if(
sscanf(params"us"pIDtext)) return SendClientMessage(playeridERROR_COLOR"USAGE: /pm (nick/id) (message) - Enter a valid Nick / ID");
    if(!
IsPlayerConnected(pID)) return SendClientMessage(playeridERROR_COLOR"Player is not connected.");
    if(
pID == playerid) return SendClientMessage(playeridERROR_COLOR"You cannot PM yourself.");
    
format(stringsizeof(string), "%s (%d) is not accepting private messages at the moment."GetName(pID), pID);
    if(
PlayerInfo[pID][NoPM] == 1) return SendClientMessage(playeridERROR_COLORstring);
    
format(stringsizeof(string), "PM to %s: %s"GetName(pID), text);
    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
    
format(stringsizeof(string), "PM from %s: %s"GetName(playerid), text);
    
SendClientMessage(pIDCOLOR_LIGHTBLUEstring);
    
PlayerInfo[pID][Last] = playerid;
    return 
1;
}
CMD:r(playeridparams[])
{
    new 
text[128], string[128];
    if(
sscanf(params"s"text)) return SendClientMessage(playeridERROR_COLOR"USAGE: /r (message) - Enter your message");
    new 
pID PlayerInfo[playerid][Last];
    if(!
IsPlayerConnected(pID)) return SendClientMessage(playeridERROR_COLOR"Player is not connected.");
    if(
pID == playerid) return SendClientMessage(playeridERROR_COLOR"You cannot PM yourself.");
    
format(stringsizeof(string), "%s (%d) is not accepting private messages at the moment."GetName(pID), pID);
    if(
PlayerInfo[pID][NoPM] == 1) return SendClientMessage(playeridERROR_COLORstring);
    
format(stringsizeof(string), "PM to %s: %s"GetName(pID), text);
    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
    
format(stringsizeof(string), "PM from %s: %s"GetName(playerid), text);
    
SendClientMessage(pIDCOLOR_LIGHTBLUEstring);
    
PlayerInfo[pID][Last] = playerid;
    return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)