strings are deprecated error.
#1

pawn Код:
command(helpme, playerid, params[])
{
    new help[255], string[128];
    if(sscanf(params, "s", help))
    {
        SendClientMessage(playerid,-1, "SYNTAX: /helpme [message]");
    }
    else
    {
        format(string, sizeof(string), "{FE2EC8}[HELP]: {FFFFFF}%s{FE2EC8}: %d", playerid, help);
        SendToStaff(COLOR_PINK, string);
        SendClientMessage(playerid, YELLOW, "Your question was sent to the Staff team, await a reply.");
    }
    return 1;
}
When I type this command in game, it comes up with an error in the server log. "sscanf warning: Strings without a length are deprecated, please add a destination size." Please can you help me?
Reply
#2

pawn Код:
command(helpme, playerid, params[])
{
    if(isnull(params)) SendClientMessage(playerid,-1, "SYNTAX: /helpme [message]");
    else{
        new string[145];
        format(string, sizeof(string), "{FE2EC8}[HELP]: {FFFFFF}%s{FE2EC8}: %d", params, playerid);
        SendToStaff(COLOR_PINK, string);
        SendClientMessage(playerid, YELLOW, "Your question was sent to the Staff team, await a reply.");
    }
    return 1;
}
Reply
#3

pawn Код:
command(helpme, playerid, params[])
{
    new help[128], string[255];
    if(sscanf(params, "s[128]", help))
    {
        SendClientMessage(playerid,-1, "SYNTAX: /helpme [message]");
    }
    else
    {
        format(string, sizeof(string), "{FE2EC8}[HELP]: {FFFFFF}%s{FE2EC8}: %d", playerid, help);
        SendToStaff(COLOR_PINK, string);
        SendClientMessage(playerid, YELLOW, "Your question was sent to the Staff team, await a reply.");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)