Jump to content

[RELEASE] Recover Skin From Dead Players or AI


MattL

Recommended Posts

Yes the Recoverskin.sqf i put in my scripts folder

and the player_death.sqf in my custom.

One of my friends had the same problem, where he couldn't get it to work and it was throwing no errors, he just tried moving it around to a couple of different places in the player_death.sqf and he got his to work around line 81, just try a few different spots, I don't know why it's being so finnicky as with 1.0.4.2 it worked anywhere I put it. You could also try execVM instead of call compile. 

Link to comment
Share on other sites

One of my friends had the same problem, where he couldn't get it to work and it was throwing no errors, he just tried moving it around to a couple of different places in the player_death.sqf and he got his to work around line 81, just try a few different spots, I don't know why it's being so finnicky as with 1.0.4.2 it worked anywhere I put it. You could also try execVM instead of call compile. 

Worked with execVM.

Thanks for your help :)

 

 

Ace

Link to comment
Share on other sites

i got it to work, funny stuff, i tested it using my suicide script which looked like that:

[] spawn {
    _ammo = player ammo (currentWeapon player);
    waitUntil {_ammo > player ammo (currentWeapon player)};
    [] spawn (compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_death.sqf');
    player setDamage 1;
};

so it couldnt work because it was loading the wrong player_death file ^^

Link to comment
Share on other sites

working fine for player bodies but not for dzai get this error

 

9:29:57 Error in expression <count _loot,(_x select 0)];};
}
} count DZAI_metalBars;
};
};




_toolsArray = >
 9:29:57   Error position: <DZAI_metalBars;
};
};




_toolsArray = >
 9:29:57   Error Undefined variable in expression: dzai_metalbars
 9:29:57 File z\addons\dayz_server\DZAI\compile\ai_generate_loot.sqf, line 93

 

 

 

followed the example in the install folder

Link to comment
Share on other sites

working fine for player bodies but not for dzai get this error

 

9:29:57 Error in expression <count _loot,(_x select 0)];};

}

} count DZAI_metalBars;

};

};

_toolsArray = >

 9:29:57   Error position: <DZAI_metalBars;

};

};

_toolsArray = >

 9:29:57   Error Undefined variable in expression: dzai_metalbars

 9:29:57 File z\addons\dayz_server\DZAI\compile\ai_generate_loot.sqf, line 93

 

 

 

followed the example in the install folder

hmmi havnt had any thing like this yet, maybe matt could halp

Link to comment
Share on other sites

working fine for player bodies but not for dzai get this error

 

9:29:57 Error in expression <count _loot,(_x select 0)];};

}

} count DZAI_metalBars;

};

};

_toolsArray = >

 9:29:57   Error position: <DZAI_metalBars;

};

};

_toolsArray = >

 9:29:57   Error Undefined variable in expression: dzai_metalbars

 9:29:57 File z\addons\dayz_server\DZAI\compile\ai_generate_loot.sqf, line 93

 

 

 

followed the example in the install folder

That error is coming from a file that shouldn't of been touched at all, so that's a tad weird

Link to comment
Share on other sites

As the topic suggests this allows a player to recover the skin from the dead body. On death, it activates the script which then checks for the players model and adds the clothing parcel associated with it to the inventory, assuming the player has space. If he doesn't, it will then add the item to the players backpack. 

 

There is an install read me in the .zip file, if anyone has any questions feel free to ask and I will do my best to help you. 

 

download here 

I add all files, for dead players skin on inventory, but ai dont have skins. I add files to DZAI , DZMS but cant make it work

Link to comment
Share on other sites

I add all files, for dead players skin on inventory, but ai dont have skins. I add files to DZAI , DZMS but cant make it work

those files aren't meant to be drag and drop replace, you're supposed to use them as an example to edit your existing files. 

Link to comment
Share on other sites

what version of dzai when i compare your ai_death.sqf to mine I am using version 2.1.0 the code in them is ordered differently

