11.11.2013, 07:54
(
Последний раз редактировалось LeBoyce; 15.12.2013 в 00:26.
)
LBC Messages
This is a small include which provides functions to send complex but yet easy client messages.
Features
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!
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.");
Код: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))");
Код:(( 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. ))
Example:Код:client_Message(playerid, 0xFFFFFF00, "@s(( @mI am playing samp @e24 hours @mevery day @e))");
Код:(( 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);
Код: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!