Skip to content

Commit

Permalink
Merge pull request #508 from CBATeam/fix-bi-callsign-attribute
Browse files Browse the repository at this point in the history
fix BI 3den callsign attribute
  • Loading branch information
Killswitch00 authored Sep 23, 2016
2 parents f9dd665 + 10a0e23 commit ca1bbd3
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
14 changes: 14 additions & 0 deletions addons/common/Cfg3DEN.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

class Cfg3DEN {
class Group {
class AttributeCategories {
class Init {
class Attributes {
class Callsign {
expression = "[_this, _value] call CBA_fnc_setCallsign";
};
};
};
};
};
};
1 change: 1 addition & 0 deletions addons/common/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class CfgFunctions {
PATHTO_FNC(getGroupIndex);
PATHTO_FNC(getMagazineIndex);
PATHTO_FNC(currentMagazineIndex);
PATHTO_FNC(setCallsign);
};

class Soldiers {
Expand Down
3 changes: 2 additions & 1 deletion addons/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"A3_BaseConfig_F"};
requiredAddons[] = {"A3_BaseConfig_F","A3_3DEN"};
version = VERSION;
authors[] = {"Spooner","Sickboy","Rocko"};
};
};

#include "Cfg3DEN.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgFunctions.hpp"

Expand Down
39 changes: 39 additions & 0 deletions addons/common/fnc_setCallsign.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* ----------------------------------------------------------------------------
Function: CBA_fnc_setCallsign
Description:
Set call sign of a group.
Works in SP, MP and Eden-Editor and at any point.
Parameters:
_group - A group <GROUP, OBJECT>
_callsign - The call sign the group should receive <STRING>
Returns:
Nothing
Example:
(begin example)
[group player, "Banana Squad"] call CBA_fnc_setCallsign
(end)
Author:
snippers, commy2
---------------------------------------------------------------------------- */
#include "script_component.hpp"
SCRIPT(setCallsign);

params [["_group", grpNull, [grpNull, objNull]], ["_callsign", "", [""]]];

private _group = _group call CBA_fnc_getGroup;

if (is3DEN) then {
_group setGroupId [_callsign];
};

[{
params ["_group", "_callsign"];

_group setGroupIdGlobal [_callsign];
}, [_group, _callsign]] call CBA_fnc_execNextFrame;

0 comments on commit ca1bbd3

Please sign in to comment.