Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] [Solved] Send a message on multiple lines [text length more than 144]

 
  • 0 Vote(s) - 0 Average
Pawn [Solved] Send a message on multiple lines [text length more than 144]
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#1
2021-06-08, 01:05 PM (This post was last modified: 2021-06-09, 11:12 AM by Radical.)
I'm looking for that function, if the text length is more than 144 letters, Send it in two messages.
Thanks

SOLUTION:

(2021-06-09, 08:48 AM)Pinch Wrote: https://www.burgershot.gg/showthread.php?tid=748


I maked this function but it does not work as I wanted. 
This separates the word between strings 144

burgershot >>

burg ..
.. ershot

Code:
SendClientMessageToAllEx(color, const text[]) {

    new
        message[144];
   
    strcat(message, text);

    new
        lentgh = strlen(message);

    if (lentgh >= 143) {

        new
            message_2[144];

        format(message_2, sizeof message_2, ".. %s", message[139]);

        strdel(message, 139, lentgh);
        strcat(message, " ..");

        SendClientMessageToAll(color, message);

        SendClientMessageToAll(color, message_2);

    } else
        SendClientMessageToAll(color, message);

    return 1;
}
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#2
2021-06-09, 08:48 AM
https://www.burgershot.gg/showthread.php?tid=748
Using Pawn.CMD?
If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode