Jump to content

[Release] Anti Combat Log 1.0.6.1


icomrade

Recommended Posts

Updated version of this script: 

In server_playerSync.sqf

Find this block of code: https://github.com/EpochModTeam/DayZ-Epoch/blob/Release_1.0.6.2/SQF/dayz_server/compile/server_playerSync.sqf#L142-L149

Replace with: 

if (_this select 4) then { //combat logged
	_medical set [1, true]; //set unconcious to true
	_medical set [10, 150]; //combat timeout
	//_character setVariable ["NORRN_unconscious",true,true]; // Set status to unconscious
	//_character setVariable ["unconsciousTime",150,true]; // Set knock out timer to 2 minutes 30 seconds
	//_character setVariable ["USEC_injured",true]; // Set status to bleeding
	//_character setVariable ["USEC_BloodQty",3000]; // Set blood to 3000

	//Begin anti combat log
	_weapons            = _playerGear select 0;
	_weapons_backpack     = _playerBackp select 1;
	_current_magazine    = currentMagazine _playerObj;
	_magazines_backpack = _playerBackp select 2;
	_magazinesRemove = _magazines;

	if ((typeName (_magazinesRemove select 0)) == "ARRAY") then {
		if ((count _magazinesRemove > 1) && {((typeName (_magazinesRemove select 1)) == "STRING") && {((_magazinesRemove select 1) != "")}}) then {
			_weapons set [(count _weapons), (_magazinesRemove select 1)];
		};
		_magazinesRemove = _magazines select 0;
	};

	_loot_box = "USBasicAmmunitionBox" createVehicle [0,0,0];

	clearMagazineCargoGlobal _loot_box;
	clearWeaponCargoGlobal _loot_box;

	{
		_loot_box addWeaponCargoGlobal [_x,1];
	} forEach _weapons;

	_magazinesRemove set [(count _magazinesRemove),_current_magazine];

	{
		_loot_box addMagazineCargoGlobal [_x,1];
	} forEach _magazinesRemove;

	if (typeOf _backpack != "") then {
		if ((typename _weapons_backpack) == "ARRAY") then {
			{
				_loot_box addWeaponCargoGlobal [_x,((_weapons_backpack select 1) select _forEachIndex)];
			} forEach (_weapons_backpack select 0);
		};

		if ((typename _magazines_backpack) == "ARRAY") then {
			{
				_loot_box addMagazineCargoGlobal [_x,((_magazines_backpack select 1) select _forEachIndex)];
			} forEach (_magazines_backpack select 0);
		};
		_loot_box addBackpackCargoGlobal[(typeOf _backpack),1];
	};

	_playerBackp = ["",[[],[]],[[],[]]];
	_playerGear = [[],[]];
	_currentAnim = "";
	_currentWpn = "";
	//End anti combat log
};

 

Above this line: https://github.com/EpochModTeam/DayZ-Epoch/blob/Release_1.0.6.2/SQF/dayz_server/compile/server_playerSync.sqf#L180

place this code: 

if (!isNil "_loot_box") then { //anti combat-log
	_loot_box setPos _charPos;
};

YOU MUST ADD "_loot_box" TO YOUR PRIVATE ARRAY AT THE TOP OF THE FILE!

Link to comment
Share on other sites

Works great, had it on my server a while now, hoever took me a while to get it working. Came to the conclusion it was infistar messing with it.

Did some testing and got it working by doing the following.

 Open AH.sqf and find

_fnc_punish_combatlog = {
                  _isInCombat = player getVariable['startcombattimer',0];
                    if(str _isInCombat != '0')then{ player setDamage 1; };
                };

Comment out that whole section

//_fnc_punish_combatlog = {
                //    _isInCombat = player getVariable['startcombattimer',0];
                    //if(str _isInCombat != '0')then{ player setDamage 1; };
                //};

 

Save and it should work a treat.

Link to comment
Share on other sites

  On 3/25/2017 at 1:06 AM, SmokeyBR said:

i remember when i used this back then, the box would end up in the air case player was flying, if you didnt worked that in, any chance you look into it ?

Expand  

Updated original post to fix this (untested, but minor changes so meh).

Edit: Almost forgot, you'll need to add "_loot_box" to the file's private array

Link to comment
Share on other sites

testing went all good everything working.

