This code I is linked to my hero ai script when you kill hero I want it to take the humanity down and count to hero kill stats server side. As you will see I did try _heroekills and _herokills in place of old code _banditkills
script got issue with is my custom DZMSheroKilled.sqf I think it has to do with DZMSCntBanditKls but got no idea where to edit that.
script got issue with is my custom DZMSheroKilled.sqf I think it has to do with DZMSCntBanditKls but got no idea where to edit that.
Code:
//hero Kills script BETA Build edit by Darthmard on http://opendayz.net
private ["_unit","_player","_humanity","_herokills"];
_unit = _this select 0;
_player = _this select 1;
//If the killer is a player, lets handle the humanity
if (isPlayer _player) then {
private ["_herokills","_humanity"];
_humanity = _player getVariable ["humanity",0];
_herokills = _player getVariable ["herokills",0];
//this part should take off humanity so far nothing happens in test i ran
if (DZMSMissHumanity) then {
_player setVariable ["humanity",(_humanity - DZMSCntHumanity),true];
};
//this part should add hero kill to player stats so far nothing happens on test i ran
if (DZMSCntBanditKls) then {
_player setVariable ["herokills",(_herokills + 1),true];
};
{
if (((position _x) distance (position _unit)) <= 300) then {
_x reveal [_player, 4.0];
}
} forEach allUnits;
} else {
if (DZMSRunGear) then {
removeBackpack _unit;
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 ("RPG7V" in (weapons _unit))) then {
_unit removeWeapon "RPG7V";
_unit removeMagazines "PG7V";
};
//Dead body timer and cleanup
[DZMSBodyTime,10] call DZMSSleep;
_unit call DZMSPurgeObject;