SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 11/11/2013, 08:54 AM   #1
LeBoyce
Little Clucker
 
Join Date: Jan 2013
Location: Germany
Posts: 37
Reputation: 22
Default Multifunctional Client Messages

LBC Messages

This is a small include which provides functions to send complex but yet easy client messages.

Features
  • Different Colors - When you want to use different colors within the message you can simply return to the "main" color by adding {/c}. In the following example "Test" will be printed in Pink(AA33AA) while "message" will be printed in White(0xFFFFFF00).

    Example:
    Code:
    client_Message(playerid, 0xFFFFFF00, "This is a {AA33AA}test{/c} message.");
  • Automatic Word Wrap - When the line exceeds a certain length the function automaticly calculates how many messages have to be send. It's to note that the function never breaks the line in the middle of a word. The last word will always be written and the line warp takes place after it. Unless the word is to long and would exceed samp's default line width. In this case it would break lines before this word.

    Example: Erlkönig by Johann Wolfgang von Goethe
    Code:
    client_Message(playerid, 0xFFFFFF00, "Wer reitet so spät durch Nacht und Wind? Es ist der Vater mit seinem Kind. Er hat den Knaben wohl in dem Arm, Er faßt ihn sicher, er hält ihn warm.");
    Would Print:
    Code:
    Wer reitet so spät durch Nacht und Wind? Es ist der Vater mit seinem Kind. Er hat den Knaben wohl in dem Arm, Er faßt ihn.. 
    ..sicher, er hält ihn warm.
  • Sort Message - You can split your message in three different parts. The start, the actual message and the end. But why would you do this? For example when your doing an out of character message which is surrounded by brackets "((" "))" but your message is longer than one line it helps you to automaticly append the start and end parts at the particular position for both lines. That means everything behind @s comes to the start, everything behind @m to the actual message and everything behind @e to the end.
    Example:
    Code:
    client_Message(playerid, 0xFFFFFF00, "@s(( @mWer reitet so spät durch Nacht und Wind? Es ist der Vater mit seinem Kind. Er hat den Knaben wohl in dem Arm, Er faßt ihn sicher, er hält ihn warm. @e))");
    Would Print:
    Code:
     (( Wer reitet so spät durch Nacht und Wind? Es ist der Vater mit seinem Kind. Er hat den Knaben wohl in dem Arm, Er faßt.. ))
     (( ..ihn sicher, er hält ihn warm. ))
    Since it's possible to use those subdivisons more than once in the same message you can also play around with this feature as shown in the following example.
    Example:
    Code:
    client_Message(playerid, 0xFFFFFF00, "@s(( @mI am playing samp @e24 hours @mevery day @e))");
    Would Print:
    Code:
    (( I am playing samp every day 24 hours ))
  • Formatted Message - You can also send a formatted message. I want to give ZeeX a huge credit here for his format method through #emit.
    Example:
    Code:
    client_Message(playerid, 0xFFFFFF00, "My playerid is %i!", playerid);
    Would Print:
    Code:
    My playerid is 213!


This is the first version of this function so if you have ideas for an other version or know how to optimize the code I'd love to hear your feedback!
Attached Files
File Type: rar LBC_messages.rar (2.3 KB, 73 views)

Last edited by LeBoyce; 15/12/2013 at 01:26 AM.
LeBoyce is offline   Reply With Quote
Old 11/11/2013, 03:43 PM   #2
Tamer
High-roller
 
Tamer's Avatar
 
Join Date: Nov 2011
Location: Turkey
Posts: 1,183
Reputation: 169
Default Re: "lbc_messages" - Send complex client messages

Really nice and useful. Good job.
__________________
The three stages of truth:

- Ridicule.
- Violent opposition.
- Acceptance.


Quote:
The greatest hypnotist on the planet Earth is an oblong box in the corner of the room. It is constantly telling us what to believe is real. If you can persuade people that what they see with their eyes is what there is to see you've got them. you know because they'll laugh in your face of an explanation that portrays the biggest picture of what's happening... and they have.
Tamer is offline   Reply With Quote
Old 11/11/2013, 03:53 PM   #3
CrazyChoco
Gangsta
 
Join Date: Feb 2012
Posts: 933
Reputation: 35
Default Re: "lbc_messages" - Send complex client messages

This is honestly nice job, you just made the SendClientMessage feature easiere! Anyway, would this also work with SendClientMessageToAll?
CrazyChoco is offline   Reply With Quote
Old 11/11/2013, 03:58 PM   #4
Kaperstone
Banned
 
Join Date: May 2011
Location: Russia
Posts: 3,337
Reputation: 824
Default Re: "lbc_messages" - Send complex client messages

Why not just message() instead of client_message ?
Kaperstone is offline   Reply With Quote
Old 11/11/2013, 09:15 PM   #5
LeBoyce
Little Clucker
 
Join Date: Jan 2013
Location: Germany
Posts: 37
Reputation: 22
Default Re: "lbc_messages" - Send complex client messages

Quote:
Originally Posted by CrazyChoco View Post
This is honestly nice job, you just made the SendClientMessage feature easiere! Anyway, would this also work with SendClientMessageToAll?
Jap. There's a "global_Message()" included.

Quote:
Originally Posted by xkirill View Post
Why not just message() instead of client_message ?
There's no real reason I just picked it since I included a "global_Message()" and wanted to have a clear mismatch between both.
LeBoyce is offline   Reply With Quote
Old 11/11/2013, 10:34 PM   #6
JustBored
High-roller
 
JustBored's Avatar
 
Join Date: Jan 2013
Location: Buenos Aires - Argentina
Posts: 1,165
Reputation: 134
Default Respuesta: "lbc_messages" - Send complex client messages

Pretty nice +rep
__________________
"Compiler - A program designed to tell you how wrong you are. It's a great way to induce stress and frustration."

JustBored is offline   Reply With Quote
Old 11/11/2013, 10:36 PM   #7
-CaRRoT
High-roller
 
-CaRRoT's Avatar
 
Join Date: Jul 2011
Location: CA, Los Angeles.
Posts: 1,386
Reputation: 344
Default Re: "lbc_messages" - Send complex client messages

This is great, thank you VERY much.
-CaRRoT 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
error: undefine symbol "j" and expected token ";" but found "]" JEkvall95 Scripting Help 9 27/07/2013 11:09 AM
Is there a fix for getting "interrupted" while typing in the SA:MP console? And how to send chat to RCON? [HLF]Southclaw Server Support 1 27/07/2012 10:16 PM
5 Dialog errors - Input line too long, undefined symbol "t","is" and "only" Deal-or-die Scripting Help 6 01/05/2012 01:08 PM
Its possible make SendChat("") to send the message only for a player? CTCCoco Help Archive 10 06/09/2009 02:03 PM


All times are GMT. The time now is 03:31 AM.


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