add function to disable dogtags for factions, and disable for civilians

This commit is contained in:
commy2 2016-10-10 19:35:34 +02:00 committed by Glowbal
parent cd79ebe3ce
commit 130265fd9f
5 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,4 @@
PREP(addDogtagActions);
PREP(addDogtagItem);
PREP(bloodType);
@ -11,3 +12,4 @@ PREP(sendDogtagData);
PREP(showDogtag);
PREP(ssn);
PREP(takeDogtag);
PREP(disableFactionDogtags);

View File

@ -45,3 +45,6 @@ if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
}] call CBA_fnc_addEventHandler;
};
};
// disable dogtags for civilians
"CIV_F" call FUNC(disableFactionDogtags);

View File

@ -20,4 +20,7 @@ params ["_player", "_target"];
if (isNull _target) exitWith {false};
// check if disabled for faction
if ([GVAR(disabledFactions) getVariable faction _target] param [0, false]) exitWith {false};
(!alive _target) || {_target getVariable ["ACE_isUnconscious", false]}

View File

@ -20,4 +20,7 @@ params ["_player", "_target"];
if (isNull _target) exitWith {false};
// check if disabled for faction
if ([GVAR(disabledFactions) getVariable faction _target] param [0, false]) exitWith {false};
(!alive _target) || {_target getVariable ["ACE_isUnconscious", false]}

View File

@ -0,0 +1,24 @@
/*
* Author: commy2
* Disable this faction from using dogtags.
*
* Arguments:
* 0: Faction <STRING>
*
* Return Value:
* None
*
* Example:
* "CIV_F" call ace_dogtags_fnc_disableFactionDogtags
*
* Public: Yes
*/
#include "script_component.hpp"
params [["_faction", "", [""]]];
if (isNil QGVAR(disabledFactions)) then {
GVAR(disabledFactions) = [] call CBA_fnc_createNamespace;
};
GVAR(disabledFactions) setVariable [_faction, true];