Word Wrapping (Chat Extension)
#1

Working.
Reply
#2

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.
Reply
#3

https://github.com/Open-GTO/zmessage
Reply
#4

Quote:
Originally Posted by Spmn
Посмотреть сообщение
I included it, doesn't seem to be doing anything. Is there anything else I need to do?
Reply
#5

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.
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)