Skip to content

Commit

Permalink
Name GPS tracker by ACE cargo customName if availalbe
Browse files Browse the repository at this point in the history
  • Loading branch information
dedmen committed Jul 14, 2024
1 parent 376f6f0 commit b3f8a0b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ if (!isServer) exitWith {
if (_trackerName == "") then {
private _attachedTo = attachedTo _explosive;
if (!isNull _attachedTo) then {
_trackerName = format["GPS %1-%2", if (isPlayer _attachedTo) then {name _attachedTo} else {getText (configOf _attachedTo >> "displayName")}, GVAR(TrackerCounter)];
private _displayName = if (isPlayer _attachedTo) then {name _attachedTo} else {getText (configOf _attachedTo >> "displayName")};
_displayName = _attachedTo getVariable ["ace_cargo_customName", _displayName]; // If this object (really only boxes) has a custom name, use that
_trackerName = format["GPS %1-%2", _displayName, GVAR(TrackerCounter)];
} else {
_trackerName = format["GPS %1-%2", name player, GVAR(TrackerCounter)];
_trackerName = format["GPS %1-%2", name player, GVAR(TrackerCounter)];
};
GVAR(TrackerCounter) = GVAR(TrackerCounter) + 1;
};
Expand Down

0 comments on commit b3f8a0b

Please sign in to comment.