Old old old version. I havn't updated in months. All you have to do is place the code in there really. It shouldn't matter where you place it, so long as it isn't nested.

Link to comment
Share on other sites

those files aren't meant to be drag and drop replace, you're supposed to use them as an example to edit your existing files. 

I add script to WAI ai_killed.sqf and its working:

private ["_unit","_player","_humanity","_banditkills"];
_unit = _this select 0;
_player = _this select 1;
_type = _this select 2;

switch (_type) do {
	case "ground" : {ai_ground_units = (ai_ground_units -1);};
	case "air" : {ai_air_units = (ai_air_units -1);};
	case "vehicle" : {ai_vehicle_units = (ai_vehicle_units -1);};
	case "static" : {ai_emplacement_units = (ai_emplacement_units -1);};
};

_unit setVariable ["killedat", time];
if (isPlayer _player) then {
	private ["_banditkills","_humanity"];
	_humanity = _player getVariable["humanity",0];
	_banditkills = _player getVariable["banditKills",0];
	if (ai_humanity_gain) then {
		_player setVariable ["humanity",(_humanity + ai_add_humanity),true];
	};
	if (ai_banditkills_gain) then {
		_player setVariable ["banditKills",(_banditkills + 1),true];
	};
	
//Script addition to add skin to units gear
_skin = (typeOf _unit);
_skin = "Skin_" + _skin;
_okSkin = isClass (configFile >> "CfgMagazines" >> _skin);

if (_okSkin) then {

 _result = [_unit,_skin] call BIS_fnc_invAdd;
	if (_result) then {

	} else {
		
		_bp = unitBackpack _unit;
		_bp addMagazineCargoGlobal [_skin,1];
		
	};
};
//Script end	
	
	if (ai_clear_body) then {
		{_unit removeMagazine _x;} forEach (magazines _unit);
		{_unit removeWeapon _x;} forEach (weapons _unit);
	};
	if (ai_ahare_info) then {
		{if (((position _x) distance (position _unit)) <= ai_share_distance) then {_x reveal [_player, 4.0];}} forEach allUnits;
	};
};

For DZMS DZMSAIKilled.sqf not working: 

/*
	DZMSAIKilled.sqf by Vampire
	This function is called when an AI Unit is killed.
	It handles the humanity allocation and body cleanup.
*/

private ["_unit","_player","_humanity","_banditkills"];
_unit = _this select 0;
_player = _this select 1;

//If the killer is a player, lets handle the humanity

if (isPlayer _player) then {
	private ["_banditkills","_humanity"];
	
	//diag_log text format ["[DZMS]: Debug: Unit killed by %1 at %2", _player, mapGridPosition _unit];
	
	//Lets grab some info
	_humanity = _player getVariable ["humanity",0];
	_banditkills = _player getVariable ["banditKills",0];
	
	//If the player gets humanity per config, lets give it
	if (DZMSMissHumanity) then {
		_player setVariable ["humanity",(_humanity + DZMSCntHumanity),true];
	};
	
	//If this counts as a bandit kill, lets give it
	if (DZMSCntBanditKls) then {
		_player setVariable ["banditKills",(_banditkills + 1),true];
	};
	
	//Lets inform the nearby AI of roughly the players position
	//This makes the AI turn and react instead of laying around
	{
		if (((position _x) distance (position _unit)) <= 300) then {
			_x reveal [_player, 4.0];
		}
	} forEach allUnits;
	
} else {

	diag_log text format ["[DZMS]: Debug: Unit killed by %1 at %2", _player, mapGridPosition _unit];

	if (DZMSRunGear) then {
		//Since a player ran them over, or they died from unknown causes
		//Lets strip their gear
		removeBackpack _unit;
		removeAllWeapons _unit;
		{
			_unit removeMagazine _x
		} forEach magazines _unit;
	};
	
};

//Script addition to add skin to units gear
_skin = (typeOf _unit);
_skin = "Skin_" + _skin;
_okSkin = isClass (configFile >> "CfgMagazines" >> _skin);

