ACE3/addons/marker_flags/functions/fnc_placeFlag.sqf
Brett 6851183e1f
Add Marker Flags (#8696)
* add marker flags

* minor cleanup

* use pictures for actions

* check canDig

* review changes

* Update fnc_placeFlag.sqf

* fix hiddenSelectionsTextures

* Update addons/marker_flags/functions/fnc_pickUpFlag.sqf

Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>

* Cache flag list at pre-start

* Add model for flag pole

* Pass item name to pickUpFlag via action

* Update addons/marker_flags/stringtable.xml

Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>

Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>
2022-05-09 20:28:10 -05:00

28 lines
673 B
Plaintext

#include "script_component.hpp"
/*
* Author: Brett Mayson
* Places a flag in front of the unit.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Flag <STRING>
*
* Return Value:
* Flag <OBJECT>
*
* Example:
* [player, "ace_marker_flags_white"] call ace_marker_flags_fnc_placeFlag
*
* Public: No
*/
params [["_unit", objNull, [objNull]], ["_flag", QGVAR(white), [""]]];
_unit removeItem _flag;
_flag = GVAR(flagCache) get _flag; // convert to vehicle type
private _pos = _unit modelToWorld [0, 1, 0];
private _flag = _flag createVehicle _pos;
_flag setPos _pos;
[QGVAR(placed), [_unit, _flag]] call CBA_fnc_localEvent;
[_unit, "PutDown"] call EFUNC(common,doGesture);