Skip to content

Commit 0c3499c

Browse files
committed
Merge branch 'development'
2 parents 9575dbe + c10c8f2 commit 0c3499c

File tree

4 files changed

+58
-15
lines changed

4 files changed

+58
-15
lines changed

source/INIT.sqf

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,16 @@ if (!isMultiplayer) then {
2424
if (isMultiplayer) then {
2525

2626
// Get the variables from the parameters lobby
27-
_revive_activated = paramsArray select 0; // Revives, true or false
28-
DUWSMP_CP_death_cost = paramsArray select 1;
27+
_revive_activated = ["Revive", 1] call BIS_fnc_getParamValue;
28+
DUWSMP_CP_death_cost = ["DeathPenalty", 1] call BIS_fnc_getParamValue;
29+
staminaEnabled = ["Stamina", 0] call BIS_fnc_getParamValue;
30+
31+
if(staminaEnabled == 0) then {
32+
staminaEnabled = false;
33+
} else {
34+
staminaEnabled = true;
35+
};
36+
2937
if (support_armory_available) then {
3038
hq_blu1 addaction ["<t color='#ff0066'>Armory (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
3139
{
@@ -152,6 +160,10 @@ if (hasInterface) then {
152160
// init High Command
153161
_handle = [] execVM "dialog\hc_init.sqf";
154162
[] execVM "dialog\startup\weather_client.sqf";
163+
164+
if(!staminaEnabled) then {
165+
player enableStamina false;
166+
};
155167
};
156168

157169
if (!isMultiplayer) then {

source/duws_revive/respawnClicked.sqf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ DUWS_player_injured = false;
66
player setpos [getpos hq_blu1 select 0, (getpos hq_blu1 select 1)+10];
77
player allowdamage true;
88

9-
closedialog 0;
9+
if(!staminaEnabled) then {
10+
player enableStamina false;
11+
};
1012

13+
closedialog 0;

source/params.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ class Params {
66
default = true;
77
};
88

9-
class DeatPenalty {
9+
class DeathPenalty {
1010
title = "CP death penalty";
1111
values[] = {1,2,3,4,5,6,7,8,9,10,0};
1212
texts[] = {"1","2","3","4","5","6","7","8","9","10","No penalty"};
1313
default = 1;
1414
};
15-
}
15+
16+
class Stamina {
17+
title = "Stamina System";
18+
values[] = {1,0};
19+
texts[] = {"On","Off"};
20+
default = 1;
21+
};
22+
}

source/support/veh_refit.sqf

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,44 @@
1+
_vehicle = false;
12
_mounted_veh = vehicle player;
3+
_uav = false;
4+
_connected_uav = getConnectedUAV player;
5+
_distanceFromHQ = 0;
26

3-
if (commandpointsblu1<2) exitWith
7+
if (commandpointsblu1<2) exitWith
48
{
59
["info",["Not enough command points","Not enough Command Points (2CP required)"]] call bis_fnc_showNotification;
610
};
711

8-
if (_mounted_veh==player) exitWith {
9-
Hint "You must be inside a vehicle to refit it."
12+
if(_mounted_veh == player) then { // No vehicle to refit
13+
if(!isNull _connected_uav) then { // UAV to refit
14+
_uav = true;
15+
_distanceFromHQ = hq_blu1 distance _connected_uav;
16+
};
17+
} else { // Vehicle takes priority over UAV;
18+
_vehicle = true;
19+
_distanceFromHQ = hq_blu1 distance _mounted_veh;
1020
};
1121

12-
// check if near the officer
13-
if ((hq_blu1 distance player)>100) exitWith {
14-
["veh_refit_hint",["Too far away","Your vehicle must be near the base"]] call bis_fnc_showNotification;
22+
if(!_vehicle && !_uav) exitWith {
23+
hint "You must be connected to or inside a vehicle to refit it";
24+
};
25+
26+
if (_distanceFromHQ > 100) exitWith {
27+
["veh_refit_hint",["Too far away","Your vehicle must be near the base"]] call bis_fnc_showNotification;
28+
};
29+
30+
if(_vehicle) then {
31+
_mounted_veh setDamage 0;
32+
_mounted_veh setFuel 1;
33+
_mounted_veh setVehicleAmmoDef 1;
34+
};
35+
36+
if(_uav) then { // If refitting UAV, check UAV distance from HQ.
37+
_connected_uav setDamage 0;
38+
_connected_uav setFuel 1;
39+
_connected_uav setVehicleAmmoDef 1;
1540
};
1641

1742
commandpointsblu1 = commandpointsblu1 - 2;
1843
publicVariable "commandpointsblu1";
19-
_mounted_veh setDamage 0;
20-
_mounted_veh setFuel 1;
21-
_mounted_veh setVehicleAmmoDef 1;
2244
["veh_refit_hint",["Vehicle ready !","Your vehicle has been rearmed, refueled and repaired"]] call bis_fnc_showNotification;
23-

0 commit comments

Comments
 (0)