Humanity for killing Zed.

HEROTHOR

Member
Hey there, just wondering if this would work. I really need to give something back to to the heroes. Its too hard to be a hero just by bloodbagging. Any help would be greatly appreciated!

USING local_eventKill.sqf.

Will call compile it in the main mission but here is what im thinking.

Code:
//[unit, selectionName, damage, source, projectile]
//will only run when local to the created object
//record any key hits to the required selection
private["_killer"];
 
_array = _this select 0;
_zed = _array select 0;
_killer = _array select 1;
_type = _this select 1;
 
if (local _zed) then {
    _kills = _killer getVariable[_type,0];
    _killer setVariable[_type,(_kills + 1),true];
    _killer setVariable[_type,(_humanity + 10),true]; <----EDIT IS HERE
};
 
Code:
//[unit, selectionName, damage, source, projectile]
//will only run when local to the created object
//record any key hits to the required selection
private ["_zed","_killer","_kills","_array","_type","_humanity"];
 
_array =        _this select 0;
_zed =            _array select 0;
_killer =        _array select 1;
_type =        _this select 1;
 
if (local _zed) then {
    _kills = _killer getVariable[_type,0];
    _killer setVariable[_type,(_kills + 1),true];
 
    //increase players humanity when zed killed
    _humanity = _killer getVariable["humanity",0];
    _humanity = _humanity + 5;
    _killer setVariable["humanity",_humanity,true];
};

All credit goes to the Epoch mod developers.
 
Quick question, Would adding that humanity line to below bandit kills make it so heroes and survivors when t hey kill a bandit they gain humanity? Ideally, I'd like it set up if a bandit kills a bandit they loose humanity, and heroes gain humanity. Any help would be greatly appreciated! ;)

This is player_death.sqf

Code:
_array = _this;
if (count _array > 0) then {
    _source = _array select 0;
    _method = _array select 1;
    if ((!isNull _source) and (_source != player)) then {
        _canHitFree = player getVariable ["freeTarget",false];
        _isBandit = (player getVariable["humanity",0]) <= -2000;
        _punishment = _canHitFree or _isBandit; //if u are bandit or start first - player will not recieve humanity drop
        _humanityHit = 0;
        if (!_punishment) then {
            //i'm "not guilty" - kill me and be punished
            _myKills = ((player getVariable ["humanKills",0]) / 30) * 1000;
            _humanityHit = -(2000 - _myKills);
            _kills = _source getVariable ["humanKills",0];
            _source setVariable ["humanKills",(_kills + 1),true];
            PVDZ_send = [_source,"Humanity",[_source,_humanityHit,300]];
            publicVariableServer "PVDZ_send";
        } else {
            //i'm "guilty" - kill me as bandit
            _killsV = _source getVariable ["banditKills",0];
            _source setVariable ["banditKills",(_killsV + 1),true];
        };
    };
    _body setVariable ["deathType",_method,true];
};
 
Back
Top