MGTDB

Combat log punishment for Exile

15 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, replace ExileServer_system_network_event_onHandleDisconnect.sqf with https://pastebin.com/gv0QhFD8
Note: Uncomment the lines marked for logging if you have infiSTAR

 

Then repack exile_server and your mission file and you're done.
Updated: Added Toast request 7/11/17
Updated: Check if server is about to restart and not punish the player 28/05/18

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

Edited by MGTDB
  • Like 15
  • Thanks 1

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
  • Like 3

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

  • Like 2

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
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.