Jump to content
Deoxyr

Medikit for Civillians and Cops

Recommended Posts

So i am trying to make it so that the Medikit can be used by civillians and cops as well.
Can anyone lead me in the right direction on how to do this? Or show me the location where to set this up?

Thanks!

Share this post


Link to post
Share on other sites

Check your masterHandler.hpp

 

Change these two to 1 to allow cops & civs to revive

 - revive_civ

 - revive_cops

 

code from actionKeyHandler

//Check if it's a dead body.
if (_curObject isKindOf "CAManBase" && {!alive _curObject}) exitWith {
    //Hotfix code by ins0
    if ((playerSide isEqualTo west && {(LIFE_SETTINGS(getNumber,"revive_cops") isEqualTo 1)}) || {(playerSide isEqualTo civilian && {(LIFE_SETTINGS(getNumber,"revive_civ") isEqualTo 1)})} || {(playerSide isEqualTo east && {(LIFE_SETTINGS(getNumber,"revive_east") isEqualTo 1)})} || {playerSide isEqualTo independent}) then {
        if (life_inv_defibrillator > 0) then {
            [_curObject] call life_fnc_revivePlayer;
        };
    };
};

 

  • Like 2

Share this post


Link to post
Share on other sites

@imthatguyhere It didn't sadly. The Medikit allows a medic to recover someone to the fully 100% and i would like the ability of civs and cops use it to recover themselves to 100%.
But cant figure out how to set that up.

Share this post


Link to post
Share on other sites

Oh, you were referring to healing and not reviving. That heal is entirely based on the unit the medics and cops use if I remember correctly. You'd have to make a new addaction to heal the target if you wanted to recreate that for other units iirc.

Share this post


Link to post
Share on other sites

Oh I am sorry. I misunderstood. Try something like this for a change:

 

Straight from Arma 3's wiki page: Wiki

This code will fix unit to 100% health after self-use of medpack:

player addEventHandler ["HandleHeal", {
	_this spawn {
		params ["_injured","_healer"];
		_damage = damage _injured;
		if (_injured == _healer) then {
			waitUntil {damage _injured != _damage};
			if (damage _injured < _damage) then {
				_injured setDamage 0;
			};
		};
	};
}];

 

This only checks for first aid iirc, but it can also check if unit has the MedKit (big one), with a simple line of code.

if ("Medikit" in (items player)) then { ...};

 

Edited by AngryHerring ッ ®™
yes

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...