lenght in chat
#1

I see in the wiki the max length in chat is 144, but this command, the length in any text is 125

pawn Код:
CMD:ooc(playerid, params[])
{
    new message[144];
    if(sscanf(params, "s[144]", message)) return CmdUsageMessage(playerid, "(/o)oc <Texto>");
    printf("message: %d", strlen(message));
    GlobalOOCMessage(playerid, message);
    return 1;
}
The text is: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae leo feugiat dui mattis luctus sit amet id ligula. Quisque vehicula cras amet."

the strlen print: "message: 125"

їWhy?

The new text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae leo feugiat dui mattis luctus sit amet id ligula. Quisque
Reply
#2

Don't use sscanf for this.
PHP код:
CMD:ooc(playeridparams[])
{
    if(
isnull(params)) return CmdUsageMessage(playerid"(/o)oc <Texto>");
    
printf("message: %d"strlen(params));
    
GlobalOOCMessage(playeridparams);
    return 
1;

Reply
#3

While chat output might be 144 chars, input may be restricted to 128 chars.
Reply
#4

I changed to "isnull" but the length is still 125.

I don't know about the input
Reply
#5

You can type 128 character but also you can "sendclientmessage" up to 144 chars

SendClientMessage

Quote:

const message[] The text that will be displayed (max 144 characters).

Reply
#6

Oh, okay. Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)