DangerRuss
OpenDayZ Rockstar!
Curious if this is possible. Id like to make it so players gained a ltitle humanity from killing bandits. Ive looked in a few places in my server files and in my client side dayz code but Im not seeing anything.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Yes it is, take a look at player_death.sqf that's where its done, the player dying is the one who changes their killers humanity "_source" is the unit who killed them
_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];
};
Could you please lend me a hand? Am I looking at this block of code in the 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]; };
How would I edit this so killing a bandit would increase humanity? I can see where it determines if you are a bandit humanity <= -2000, and I can see there is no punishment for killing a bandit.. but how could I change the actual humanity gained or lost. Also, what exactly is canHitFree and "freeTarget?" Thanks for any help in advance my friend.
_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";
if ((player getVariable["humanity",0]) <= -2000) then {
_victimisBandit = true;
}
else {
if ((player getVariable["humanity",0]) >= 5000) then {
_victimisHero = true;
}
else {
_victimisSurvivor = true;
};
};
if ((_source getVariable["humanity",0]) <= -2000) then {
_killerisBandit = true;
}
else {
if ((_source getVariable["humanity",0]) >= 5000) then {
_killerisHero = true;
}
else {
_killerisSurvivor= true;
};
};