fn_crAddAceAction

This commit is contained in:
Wyqer 2019-12-05 16:35:33 +01:00
parent 92dafe05b9
commit 557b5fa8d8
No known key found for this signature in database
GPG Key ID: D7E2F8BD7F1E48FA
1 changed files with 31 additions and 25 deletions

View File

@ -2,43 +2,49 @@
File: fn_crAddAceAction.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-12-03
Last Update: 2019-12-03
Last Update: 2019-12-04
License: MIT License - http://www.opensource.org/licenses/MIT
Description:
No description added yet.
Adds action for healing with ACE field dressing to a given object.
Parameter(s):
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
_civ - Civilian to add the healing action to [OBJECT, defaults to objNull]
Returns:
Function reached the end [BOOL]
*/
// TODO
params ["_civ"];
params [
["_civ", objNull, [objNull]]
];
if (isNull _civ) exitWith {["Null object given"] call BIS_fnc_error; false};
if (KP_liberation_civrep_debug > 0) then {private _text = format ["[KP LIBERATION] [CIVREP] ace_action called on: %1", debug_source];_text remoteExec ["diag_log",2];};
_civ addAction [
"<t color='#FF0000'>" + localize "STR_CR_ACE_ACTION" + "</t>",
{
private _target = _this select 0;
private _caller = _this select 1;
"<t color='#FF0000'>" + localize "STR_CR_ACE_ACTION" + "</t>",
{
private _target = _this select 0;
private _caller = _this select 1;
if ("ACE_fieldDressing" in (vestItems player + uniformItems player + backpackItems player + assignedItems player)) then {
_caller removeItem "ACE_fieldDressing";
_target setDamage 0;
} else {
hint localize "STR_CR_ACE_ACTION_FAIL";
sleep 3;
hint "";
};
},
nil,
1.5,
true,
true,
"",
"(damage _target) >= 0.5",
3
if ("ACE_fieldDressing" in (vestItems player + uniformItems player + backpackItems player)) then {
_caller removeItem "ACE_fieldDressing";
_target setDamage 0;
} else {
hint localize "STR_CR_ACE_ACTION_FAIL";
sleep 3;
hintSilent "";
};
},
nil,
1.5,
true,
true,
"",
"(damage _target) >= 0.5",
3
];
true