Things needed:
- QB Decompiler/Compiler
- Knowledge with %GLOBAL%
IMPORTANT: If you have NO IDEA what GLOBAL does, read this first, it's a great tutorial that explains what it does in detail http://home.arcor.de/hackthps/GLOBAL/howtouseglobal.html
The way this tutorial works:
- The functions will be displayed in quotes (because I can't use color in code)
- Parts of each function will be color coded, underneath the function will show you what each color means
The reason I am color coding things is so people will learn what each part of the function does.
How to change your default text colour
1) Navigate to game.qb and decompile it
2) Find this function
Code: Select all
:i function $entered_chat_message$
:i call $GetTextElementString$ arguments
$id$ = $keyboard_current_string$
:i call $SendChatMessage$ arguments
$string$ = %GLOBAL%$string$
:i $destroy_onscreen_keyboard$
:i endfunction
This is the function we will be editing. Change the function so it looks like this;
:i function $entered_chat_message$
:i call $GetTextElementString$ arguments
$id$ = $keyboard_current_string$
:i call $FormatText$ arguments
$TextName$ = $colour_text$%s(5,"\cb%s")$s$ = %GLOBAL%$string$
:i call $SendChatMessage$ arguments
$string$ = %GLOBAL%$colour_text$
:i $destroy_onscreen_keyboard$
:i endfunction
# This is the vital part to the make the function work, it contains the text that changes the colour
# This is the actual text. "\cb" is a colour, and %s is $s$
# This is the part of the function that allows you to still display what you type
# This now has "$string$ = %GLOBAL%$colour_text$" instead of "$string$ = %GLOBAL%$string$"
This is because "$colour_text$ now contains %GLOBAL%$string$.
If you don't understand that, what's happening is now when $SendChatMessage$ is called (when you press enter to submit your message), The string will first call $colour_text$, and AFTER $colour_text$ is called, it will then call %GLOBAL%$string$.
If you have any chat commands (like /set, /goto /hi, etc) things will look a little different, but effectively it will be the same. Disregard this next function if you don't have /set /goto, etc commands
Code: Select all
:i if NOT ( (%GLOBAL%$string$ = %s(3,"/set")) )
:i call $FormatText$ arguments
$TextName$ = $colour_text$%s(5,"\cb%s")$s$ = %GLOBAL%$string$
:i call $SendChatMessage$ arguments
$string$ = %GLOBAL%$colour_text$
:i endif
:i $destroy_onscreen_keyboard$
:i endfunction