if (_okSkin) then {

 _result = [_unit,_skin] call BIS_fnc_invAdd;
	if (_result) then {

	} else {
		
		_bp = unitBackpack _unit;
		_bp addMagazineCargoGlobal [_skin,1];
		
	};
};
//Script end

if (DZMSCleanDeath) then {
	_unit call DZMSPurgeObject;
	if (DZMSCleanDeath) exitWith {};
};

if (DZMSUseNVG) then {
	_unit removeWeapon "NVGoggles";
};

if (DZMSUseRPG AND ("RPG7V" in (weapons _unit))) then {
	_unit removeWeapon "RPG7V";
	_unit removeMagazines "PG7V";
};

//Dead body timer and cleanup
[DZMSBodyTime,10] call DZMSSleep;
_unit call DZMSPurgeObject;

For DZAI ai_death.sqf not working:

/*
		DZAI_unitDeath
		
		Description: Called when AI unit blood level drops below zero to process unit death.
		
        Usage: [_unit,_killer] call DZAI_unitDeath;
		
		Last updated: 7:09 PM 12/15/2013
*/

private["_victim","_killer","_unitGroup","_unitType","_launchWeapon","_deathType"];
_victim = _this select 0;
_killer = _this select 1;
_deathType = if ((count _this) > 2) then {_this select 2} else {"bled"};

if ((isPlayer _killer) && {(_deathType == "shothead")}) then {
	_nul = _killer spawn {
		_headshots = _this getVariable["headShots",0];
		_headshots = _headshots + 1;
		_this setVariable["headShots",_headshots,true];
	};
};

if (_victim getVariable ["deathhandled",false]) exitWith {};
_victim setVariable ["deathhandled",true];
_victim setDamage 1;
_victim removeAllEventHandlers "HandleDamage";

_unitGroup = (group _victim);
_unitType = _unitGroup getVariable ["unitType","unknown"];
switch (_unitType) do {
	case "static":
	{
		[_victim,_killer,_unitGroup] spawn DZAI_AI_killed_static;
	};
	case "dynamic":
	{
		[_victim,_killer,_unitGroup] spawn DZAI_AI_killed_dynamic;
	};
	case "air": 
	{
	};
	case "land":
	{
	};
	case default {
		if (!isNil "DZAI_debugMarkers") then {
			if (({alive _x} count (units _unitGroup)) == 0) then {
				{
					deleteMarker (str _x);
				} forEach (waypoints _unitGroup);
			};
		};
	};
};

if (_unitType in ["static","dynamic","unknown"]) then {
	0 = [_victim,_killer,_unitGroup] call DZAI_AI_killed_all;
};

if ((_victim getVariable ["removeNVG",0]) == 1) then {
	_victim removeWeapon "NVGoggles";
};

_launchWeapon = (secondaryWeapon _victim);
if (_launchWeapon in DZAI_launcherTypes) then {
	_launchAmmo = getArray (configFile >> "CfgWeapons" >> _launchWeapon >> "magazines") select 0;
	_victim removeMagazines _launchAmmo;
	_victim removeWeapon _launchWeapon;
};

//Script addition to add skin to units gear
_skin = (typeOf _unit);
_skin = "Skin_" + _skin;
_okSkin = isClass (configFile >> "CfgMagazines" >> _skin);

if (_okSkin) then {

 _result = [_unit,_skin] call BIS_fnc_invAdd;
	if (_result) then {

	} else {
		
		_bp = unitBackpack _unit;
		_bp addMagazineCargoGlobal [_skin,1];
		
	};
};

_victim spawn DZAI_deathFlies;
_victim setVariable ["bodyName",_victim getVariable ["bodyName","unknown"],true];		//Broadcast the unit's name (was previously a private variable).
_victim setVariable ["deathType",_deathType,true];
_victim setVariable ["DZAI_deathTime",(time + DZAI_cleanupDelay)];
_victim setVariable ["unconscious",true];

