Jump to content
  • 0

Sorting out humanity


Shawn

Question

So I am currently trying to get humanity working well as there are many humanity boosting methods open, but I cannot figure what to do from here. This is what I've worked up to so far. If anyone could direct me in the correct direction, it would be appreciated.

_HFKiller = _this select 0;
_HFVictim = _this select 1;

if (!alive _HFKiller) exitWith {};

_humanityK = _HFKiller getVariable ["humanity",0];
_humanityV = _HFVictim getVariable ["humanity",0];



switch true do {
    case ((_humanityK > 5000) AND (_humanityV > 5000)): {
		_HFKiller setVariable ["humanity",(_humanityK - 200),true];
		}; // hero vs hero
		
    case ((_humanityK < -5000) AND (_humanityV > 5000)): {
		_HFKiller setVariable ["humanity",(_humanityK - 200),true];
		}; // bandit vs hero
		
    case ((_humanityK > 5000) AND (_humanityV < -5000)): {
		_HFKiller setVariable ["humanity",(_humanityK + 200),true];
		}; // hero vs bandit
		
    case ((_humanityK < -5000) AND (_humanityV < -5000)): {
		_HFKiller setVariable ["humanity",(_humanityK + 200),true];
		}; // bandit vs bandit
		
    case ((_humanityK > -5000) AND(_humanityK < 5000) AND (_humanityV > 5000)): {
		_HFKiller setVariable ["humanity",(_humanityK + 200),true];
		}; // civilian vs hero
		
    case ((_humanityK > -5000) AND(_humanityV < 5000) AND (_humanityV < -5000)): {
		_HFKiller setVariable ["humanity",(_humanityK + 200),true];
		}; // civilian vs bandit
		
    case ((_humanityV > -5000) AND(_humanityV < 5000) AND (_humanityK > 5000)): {
		_HFKiller setVariable ["humanity",(_humanityK - 200),true];
		}; // hero vs civilian
		
    case ((_humanityV > -5000) AND(_humanityV < 5000) AND (_humanityK < -5000)): {
		_HFKiller setVariable ["humanity",(_humanityK - 200),true];
		}; // bandit vs civilian
		
    case ((_humanityV > -5000) AND(_humanityV < 5000) AND (_humanityK > -5000) AND (_humanityK < 5000)): {
		_HFKiller setVariable ["humanity",(_humanityK - 200),true];
		}; // civilian vs civilian
    default (true);
};

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

hey shawn.. im usin it to change humanity... maybe u can use too,,
 see lines in blue

Spoiler

private ["_playerPos","_nearmiss2","_item","_LastUsedTime","_Time"];

call gear_ui_init;
_playerPos = getPosATL player;
_nearmiss2 = count nearestObjects [_playerPos, ["Land_IED_v1_PMC"], 5] > 0;
_LastUsedTime = 800;
_Time = time - lastuse;
_item = "ItemBloodbag" in magazines player;

 

if(_Time < _LastUsedTime) exitWith {
    cutText [format["espera %1 segundos !",(round(_Time - _LastUsedTime))], "PLAIN DOWN"];
};

if !(_item) exitWith {
cutText [format["Necesitas una bloodbag para ayudar a esta persona."], "PLAIN DOWN"];
};

if (_nearmiss2 && _item) then {
    lastuse = time;
    sleep 1;
    player playActionNow "Medic";    
    sleep 3;
    player removeMagazine "ItemBloodbag";
    cutText [format["Curaste a esta persona"], "PLAIN DOWN"];
    
    [player,500] call player_humanityChange;
    };

 

Link to comment
Share on other sites

  • 0

Yeah, seelenapparat is correct. I think humanity is given based on damage handled, because if you continue to spray someone in the head with a gun, it will give you about -20k humanity. This is massively abused, especially when load outs on my server are unlocked with higher/lower humanity. I want it to give a set amount, say -200 or +200 depending on if they are a hero or not.

Any ideas? 

Link to comment
Share on other sites

  • 0

as I wrote, you should check out the file:

player_death.sqf

especially this part:

Spoiler

_array = _this;
if (count _array > 0) then {
    _source = _array select 0;
    _method = _array select 1;
    if ((!isNull _source) && (_source != player)) then {
        _canHitFree = player getVariable ["freeTarget",false];
        _isBandit = (player getVariable["humanity",0]) <= -2000;
        _punishment = _canHitFree || _isBandit; //if u are bandit || start first - player will not recieve humanity drop
        _humanityHit = 0;
        if (!_punishment) then {
            //i'm "not guilty" - kill me && be punished
            _myKills = ((player getVariable ["humanKills",0]) / 30) * 1000;
            _humanityHit = -(2000 - _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
            _killsV = _source getVariable ["banditKills",0];
            _source setVariable ["banditKills",(_killsV + 1),true];
        };
    };
    _body setVariable ["deathType",_method,true];
};

 

 

Im not sure, if this is everything though.

Link to comment
Share on other sites

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

×
×
  • Create New...