open.mp forum
[Pawn] [Solved] Send a message on multiple lines [text length more than 144] - Printable Version

+- open.mp forum (https://forum.open.mp)
+-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
+--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
+--- Thread: [Pawn] [Solved] Send a message on multiple lines [text length more than 144] (/showthread.php?tid=2104)



[Solved] Send a message on multiple lines [text length more than 144] - Radical - 2021-06-08

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; }



RE: Send a message on multiple lines [text length more than 144] - Pinch - 2021-06-09

https://www.burgershot.gg/showthread.php?tid=748