//diag_log format ["DEBUG :: AI %1 (Group %2) killed by %3",_victim,_unitGroup,_killer];

_victim

Link to comment
Share on other sites

 

I add script to WAI ai_killed.sqf and its working:

private ["_unit","_player","_humanity","_banditkills"];
_unit = _this select 0;
_player = _this select 1;
_type = _this select 2;

switch (_type) do {
	case "ground" : {ai_ground_units = (ai_ground_units -1);};
	case "air" : {ai_air_units = (ai_air_units -1);};
	case "vehicle" : {ai_vehicle_units = (ai_vehicle_units -1);};
	case "static" : {ai_emplacement_units = (ai_emplacement_units -1);};
};

_unit setVariable ["killedat", time];
if (isPlayer _player) then {
	private ["_banditkills","_humanity"];
	_humanity = _player getVariable["humanity",0];
	_banditkills = _player getVariable["banditKills",0];
	if (ai_humanity_gain) then {
		_player setVariable ["humanity",(_humanity + ai_add_humanity),true];
	};
	if (ai_banditkills_gain) then {
		_player setVariable ["banditKills",(_banditkills + 1),true];
	};
	
//Script addition to add skin to units gear
_skin = (typeOf _unit);
_skin = "Skin_" + _skin;
_okSkin = isClass (configFile >> "CfgMagazines" >> _skin);

if (_okSkin) then {

 _result = [_unit,_skin] call BIS_fnc_invAdd;
	if (_result) then {

	} else {
		
		_bp = unitBackpack _unit;
		_bp addMagazineCargoGlobal [_skin,1];
		
	};
};
//Script end	
	
	if (ai_clear_body) then {
		{_unit removeMagazine _x;} forEach (magazines _unit);
		{_unit removeWeapon _x;} forEach (weapons _unit);
	};
	if (ai_ahare_info) then {
		{if (((position _x) distance (position _unit)) <= ai_share_distance) then {_x reveal [_player, 4.0];}} forEach allUnits;
	};
};

For DZMS DZMSAIKilled.sqf not working: 

/*
	DZMSAIKilled.sqf by Vampire
	This function is called when an AI Unit is killed.
	It handles the humanity allocation and body cleanup.
*/

private ["_unit","_player","_humanity","_banditkills"];
_unit = _this select 0;
_player = _this select 1;

//If the killer is a player, lets handle the humanity

if (isPlayer _player) then {
	private ["_banditkills","_humanity"];
	
	//diag_log text format ["[DZMS]: Debug: Unit killed by %1 at %2", _player, mapGridPosition _unit];
	
	//Lets grab some info
	_humanity = _player getVariable ["humanity",0];
	_banditkills = _player getVariable ["banditKills",0];
	
	//If the player gets humanity per config, lets give it
	if (DZMSMissHumanity) then {
		_player setVariable ["humanity",(_humanity + DZMSCntHumanity),true];
	};
	
	//If this counts as a bandit kill, lets give it
	if (DZMSCntBanditKls) then {
		_player setVariable ["banditKills",(_banditkills + 1),true];
	};
	
	//Lets inform the nearby AI of roughly the players position
	//This makes the AI turn and react instead of laying around
	{
		if (((position _x) distance (position _unit)) <= 300) then {
			_x reveal [_player, 4.0];
		}
	} forEach allUnits;
	
} else {

	diag_log text format ["[DZMS]: Debug: Unit killed by %1 at %2", _player, mapGridPosition _unit];

	if (DZMSRunGear) then {
		//Since a player ran them over, or they died from unknown causes
		//Lets strip their gear
		removeBackpack _unit;
		removeAllWeapons _unit;
		{
			_unit removeMagazine _x
		} forEach magazines _unit;
	};
	
};

//Script addition to add skin to units gear
_skin = (typeOf _unit);
_skin = "Skin_" + _skin;
_okSkin = isClass (configFile >> "CfgMagazines" >> _skin);

