This commit is contained in:
Glowbal 2015-04-29 22:04:46 +02:00
parent 87465b8b10
commit 614a93ef12
4 changed files with 12 additions and 5 deletions

View File

@ -60,8 +60,9 @@ class ACE_Settings {
value = 0; value = 0;
}; };
class GVAR(enableRevive) { class GVAR(enableRevive) {
typeName = "BOOL"; typeName = "SCALAR";
value = 0; value = 0;
values[] = {"Disabled", "Players only", "Players and AI"};
}; };
class GVAR(maxReviveTime) { class GVAR(maxReviveTime) {
typeName = "SCALAR"; typeName = "SCALAR";

View File

@ -238,8 +238,13 @@ class CfgVehicles {
class enableRevive { class enableRevive {
displayName = "Enable Revive"; displayName = "Enable Revive";
description = "Enable a basic revive system"; description = "Enable a basic revive system";
typeName = "BOOL"; typeName = "NUMBER";
defaultValue = 0; defaultValue = 0;
class values {
class disable { name = "Disabled"; value = 0; default = 1;};
class playerOnly { name = "Player only"; value = 1; };
class playerAndAI { name = "Player & AI"; value = 2; };
};
}; };
class maxReviveTime { class maxReviveTime {
displayName = "Max Revive time"; displayName = "Max Revive time";

View File

@ -76,7 +76,7 @@ if (GVAR(level) >= 2) then {
}; };
[_unit] call FUNC(addToInjuredCollection); [_unit] call FUNC(addToInjuredCollection);
if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)])) && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith { if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) > 0) && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith {
if (vehicle _unit != _unit and {damage _vehicle >= 1}) then { if (vehicle _unit != _unit and {damage _vehicle >= 1}) then {
// @todo // @todo
// [_unit] call FUNC(unload); // [_unit] call FUNC(unload);

View File

@ -13,7 +13,7 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_force"]; private ["_unit", "_force", "_reviveVal"];
_unit = _this select 0; _unit = _this select 0;
_force = false; _force = false;
if (count _this >= 2) then { if (count _this >= 2) then {
@ -26,7 +26,8 @@ if (!local _unit) exitwith {
false; false;
}; };
if ((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) && !_force) exitwith { _reviveVal = _unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)];
if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == 2)) && !_force) exitwith {
if (_unit getvariable [QGVAR(inReviveState), false]) exitwith { if (_unit getvariable [QGVAR(inReviveState), false]) exitwith {
if (GVAR(amountOfReviveLives) > 0) then { if (GVAR(amountOfReviveLives) > 0) then {
_lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)]; _lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)];