heres some more headache for you hehe, when testing while flying i was above water once you get out of knockout you start swiming above it and loose the box, also maybe add coins support transform coins into briefcases, hehe but thats just me throwing out there.

im pretty satisfied with the it is right now, thank you.

Link to comment
Share on other sites

  On 3/25/2017 at 3:32 AM, SmokeyBR said:

testing went all good everything working.

heres some more headache for you hehe, when testing while flying i was above water once you get out of knockout you start swiming above it and loose the box, also maybe add coins support transform coins into briefcases, hehe but thats just me throwing out there.

im pretty satisfied with the it is right now, thank you.

Expand  

Actually there's a pretty obvious error I left in. The bellow should fix your issues with water

 

try changing 

_loot_box setPosATL _charPos; //anti combat-log

to

if (!isNil "_loot_box") then { //anti combat-log
	_loot_box setPos _charPos;
};

 

Link to comment
Share on other sites

  On 3/25/2017 at 5:26 AM, icomrade said:

Actually there's a pretty obvious error I left in. The bellow should fix your issues with water

 

try changing 

_loot_box setPosATL _charPos; //anti combat-log

to

if (!isNil "_loot_box") then { //anti combat-log
	[_loot_box, _charPos, !(surfaceIsWater _charPos)] call FNC_GetSetPos;
};

 

Expand  

Would that be the same as setPosASL?   If so I had problems with it going in side of hills.

Link to comment
Share on other sites

  • 4 weeks later...

Easy Install but when I test it (combat log) there is no box when I rejoin.

What did I miss?

EDIT: Players now report loss of all gear and coins with relog after this was installed.

  Reveal hidden contents

 

Link to comment
Share on other sites

  • 1 month later...
  • 8 months later...
  On 3/4/2018 at 9:07 PM, nova said:

guess not :(

Expand  

Since this file already gets the player's Z_MoneyVariable variable and syncs it to the database at the end, you just need to find this line:

clearWeaponCargoGlobal _loot_box;

And add this below it:

_loot_box setVariable [Z_MoneyVariable,_coins,true];
	_coins = 0;

Then add "USBasicAmmunitionBox" to the DZE_MoneyStorageClasses array in varables.sqf

 

Maybe there is another step, but I think that should work.

Link to comment
Share on other sites

  • 1 month later...

Question about part of this topic:

Is there any way to disable the unconcious state or to let it really low (like 3-5 secs)? I have a couple of ex militars in my group and keep telling me that "a bullet hurt and burn like hell... but you dont faint for a shot in a leg or in the arm" jajajaja

Thank you

Link to comment
Share on other sites

  On 5/5/2018 at 6:39 PM, LadyVal said:

Question about part of this topic:

Is there any way to disable the unconcious state or to let it really low (like 3-5 secs)? I have a couple of ex militars in my group and keep telling me that "a bullet hurt and burn like hell... but you dont faint for a shot in a leg or in the arm" jajajaja

Thank you

Expand  

Comment out these 2 lines: https://github.com/EpochModTeam/DayZ-Epoch/blob/Release_1.0.6.2/SQF/dayz_server/compile/server_playerSync.sqf#L143-L144

Link to comment
Share on other sites

 

Thanks a lot, Salival!!

----------------------------------------------------------------------------------

I commented those 2 lines like you suggested but it is not working.  Guys not only have the hourglass, it last even much more longer.
The idea is... if the shot kills you, it kills you.. if not,, no unconcious time

  Reveal hidden contents
Link to comment
Share on other sites

  • 9 months later...

this script works as is with no problems... if you do have a problem is on your server.

go though the installation again make sure everything was done properly, also make sure you do this:

  On 3/24/2017 at 5:42 PM, icomrade said:

YOU MUST ADD "_loot_box" TO YOUR PRIVATE ARRAY AT THE TOP OF THE FILE!

Expand  

if you are 200% sure you followed all the steps than something else is messing with it, i would guess infistar if you use it. A good next step for finding the problem is looking for errors on client RPT and server RPT.

Link to comment
Share on other sites

Yes it was indeed Infistar in AH.sqf I just commented it out. 

//_fnc_punish_combatlog = {

//isInCombat = player getVariable['startcombattimer',0];

 //if(str _isInCombat != '0')then{ player setDamage 1; };

 //};

And in the AHconfig.sqf and turned off 

_UCL =  false;    // Use Anti Combat Log    /* true or false */

Works now! :)

Thanks for your help @SmokeyBR

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...