Word Wrapping (Chat Extension) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Word Wrapping (Chat Extension) (
/showthread.php?tid=631408)
Text Wrapping (solved) -
sampEv0 - 28.03.2017
Working.
Re: Word Wrapping (Chat Extension) -
Toroi - 28.03.2017
Hook the SendClientMessage function to (or make) a new function, check for the lenght of the string, if its more than the limit, cut it and send the rest in a separate SendClientMessage function
Tools you may need:
https://sampwiki.blast.hk/wiki/Function#Creating_and_Using
https://sampwiki.blast.hk/wiki/Control_Structures#if
https://sampwiki.blast.hk/wiki/Strlen
https://sampwiki.blast.hk/wiki/Strmid
https://sampwiki.blast.hk/wiki/SendClientMessage
Have fun.
Re: Word Wrapping (Chat Extension) -
Spmn - 28.03.2017
https://github.com/Open-GTO/zmessage
Re: Word Wrapping (Chat Extension) -
sampEv0 - 28.03.2017
Quote:
Originally Posted by Spmn
|
I included it, doesn't seem to be doing anything. Is there anything else I need to do?
Re: Word Wrapping (Chat Extension) -
Dignity - 29.03.2017
Quote:
Originally Posted by Troydere
Hook the SendClientMessage function to (or make) a new function, check for the lenght of the string, if its more than the limit, cut it and send the rest in a separate SendClientMessage function
*insert links here*
Have fun.
|
I'm only commenting here because coding doesn't need to be overly complicated, a function like the one below which is pretty simple to understand will work just fine without much issue.
I'm not going to spoonfeed you code though, look up how to incorporate this into your script yourself.
pawn Код:
SendSplitMessage ( playerid, color, text [] ) {
new string [ 144 ] ;
if ( strlen ( text ) > 100 ) {
format ( string, sizeof ( string ), "%.100s ...", text ) ;
SendClientMessage(playerid, color, string ) ;
format ( string, sizeof ( string ), "... %s", text [ 100 ] ) ;
SendClientMessage(playerid, color, string ) ;
}
else return SendClientMessage(playerid, color, text ) ;
return true ;
}
Quote:
Originally Posted by sampEv0
I included it, doesn't seem to be doing anything. Is there anything else I need to do?
|
You should probably learn the basics of scripting first. If you don't know how, scripting probably isn't for you. As a scripter you should be able to look up things, figure out yourself where to get started and start reading things literally.
Good luck, but don't expect to be helped much if you're not gonna work for it yourself.
Re: Word Wrapping (Chat Extension) -
sampEv0 - 29.03.2017
Quote:
Originally Posted by Dignity
You should probably learn the basics of scripting first. If you don't know how, scripting probably isn't for you. As a scripter you should be able to look up things, figure out yourself where to get started and start reading things literally.
Good luck, but don't expect to be helped much if you're not gonna work for it yourself.
|
Edit: got it working. much appreciated my man