sscanf error?
#1

Hello.

I have a problem recently where when I do my command, it doesn't return the whole sentence, it cuts it off, even though it can still fit on the screen.

it adds around 30characters and that's it.

this is my cmd:

pawn Код:
CMD:adminad(playerid, params[])
{
    new string[256];
    if(!IsPlayerLoggedIn(playerid)) return SCM(playerid, COLOR_GREY, "You are not logged in.");
    if(PlayerInfo[playerid][pAdmin] < 5) return SCM(playerid, COLOR_WHITE, "SERVER: Unknown command.");
    if(sscanf(params, "s", string)) return SCM(playerid, COLOR_WHITE, "USAGE: /weatherad [message]");
    else
    {
        SCMTA(COLOR_WHITE, "-------------------------------------------------------------------------------------------------------------");
        SendClientMessageToAll(COLOR_AQUA, "Bone County Roleplay Administration :: Public Announcement [OOC]");
        format(string, sizeof(string), "%s", string);
        SendClientMessageToAll(COLOR_GREY, string);
        SCMTA(COLOR_WHITE, "-------------------------------------------------------------------------------------------------------------");

    }
    return 1;
}
Reply
#2

pawn Код:
CMD:adminad(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SCM(playerid, COLOR_GREY, "You are not logged in.");
    if(PlayerInfo[playerid][pAdmin] < 5) return SCM(playerid, COLOR_WHITE, "SERVER: Unknown command.");
    if(sscanf(params, "s", string)) return SCM(playerid, COLOR_WHITE, "USAGE: /weatherad [message]");
    else
    {
        SCMTA(COLOR_WHITE, "-------------------------------------------------------------------------------------------------------------");
        SendClientMessageToAll(COLOR_AQUA, "Bone County Roleplay Administration :: Public Announcement [OOC]");
        new string[128];
        format(string, sizeof(string), "%s", string);
        SendClientMessageToAll(COLOR_GREY, string);
        SCMTA(COLOR_WHITE, "-------------------------------------------------------------------------------------------------------------");

    }
    return 1;
}
Read this and check your SCMTA and SCM functions or show 'em above so we can see what's wrong.

Also max characters in chat can be 128 not longer so it does not really depend on your screens size or anything coz you can put 200 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiiiiiiiiiiii' however only 128 of them will be displayed in your chat.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)