No cut-off in text
#1

Hey, when I type something very long it gets cut-off. I need help with the string splitting into two lines so the text doesn't get cut-off.

pawn Код:
CMD:b(playerid, params[])
{
    new
        string[128],
        action[128];
    if(sscanf(params, "s[100]", action))
    {
        SendClientMessage(playerid, COLOR_GREY, "[Usage]: /b [text]");
        return 1;
    }
    else
    {
        format(string, sizeof(string), "(( %s: %s ))", GetName(playerid), action);
        ProxDetector(20, playerid, string, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
    }
    return 1;
}
Reply
#2

The limit is 144 for client messages. You used only 100, so you get 43 characters more (+ NULL).

pawn Код:
CMD:b(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "[Usage]: /b [text]");
    new string[144];
    format(string, sizeof(string), "(( %s: %s ))", GetName(playerid), params);
    ProxDetector(20, playerid, string, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
    return 1;
}
Reply
#3

Thanks, mate.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)