Mullah asked me to pop this in here so here it is
The steps below allow you to add a chat box to the main SCP GUI so after selecting a player, you can console his global chat and say whatever you want. Whatever you type in the chat box will appear to all other players as coming from the player you have selected.
Prerequisites:
Knowledge at least two of the topics below is recommended before attempting this modification
* Practical knowledge of a Object Orientated programming language such as Java, C++, C#.....
* Knowledge of Graphical User Interface principles
* Knowledge of the ArmA virtual machine scripting language
First job is to add the console GUI components to the SCP GUI.
1. RscEditDialog.hpp
1.1 Locate the Controls[] array in class Edit_YOURDEVSTRING_Dialog and add consoleInput (The text box you will type into) and ButtonActivateChatconsole(the button that will execute the console script). Now the names of the new controls have been defined we can now add the classes.
Add the following classes after the LAST class in the parent class Edit_YOURDEVSTRING_Dialog (class ButtonEnd ).
class console_YOURDEVSTRING_Input : ValueClass
{
idc = IDC_TKC_YOURDEVSTRING_console_INPUT;
y = 0.20;
text = "Enter text here";
colorText[] = {White, 1};
colorBackground[] = {Black, 0.9};
};
class ButtonActivateChat_YOURDEVSTRING_console : MyRscButton
{
idc = IDC_BUTTONACTconsole_YOURDEVSTRING;
x = 0.095;
y = 0.23;
w = 0.100;
h = 0.025;
colorText[] = {ShineRed, 1};
colorBackground[] = {Black, 0.9};
colorFocused[] = {White, 0.9};
colorBorder[] = {Red, 0.8};
text = $STR_ED_DIALOGSCRIPTACTIVATEconsole;
action = "runInitScript;[IDC_TKC_YOURDEVSTRING_console_INPUT] exec format[""%1console.sqs"",console];";
};
2. RscEditDialog.csv
2.1 Add the string for the ButtonActivateChat_YOURDEVSTRING_console button text to the parent dialogs string table:
STR_ED_DIALOGSCRIPTACTIVATEconsole,"console","console","console","console","console","console","console","console"
3. EditDialog.sqs
3.1 EditDialog.sqs can be found in scripts\Edit_YOURDEVSTRING_Dialog. Open it and define the UNIQUE ID numbers for the controls you have just created :
IDC_BUTTONACTconsole_YOURDEVSTRING = 666
IDC_TKC_YOURDEVSTRING_console_INPUT = 667
4. console.sqs
4.1 Now create a file called console.sqs and add the following simple code:
_console_YOURDEVSTRING_Idd = _this select 0
console_YOURDEVSTRING_Text= ctrlText IDC_TKC_YOURDEVSTRING_console_INPUT
[obj, "l globalchat format[""%1"",console_YOURDEVSTRING_Text] "] exec "YOURDEVSTRING\scripts\_do_public2.sqs"
exit
That should be it!
Repack your SCP, join a game, select your target and have some fun!