-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #800 from ColdEvul/flagsaber
Added ability to add flag to M1A1
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include "..\script_component.hpp"; | ||
/* | ||
* Author: CPL.Brostrom.A | ||
* This function adds a takedown and put up flag action to the given vehicle. | ||
* | ||
* Arguments: | ||
* 0: Vehicle <OBJECT> | ||
* | ||
* Return Value: | ||
* nothing | ||
* | ||
* Example: | ||
* [this] call cScripts_fnc_vehicle_addFlagAction; | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params [["_vehicle", objNull, [objNull]]]; | ||
|
||
if (isNull _vehicle) exitWith {}; | ||
|
||
private _icon = "iconLogic" call FUNC(getIcon); | ||
|
||
private _addCondition = { | ||
params ["_vehicle", "_caller", "_params"]; | ||
!(_vehicle getVariable [QEGVAR(Vehicle,hasFlag), false]) && isTurnedOut _caller; | ||
}; | ||
private _putFlag = [QEGVAR(Actions_Vehicle,PutFlag), "Put up flag", _icon, { | ||
params ["_vehicle", "_caller", "_params"]; | ||
private _flagTexture = "z\cav\addons\flag\data\flag_01_ca.paa"; //"\A3\Data_F\Flags\Flag_red_CO.paa" | ||
_vehicle forceFlagTexture _flagTexture; | ||
_vehicle setVariable [QEGVAR(Vehicle,hasFlag), true]; | ||
|
||
}, _addCondition] call ace_interact_menu_fnc_createAction; | ||
[_vehicle, 1, ["ACE_SelfActions"], _putFlag] call ace_interact_menu_fnc_addActionToObject; | ||
|
||
|
||
private _remCondition = { | ||
params ["_vehicle", "_caller", "_params"]; | ||
_vehicle getVariable [QEGVAR(Vehicle,hasFlag), false] && isTurnedOut _caller; | ||
}; | ||
private _takeFlag = [QEGVAR(Actions_Vehicle,TakeFlag), "Take down flag", _icon, { | ||
params ["_vehicle", "_caller", "_params"]; | ||
_vehicle forceFlagTexture ""; | ||
_vehicle setVariable [QEGVAR(Vehicle,hasFlag), false]; | ||
}, _remCondition] call ace_interact_menu_fnc_createAction; | ||
[_vehicle, 1, ["ACE_SelfActions"], _takeFlag] call ace_interact_menu_fnc_addActionToObject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters