MGTDB

Combat log punishment for Exile

9 posts in this topic

Worked with @StokesMagee to bring combat logging punishment to Exile.
This will kick in and kill the combat logger if they leave the game whilst in combat, either through alt+f4 or end mission, leaving their lifeless corpse there to loot.
Players cannot logout normally whilst in combat as the option is blocked in escape menu

CLIENT
Pull ExileClient_gui_hud_toggleCombatIcon.sqf from client files into your mission file and change it to the following:-

private["_display", "_icon"];
disableSerialization;
_display = uiNamespace getVariable "RscExileHUD";
_icon = _display displayCtrl 1008;
if (_this && {!(player getVariable ["ExileIsInCombat", false])}) then
{
    player setVariable ["ExileIsInCombat", true, true];
}
else
{
    if (!(_this) && {player getVariable["ExileIsInCombat", false]}) then
    {
        player setVariable ["ExileIsInCombat", nil, true];
    };
};
_icon ctrlShow _this;
true

What this does is set a variable on the player that can be read from the server
Don't forget to add it into config.cpp in

class CfgExileCustomCode
{
	ExileClient_gui_hud_toggleCombatIcon = "ExileClient_gui_hud_toggleCombatIcon.sqf";//assuming changed file is in mission root
};

 

SERVER
Next, crack open exile_server.pbo and find ExileServer_system_network_event_onHandleDisconnect.sqf
In that file, find the line

if (_unit getVariable ["ExileIsHandcuffed", false]) then

and change it to

if (_unit getVariable ["ExileIsHandcuffed", false] || {_unit getVariable ["ExileIsInCombat", false]}) then

Then find the line

["systemChatRequest", [format["HANDCUFF LOGOUT: %1 has been killed.", name _unit]]] call ExileServer_system_network_send_broadcast;

and change it to (If you run infiSTAR for Exile, uncomment the customlog line by removing the // at the start

private _message = [
			format["HANDCUFF LOGOUT: %1 has been killed", name _unit],
			format["COMBAT LOGOUT: %1 has been killed", name _unit]
			] select (_unit getVariable ["ExileIsInCombat", false]);
			_logOutlog = format ["%1 %2", name _unit, _message];
			//["COMBATLOG",_logOutlog] call FNC_A3_CUSTOMLOG;//uncomment this line for infiSTAR logging
			["systemChatRequest", [_message]] call ExileServer_system_network_send_broadcast;
			["toastRequest", ["InfoTitleAndText", ["Logout!", _message]]] call ExileServer_system_network_send_broadcast;//Toast request too

Then repack exile_server and your mission file and you're done.
Updated: Added Toast request 7/11/17

Battleye edit required thanks to @Monkeynutz
Battleye restrictions will need !="exileisincombat" added to setVariable.txt

Edited by MGTDB
15 people like this

Share this post


Link to post
Share on other sites
16 hours ago, MGTDB said:

Worked with @StokesMagee
 

I totally wasn't the one to write all the code. :P oh wait, you wrote infiSTAR logging, it was also your idea.

thanks for giving me credits for it, other people would have been like "I MADE ALL DIS, ALL MINE, MINE, MINE, MINE"

380.png

Edited by StokesMagee
3 people like this

Share this post


Link to post
Share on other sites
Advertisement
9 minutes ago, StokesMagee said:

I totally wasn't the one to write all the code. :P

Nearly all (don't forget logging), after I mentioned piggybacking it to handcuffing xD

2 people like this

Share this post


Link to post
Share on other sites
6 minutes ago, MGTDB said:

Nearly all (don't forget logging), after I mentioned piggybacking it to handcuffing xD

I was saying where to put it before you told me where to put it :P

Share this post


Link to post
Share on other sites

Updated OP to include an Exile toast notification on the log

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.