Jump to content
  • 0

Bandit kill bandit / hero kill hero NO HUMANITY


JakeQue

Question

Hi,

 

I noticed that when a bandit kills a bandit or a hero kills a hero their humanity stays the same. 

I'd like to change this so it obviously has the opposite effect to a player. 

I believe it's to do with the dayz_code.pbo / compiles / player_death.sqf and I think it might be this section but I don't fully understand it

 

Spoiler

if (!local _source && isPlayer _source && !(_body isKindOf "PZombie_VB")) then { //If corpse is a player zombie do not give killer a human or bandit kill
    //Values like humanity which were setVariabled onto player before death remain on corpse.
    _isBandit = (_body getVariable["humanity",0]) <= -2000;
    //_isBandit = (typeOf _body in ["Bandit1_DZ","BanditW1_DZ"]);
    
    //if you are a bandit or start first - player will not recieve humanity drop
    _punishment = (_isBandit or {_body getVariable ["OpenTarget",false]});
    _humanityHit = 0;
    _realSource = effectiveCommander vehicle _source;

    if (!_punishment) then {
        //I'm "not guilty" - kill me and be punished
        _myKills = (_body getVariable ["humanKills",0]) * 33.3;
        // how many non bandit players have I (the dead player) killed?
        // punish my killer 2000 for shooting a surivor
        // but subtract 500 for each survivor I've murdered
        _humanityHit = -(2000 - _myKills);
        _kills = _realSource getVariable ["humanKills",0];
        _realSource setVariable ["humanKills",(_kills + 1),true];
        PVDZ_send = [_realSource,"Humanity",[_humanityHit,300]];
        publicVariableServer "PVDZ_send";
    } else {
        //i'm "guilty" - kill me as bandit
        _killsV = _realSource getVariable ["banditKills",0];
        _realSource setVariable ["banditKills",(_killsV + 1),true];
    };
    
    //Setup for study bodys.
    _body setVariable ["KillingBlow",[_realSource,_punishment],true];
};

disableSerialization;

 

Thanks in advance for the help

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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
  • Advertisement
  • Discord

×
×
  • Create New...