[HELP]sscanf warning: Strings without a length are deprecated, please add a destination size.
#1

I get this warning and then the server crashes. the offline ban command crashes the server.
PHP код:
CMD:oban(playerid,params[])
{
    if(
PlayerInfo[playerid][pAdmin] < 2) return 0;
    {
        new 
otherplayerfilestring[79], string[128], reason[128];
         if(
sscanf(params"ss"otherplayerreason)) return SendClientMessage(playeridCOLOR_GRAY,"Usage: /oban [playername] [reason]");
        if(
otherplayer == playerid) return SendClientMessage(playeridCOLOR_ERROR"Error: You cannot offline ban yourself.");
        if(
PlayerInfo[playerid][pAdmin] < PlayerInfo[otherplayer][pAdmin] && PlayerInfo[playerid][pAdmin] != 6) return SendClientMessage(playeridCOLOR_ERROR"Error: You cannot offline ban this player.");
        
format(filestringsizeof(filestring), "/Users/%s.ini"otherplayer);
        if(!
fexist(filestring)) return SendClientMessage(playeridCOLOR_ERROR"Error: Account does not exist.");
        else
        {
            new 
INI:File INI_Open(filestring);
            
INI_SetTag(File,"User Files");
            
INI_WriteInt(File"Banned"1);
            
INI_WriteString(File"BannedReason"reason);
            
INI_WriteString(File"BannedBy"GetName(playerid));
            
INI_Close(File);
            
format(stringsizeof(string), "Admin Log: %s has offline banned player %s."GetName(playerid), otherplayer);
             
Admin(COLOR_ADMIN_LOG,string1);
             
SendDC(AUSERLOGstring);
             
SaveToFile("AdminLogs",string);
        }
    }
    return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)