sscanf warning
#1

Hey

PHP код:
command(pm, playerid, params[])
{
    new 
string[200], message[200], id;
    if(
sscanf(params, "uz", id, message))
    {
        
SendClientMessage(playerid, WHITE, "SYNTAX: /pm [playerid] [message]");
    }
    else
    {
        if(
IsPlayerConnectedEx(id))
        {
            if(
strlen(message) >= 1)
            {
                if(
Player[id][PMsEnabled] == 1)
                {
                    if(
Player[id][AFKStat] == 1)
                    {
                        
SendClientMessage(playerid, WHITE, "This administrator is away from keyboard, right now.");
                    }
                    else
                    {
                        
format(string, sizeof(string), "[PM] You have sent %s: %s ", RemoveUnderScore(id), message);
                        
SendClientMessage(playerid, PLAYERCOM, string);
                        
                        
format(string, sizeof(string), "[PM] from %s (ID: %d): %s ", RemoveUnderScore(playerid), playerid, message);
                        
SendClientMessage(id, PLAYERCOM, string);
                        
                        
format(string, sizeof(string), "PM from [%d]%s to [%d]%s: %s", playerid,RemoveUnderScore(playerid),id,RemoveUnderScore(id),message);
                         
SendPMMessage(RED, string);
                        
PMsLog(string);
                    }
                }
                else
                {
                    
SendClientMessage(playerid, WHITE, "That player has disabled PMs!");
                }
            }
            else
            {
                
SendClientMessage(playerid, WHITE, "SYNTAX: /pm [playerid] [message]");
            }
        }
        else
        {
            
SendClientMessage(playerid, WHITE, "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.
Reply
#2

"uz" change to "us"
Reply
#3

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.
Reply
#4

"uz" change to "us[128]"
Reply
#5

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]
Reply
#6

work thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)