SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 28/03/2017, 10:44 PM   #1
sampEv0
Little Clucker
 
Join Date: Nov 2015
Posts: 5
Reputation: 0
Default Text Wrapping (solved)

Working.

Last edited by sampEv0; 29/03/2017 at 02:13 AM. Reason: works
sampEv0 is offline   Reply With Quote
Old 28/03/2017, 11:06 PM   #2
Toroi
Gangsta
 
Toroi's Avatar
 
Join Date: Feb 2017
Location: Venezuela
Posts: 693
Reputation: 146
Default Re: Word Wrapping (Chat Extension)

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:
http://wiki.sa-mp.com/wiki/Function#Creating_and_Using
http://wiki.sa-mp.com/wiki/Control_Structures#if
http://wiki.sa-mp.com/wiki/Strlen
http://wiki.sa-mp.com/wiki/Strmid
http://wiki.sa-mp.com/wiki/SendClientMessage

Have fun.
Toroi is offline   Reply With Quote
Old 28/03/2017, 11:36 PM   #3
Spmn
Gangsta
 
Join Date: Jun 2015
Location: Romania
Posts: 486
Reputation: 131
Default Re: Word Wrapping (Chat Extension)

https://github.com/Open-GTO/zmessage
Spmn is offline   Reply With Quote
Old 28/03/2017, 11:41 PM   #4
sampEv0
Little Clucker
 
Join Date: Nov 2015
Posts: 5
Reputation: 0
Default Re: Word Wrapping (Chat Extension)

Quote:
Originally Posted by Spmn View Post
I included it, doesn't seem to be doing anything. Is there anything else I need to do?
sampEv0 is offline   Reply With Quote
Old 29/03/2017, 12:11 AM   #5
Dignity
High-roller
 
Dignity's Avatar
 
Join Date: May 2013
Location: Belgium
Posts: 1,661
Reputation: 1211
Default Re: Word Wrapping (Chat Extension)

Quote:
Originally Posted by Troydere View Post
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 Code:
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 View Post
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.
Dignity is offline   Reply With Quote
Old 29/03/2017, 12:23 AM   #6
sampEv0
Little Clucker
 
Join Date: Nov 2015
Posts: 5
Reputation: 0
Default Re: Word Wrapping (Chat Extension)

Quote:
Originally Posted by Dignity View Post
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

Last edited by sampEv0; 29/03/2017 at 07:29 PM.
sampEv0 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
text word wrapping + color codes JernejL Scripting Help 1 19/12/2015 06:11 PM
[Map] DFT-30 extension maxtorcd55 Filterscripts 5 10/04/2014 07:17 PM
Help with text wrapping. lean1337 Scripting Help 2 11/03/2013 12:51 PM
Replace a word in chat [NWA]Hannes Scripting Help 8 09/06/2012 09:02 PM
GetTickCount wrapping after 24.8 days Dabombber Help Archive 4 08/09/2009 05:10 PM


All times are GMT. The time now is 05:51 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.