if (_okSkin) then {

 _result = [_unit,_skin] call BIS_fnc_invAdd;
	if (_result) then {

	} else {
		
		_bp = unitBackpack _unit;
		_bp addMagazineCargoGlobal [_skin,1];
		
	};
};
//Script end

if (DZMSCleanDeath) then {
	_unit call DZMSPurgeObject;
	if (DZMSCleanDeath) exitWith {};
};

if (DZMSUseNVG) then {
	_unit removeWeapon "NVGoggles";
};

if (DZMSUseRPG AND ("RPG7V" in (weapons _unit))) then {
	_unit removeWeapon "RPG7V";
	_unit removeMagazines "PG7V";
};

//Dead body timer and cleanup
[DZMSBodyTime,10] call DZMSSleep;
_unit call DZMSPurgeObject;

For DZAI ai_death.sqf not working:

/*
		DZAI_unitDeath
		
		Description: Called when AI unit blood level drops below zero to process unit death.
		
        Usage: [_unit,_killer] call DZAI_unitDeath;
		
		Last updated: 7:09 PM 12/15/2013
*/

private["_victim","_killer","_unitGroup","_unitType","_launchWeapon","_deathType"];
_victim = _this select 0;
_killer = _this select 1;
_deathType = if ((count _this) > 2) then {_this select 2} else {"bled"};

if ((isPlayer _killer) && {(_deathType == "shothead")}) then {
	_nul = _killer spawn {
		_headshots = _this getVariable["headShots",0];
		_headshots = _headshots + 1;
		_this setVariable["headShots",_headshots,true];
	};
};

if (_victim getVariable ["deathhandled",false]) exitWith {};
_victim setVariable ["deathhandled",true];
_victim setDamage 1;
_victim removeAllEventHandlers "HandleDamage";

_unitGroup = (group _victim);
_unitType = _unitGroup getVariable ["unitType","unknown"];
switch (_unitType) do {
	case "static":
	{
		[_victim,_killer,_unitGroup] spawn DZAI_AI_killed_static;
	};
	case "dynamic":
	{
		[_victim,_killer,_unitGroup] spawn DZAI_AI_killed_dynamic;
	};
	case "air": 
	{
	};
	case "land":
	{
	};
	case default {
		if (!isNil "DZAI_debugMarkers") then {
			if (({alive _x} count (units _unitGroup)) == 0) then {
				{
					deleteMarker (str _x);
				} forEach (waypoints _unitGroup);
			};
		};
	};
};

if (_unitType in ["static","dynamic","unknown"]) then {
	0 = [_victim,_killer,_unitGroup] call DZAI_AI_killed_all;
};

if ((_victim getVariable ["removeNVG",0]) == 1) then {
	_victim removeWeapon "NVGoggles";
};

_launchWeapon = (secondaryWeapon _victim);
if (_launchWeapon in DZAI_launcherTypes) then {
	_launchAmmo = getArray (configFile >> "CfgWeapons" >> _launchWeapon >> "magazines") select 0;
	_victim removeMagazines _launchAmmo;
	_victim removeWeapon _launchWeapon;
};

//Script addition to add skin to units gear
_skin = (typeOf _unit);
_skin = "Skin_" + _skin;
_okSkin = isClass (configFile >> "CfgMagazines" >> _skin);

if (_okSkin) then {

 _result = [_unit,_skin] call BIS_fnc_invAdd;
	if (_result) then {

	} else {
		
		_bp = unitBackpack _unit;
		_bp addMagazineCargoGlobal [_skin,1];
		
	};
};

_victim spawn DZAI_deathFlies;
_victim setVariable ["bodyName",_victim getVariable ["bodyName","unknown"],true];		//Broadcast the unit's name (was previously a private variable).
_victim setVariable ["deathType",_deathType,true];
_victim setVariable ["DZAI_deathTime",(time + DZAI_cleanupDelay)];
_victim setVariable ["unconscious",true];

