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



sscanf warning - UnAngel - 25.01.2014

Hey

PHP код:
command(pmplayeridparams[])
{
    new 
string[200], message[200], id;
    if(
sscanf(params"uz"idmessage))
    {
        
SendClientMessage(playeridWHITE"SYNTAX: /pm [playerid] [message]");
    }
    else
    {
        if(
IsPlayerConnectedEx(id))
        {
            if(
strlen(message) >= 1)
            {
                if(
Player[id][PMsEnabled] == 1)
                {
                    if(
Player[id][AFKStat] == 1)
                    {
                        
SendClientMessage(playeridWHITE"This administrator is away from keyboard, right now.");
                    }
                    else
                    {
                        
format(stringsizeof(string), "[PM] You have sent %s: %s "RemoveUnderScore(id), message);
                        
SendClientMessage(playeridPLAYERCOMstring);
                        
                        
format(stringsizeof(string), "[PM] from %s (ID: %d): %s "RemoveUnderScore(playerid), playeridmessage);
                        
SendClientMessage(idPLAYERCOMstring);
                        
                        
format(stringsizeof(string), "PM from [%d]%s to [%d]%s: %s"playerid,RemoveUnderScore(playerid),id,RemoveUnderScore(id),message);
                         
SendPMMessage(REDstring);
                        
PMsLog(string);
                    }
                }
                else
                {
                    
SendClientMessage(playeridWHITE"That player has disabled PMs!");
                }
            }
            else
            {
                
SendClientMessage(playeridWHITE"SYNTAX: /pm [playerid] [message]");
            }
        }
        else
        {
            
SendClientMessage(playeridWHITE"That player is not connected or isn't logged in.");
        }
    }
    return 
1;

error:
Код HTML:
[19:51:39] sscanf warning: 'z' is deprecated, consider using 'S' instead.
[19:51:39] sscanf warning: No default value found.
[19:51:39] sscanf warning: Strings without a length are deprecated, please add a destination size.
[19:51:39] sscanf warning: String buffer overflow.



Re: sscanf warning - skydux123 - 25.01.2014

"uz" change to "us"


Re: sscanf warning - UnAngel - 25.01.2014

now its says

Код HTML:
[21:44:56] sscanf warning: Strings without a length are deprecated, please add a destination size.
[21:44:56] sscanf warning: String buffer overflow.



Re: sscanf warning - ReD_HunTeR - 25.01.2014

"uz" change to "us[128]"


Re: sscanf warning - skydux123 - 25.01.2014

Quote:
Originally Posted by UnAngel
Посмотреть сообщение
now its says

Код HTML:
[21:44:56] sscanf warning: Strings without a length are deprecated, please add a destination size.
[21:44:56] sscanf warning: String buffer overflow.
us change to us[100]


Re: sscanf warning - UnAngel - 25.01.2014

work thanks