Jump to content
Sign in to follow this  
Cota

Combat medic

Recommended Posts

How to make only the doctor fully heal a player?

I know CMS has this option, but my group does not use this mod in our missions. Necessary that each player can heal only partially and that the medic do a complete cure.

Share this post


Link to post
Share on other sites

If your using an addAction type of medic system:

_target = (_this select 0);
_caller = (_this select 1);

if ((_target damage > 0) && (typeOf _caller == "B_Medic_F")) then { _target setDamage 0;} else { 

if ((_target damage > 0) && !(typeOf _caller == "B_Medic_F")) then { _target setDamage 0.5; };

};

Edited by JShock

Share this post


Link to post
Share on other sites
If your using an addAction type of medic system:

if ((_target damage > 0) && !(typeOf _caller == "B_Medic_F")) then { _target setDamage 5; };

What's that? :P That might actually just hurt the player more than healing him. I'd probably use something like this for a non-medic:

if ((damage _target > 0) && !(typeOf _caller == "B_Medic_F")) then 
{
_caller playMoveNow "AinvPknlMstpSnonWrflDnon_medic0"; 
sleep 5;
_target setDamage (getDamage _target / 2);
};

Tweak as you like. I don't know if you had animations etc added so I just added one in, although it's probably unusable by now (from ArmA2 after all) so you can probably throw that out.

Share this post


Link to post
Share on other sites
What's that? :P That might actually just hurt the player more than healing him.

Wow....I was thinking 0.5 in my head.....long day I tell you...

Share this post


Link to post
Share on other sites

Would this same script work for a vehicle repair, say if I have a carpenter he could repair a boat fully while ordinary players could only fix it part way?

Share this post


Link to post
Share on other sites

Yes, as setDamage also works on vehicles. You'll ofc have to edit the typeOf check to be the unit you want (generally though I'd just not recommend a typeOf check if you want to use the same script for multiple sides)

Share this post


Link to post
Share on other sites

where do I put this? I need each player to heal partially, but complete healing is done by the doctor

What's that? :P That might actually just hurt the player more than healing him. I'd probably use something like this for a non-medic:

if ((damage _target > 0) && !(typeOf _caller == "B_Medic_F")) then 
{
_caller playMoveNow "AinvPknlMstpSnonWrflDnon_medic0"; 
sleep 5;
_target setDamage (getDamage _target / 2);
};

Tweak as you like. I don't know if you had animations etc added so I just added one in, although it's probably unusable by now (from ArmA2 after all) so you can probably throw that out.

Share this post


Link to post
Share on other sites

You will put that code into an sqf, let's name it medic.sqf for sake of, and then you will use an addAction that you give to every player:

addAction in the init.sqf:

{
if (isPlayer _x) then {
_x addAction ["Treat Player", "medic.sqf", [], 5, true, true, "", "damage (_this select 0)>0; && alive (_this select 0);"];
};

medic.sqf

_target = (_this select 0);
_caller = (_this select 1);


if (typeOf _caller == "B_Medic_F") then 
{
_caller playMoveNow "AinvPknlMstpSnonWrflDnon_medic0"; 
sleep 5;
_target setDamage 0;
};  

if !(typeOf _caller == "B_Medic_F") then 
{
_caller playMoveNow "AinvPknlMstpSnonWrflDnon_medic0"; 
sleep 5;
_target setDamage (getDamage _target / 2);
};

Edited by JShock

Share this post


Link to post
Share on other sites
The trick is finding a way to disable the built-in system

You mean the built-in engineer system?

Share this post


Link to post
Share on other sites

This script forces the use of the medkit ?

Share this post


Link to post
Share on other sites
This script forces the use of the medkit ?

This forces the player to be a medic to heal the other players fully, and if you aren't a medic then you can only heal that person up to halfway better than they were.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×