//diag_log format ["DEBUG :: AI %1 (Group %2) killed by %3",_victim,_unitGroup,_killer];

_victim

for DZMS move the code to just underneath where it defines _unit (near the top) and for DZAI find all mentions of _unit and change them to _victim

Link to comment
Share on other sites

Working now, thanks!!!

I add skins for AI in config:

"Soldier_TL_PMC_DZ",
	"Soldier1_DZ",
	"Sniper1_DZ",
	"Rocket_DZ",
	"Camo1_DZ",
	"Bodyguard_AA12_PMC_DZ",
	"Graves_Light_DZ",
	"CZ_Soldier_Sniper_EP1_DZ",
	"FR_Rodriguez_DZ",
	"FR_OHara_DZ",
	"Soldier_Sniper_PMC_DZ",
	"Drake_Light_DZ",
	"Special_Forces_GL_DES_EP1_DZ",
	"SurvivorW3_DZ",
	"Rocker4_DZ",
	"Pilot_EP1_DZ",
	"RU_Policeman_DZ",
	"Rocker3_DZ",
	"Rocker1_DZ",
	"Survivor2_DZ",
	"SurvivorWdesert_DZ",
	"SurvivorWcombat_DZ",
	"SurvivorWurban_DZ",
	"SurvivorWpink_DZ",
	"Priest_DZ",
	"Haris_Press_EP1_DZ",
	"Functionary1_EP1_DZ",
	"SurvivorW2_DZ",
	"Rocker2_DZ",
	"Bandit1_DZ",
	"Bandit2_DZ",
	"BanditW1_DZ",
	"BanditW2_DZ",
	"GUE_Commander_DZ",
	"GUE_Soldier_2_DZ",
	"GUE_Soldier_CO_DZ",
	"GUE_Soldier_Crew_DZ",
	"GUE_Soldier_Sniper_DZ",
	"Ins_Soldier_GL_DZ",
	"INS_Soldier_EP1_DZ",
	"TK_INS_Warlord_EP1_DZ"

b_560_95_1.png

Link to comment
Share on other sites

  • 5 weeks later...
I cant for the life of me get DZMS to work. I could loot players no problem.. but ai.. no bueno.
 
/*
DZMSAIKilled.sqf by Vampire
This function is called when an AI Unit is killed.
It handles the humanity allocation and body cleanup.
*/
 
private ["_unit","_player","_humanity","_banditkills","_skin","_bp","_okSkin","_result","_pos"];
_unit = _this select 0;
_player = _this select 1;
 
//Script addition to add skin to units gear
_skin = (typeOf _unit);
_skin = "Skin_" + _skin;
_okSkin = isClass (configFile >> "CfgMagazines" >> _skin);
 
if (_okSkin) then {
 
 _result = [_unit,_skin] call BIS_fnc_invAdd;
if (_result) then {
 
} else {
 
_bp = unitBackpack _unit;
_bp addMagazineCargoGlobal [_skin,1];
 
};
};
//Script end
//If the killer is a player, lets handle the humanity
 
if (isPlayer _player) then {
private ["_banditkills","_humanity"];
 
//diag_log text format ["[DZMS]: Debug: Unit killed by %1 at %2", _player, mapGridPosition _unit];
 
//Lets grab some info
_humanity = _player getVariable ["humanity",0];
_banditkills = _player getVariable ["banditKills",0];
 
//If the player gets humanity per config, lets give it
if (DZMSMissHumanity) then {
_player setVariable ["humanity",(_humanity + DZMSCntHumanity),true];
};
 
//If this counts as a bandit kill, lets give it
if (DZMSCntBanditKls) then {
_player setVariable ["banditKills",(_banditkills + 1),true];
};
 
//Lets inform the nearby AI of roughly the players position
//This makes the AI turn and react instead of laying around
{
if (((position _x) distance (position _unit)) <= 800) then {
_x reveal [_player, 4.0];
}
} forEach allUnits;
 
} else {
 
//diag_log text format ["[DZMS]: Debug: Unit killed by %1 at %2", _player, mapGridPosition _unit];
 
if (DZMSRunGear) then {
//Since a player ran them over, or they died from unknown causes
//Lets strip their gear
removeAllWeapons _unit;
{
_unit removeMagazine _x
} forEach magazines _unit;
};
 
};
 
