[Include] "lbc_messages" - Send complex client messages
#1

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:
    Код:
    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
    Код:
    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:
    Код:
    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:
    Код:
    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:
    Код:
     (( 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:
    Код:
    client_Message(playerid, 0xFFFFFF00, "@s(( @mI am playing samp @e24 hours @mevery day @e))");
    Would Print:
    Код:
    (( 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:
    Код:
    client_Message(playerid, 0xFFFFFF00, "My playerid is %i!", playerid);
    Would Print:
    Код:
    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!
Reply
#2

Really nice and useful. Good job.
Reply
#3

This is honestly nice job, you just made the SendClientMessage feature easiere! Anyway, would this also work with SendClientMessageToAll?
Reply
#4

Why not just message() instead of client_message ?
Reply
#5

Quote:
Originally Posted by CrazyChoco
Посмотреть сообщение
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
Посмотреть сообщение
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.
Reply
#6

Pretty nice +rep
Reply
#7

This is great, thank you VERY much.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)