Skip to content

Commit 22819ac

Browse files
committed
Modified mapclickcluster.sqf with new support timeout
1 parent cd7fad5 commit 22819ac

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

source/support/cluster/mapclickcluster.sqf

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,18 @@ params["_salvos", "_radius", "_interval", "_rps", "_supportype", "_cost", "_ammo
2626

2727
_timer = 60;
2828
clicked = false;
29+
_pos = [];
30+
31+
// Guard against calling cluster bombs too often
32+
if(support_cluster_timeout > 0) exitWith {
33+
["info",["Support is on Cooldown",format ["Cluster Bomb drop will be ready again in %1 seconds", support_cluster_timeout]]] call bis_fnc_showNotification;
34+
};
2935

3036
// IF NOT ENOUGH PTS
3137
if (commandpointsblu1<_cost) exitWith {
3238
["info",["Support","You don't have enough command points"]] call bis_fnc_showNotification;
3339
};
3440

35-
_pos = [];
3641
hint "Click on your map to give the coordinates or wait 60 seconds to cancel the strike";
3742
OnMapSingleClick format["_null = [_pos,%2,%3,%4,%5,%6,%7,'%8'] execVM 'support\cluster\cluster.sqf';clicked=true;onMapSingleClick ''",_pos,_salvos,_radius,_interval,_rps,_supportype,_cost,_ammotype];
3843

@@ -43,9 +48,12 @@ while {_timer>0 AND !clicked} do {
4348
};
4449

4550
// TIMER ELLAPSED OR CLICKED
46-
sleep 60;
4751
OnMapSingleClick "";
4852

49-
if (_supportype==1) exitWith {
50-
_art = [player1,"cluster"] call BIS_fnc_addCommMenuItem;
53+
// Tick down timeout guard
54+
support_cluster_timeout = 180;
55+
while {support_cluster_timeout > 0} do {
56+
sleep 1;
57+
support_cluster_timeout = support_cluster_timeout - 1;
58+
publicVariable "support_cluster_timeout";
5159
};

0 commit comments

Comments
 (0)