if (DZMSCleanDeath) then {
_unit call DZMSPurgeObject;
if (DZMSCleanDeath) exitWith {};
};
 
if (DZMSUseNVG) then {
_unit removeWeapon "NVGoggles";
};
 
if (DZMSUseRPG AND ("M136" in (weapons _unit))) then {
_unit removeWeapon "M136";
_unit removeMagazines "M136";
};
 
//Dead body timer and cleanup
[DZMSBodyTime,10] call DZMSSleep;
_unit call DZMSPurgeObject;
Link to comment
Share on other sites

 

I cant for the life of me get DZMS to work. I could loot players no problem.. but ai.. no bueno.
 
/*
DZMSAIKilled.sqf by Vampire
This function is called when an AI Unit is killed.
It handles the humanity allocation and body cleanup.
*/
 
private ["_unit","_player","_humanity","_banditkills","_skin","_bp","_okSkin","_result","_pos"];
_unit = _this select 0;
_player = _this select 1;
 
//Script addition to add skin to units gear
_skin = (typeOf _unit);
_skin = "Skin_" + _skin;
_okSkin = isClass (configFile >> "CfgMagazines" >> _skin);
 
if (_okSkin) then {
 
 _result = [_unit,_skin] call BIS_fnc_invAdd;
if (_result) then {
 
} else {
 
_bp = unitBackpack _unit;
_bp addMagazineCargoGlobal [_skin,1];
 
};
};
//Script end
//If the killer is a player, lets handle the humanity
 
if (isPlayer _player) then {
private ["_banditkills","_humanity"];
 
//diag_log text format ["[DZMS]: Debug: Unit killed by %1 at %2", _player, mapGridPosition _unit];
 
//Lets grab some info
_humanity = _player getVariable ["humanity",0];
_banditkills = _player getVariable ["banditKills",0];
 
//If the player gets humanity per config, lets give it
if (DZMSMissHumanity) then {
_player setVariable ["humanity",(_humanity + DZMSCntHumanity),true];
};
 
//If this counts as a bandit kill, lets give it
if (DZMSCntBanditKls) then {
_player setVariable ["banditKills",(_banditkills + 1),true];
};
 
//Lets inform the nearby AI of roughly the players position
//This makes the AI turn and react instead of laying around
{
if (((position _x) distance (position _unit)) <= 800) then {
_x reveal [_player, 4.0];
}
} forEach allUnits;
 
} else {
 
//diag_log text format ["[DZMS]: Debug: Unit killed by %1 at %2", _player, mapGridPosition _unit];
 
if (DZMSRunGear) then {
//Since a player ran them over, or they died from unknown causes
//Lets strip their gear
removeAllWeapons _unit;
{
_unit removeMagazine _x
} forEach magazines _unit;
};
 
};
 
if (DZMSCleanDeath) then {
_unit call DZMSPurgeObject;
if (DZMSCleanDeath) exitWith {};
};
 
if (DZMSUseNVG) then {
_unit removeWeapon "NVGoggles";
};
 
if (DZMSUseRPG AND ("M136" in (weapons _unit))) then {
_unit removeWeapon "M136";
_unit removeMagazines "M136";
};
 
//Dead body timer and cleanup
[DZMSBodyTime,10] call DZMSSleep;
_unit call DZMSPurgeObject;

 

Check your .rpt's and start your server with -ShowScriptErrors . What i've noticed (as well as others) is that this script is finicky as hell and is extremely dependent on where you place it, some people have trouble with it and have to move it around, other people have no trouble at all

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
×
×
  • Create New...