Jump to content
  • 0

[HELP] Change amount of humanity per kill


HellWalker

Question

Hey guys,

I'm working on a Epoch Origins server and since the houses need humanity to be built, i was trying to change the amount of humanity each player gain/loss based on the person he kill.

The problem is: I'm not able to make it based on the other player's humanity, it's based on the guilty.

 

If i just shot a player, it doesn't matter if it's a bandit, survivor or hero, my humanity will decrease.

The same works if i kill a player who shot me first, he is guiliy, so i'm going to gain humanity.

 

I tried to modify my player_death.sqf (trought a custom compile and custom folder, of course).. I did change the amount of humanity, instead of losing/gaining 2.000 i'm gaining/loosing 150/250.

 

This is the script i have so far: player_death.sqf

if ((!isNull _source) && (_source != player)) then {

	_canHitFree = player getVariable ["freeTarget",false];
	_isBandit = (player getVariable["humanity",0]) <= 0;
	_punishment = _canHitFree || _isBandit; //if u are bandit || start first - player will not recieve humanity drop
	_humanityHit = 0;


	if ((player getVariable["humanity",0]) <= 0) then {
		_victimisBandit = true;
	}
	else {
		if ((player getVariable["humanity",0]) >= 1500) then {
			_victimisHero = true;
		}
		else {
			_victimisSurvivor = true;
		};
	};

	if ((_source getVariable["humanity",0]) <= 0) then {
		_killerisBandit = true;
	}
	else {
		if ((_source getVariable["humanity",0]) >= 1000) then {
			_killerisHero = true;
		}
		else {
			_killerisSurvivor= true;
		};
	};


	if (!_punishment) then {
		//i'm "not guilty" - kill me && be punished
		_myKills = ((player getVariable ["humanKills",0]) / 30) * 1000;
		_humanityHit = -(150 - _myKills);
		_kills = _source getVariable ["humanKills",0];
		_source setVariable ["humanKills",(_kills + 1),true];
		PVDZE_send = [_source,"Humanity",[_source,_humanityHit,300]];
		publicVariableServer "PVDZE_send";

	} else {
		//i'm "guilty" - kill me as bandit
		_myKills = ((player getVariable ["humanKills",0]) / 30) * 1000;
		_humanityHit = + (300 + _myKills);
		_killsV = _source getVariable ["banditKills",0];
		_source setVariable ["banditKills",(_killsV + 1),true];
		PVDZE_send = [_source,"Humanity",[_source,_humanityHit,300]];
		publicVariableServer "PVDZE_send";
	};
};

I did tried some testing, also i tried something like this:

if ((player getVariable["humanity",0]) <= 0) then {
        _victimisBandit = true;

        _myKills = ((player getVariable ["humanKills",0]) / 30) * 1000;
	_humanityHit = +(150 + _myKills);
	_kills = _source getVariable ["humanKills",0];
	_source setVariable ["humanKills",(_kills + 1),true];
        PVDZE_send = [_source,"Humanity",[_source,_humanityHit,300]];
        publicVariableServer "PVDZE_send";
}
else {
        if ((player getVariable["humanity",0]) >= 1500) then {
               _victimisHero = true;

               _myKills = ((player getVariable ["humanKills",0]) / 30) * 1000;
               _humanityHit = -(150 - _myKills);
               _kills = _source getVariable ["humanKills",0];
               _source setVariable ["humanKills",(_kills + 1),true];
               PVDZE_send = [_source,"Humanity",[_source,_humanityHit,300]];
               publicVariableServer "PVDZE_send";
        }
} 

But with no success..

Can anyone help me?

 

Edit: Also, is there a way to change the default starting humanity? From 2500 to 1000 for example.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...