diff --git a/source/INIT.sqf b/source/INIT.sqf index a0cb2a7..bdcc7b0 100644 --- a/source/INIT.sqf +++ b/source/INIT.sqf @@ -24,8 +24,16 @@ if (!isMultiplayer) then { if (isMultiplayer) then { // Get the variables from the parameters lobby - _revive_activated = paramsArray select 0; // Revives, true or false - DUWSMP_CP_death_cost = paramsArray select 1; + _revive_activated = ["Revive", 1] call BIS_fnc_getParamValue; + DUWSMP_CP_death_cost = ["DeathPenalty", 1] call BIS_fnc_getParamValue; + staminaEnabled = ["Stamina", 0] call BIS_fnc_getParamValue; + + if(staminaEnabled == 0) then { + staminaEnabled = false; + } else { + staminaEnabled = true; + }; + if (support_armory_available) then { hq_blu1 addaction ["Armory (VA)","bisArsenal.sqf", "", 0, true, true, "", "_this == player"]; { @@ -152,6 +160,10 @@ if (hasInterface) then { // init High Command _handle = [] execVM "dialog\hc_init.sqf"; [] execVM "dialog\startup\weather_client.sqf"; + + if(!staminaEnabled) then { + player enableStamina false; + }; }; if (!isMultiplayer) then { diff --git a/source/duws_revive/respawnClicked.sqf b/source/duws_revive/respawnClicked.sqf index 6c07521..8b9f40d 100644 --- a/source/duws_revive/respawnClicked.sqf +++ b/source/duws_revive/respawnClicked.sqf @@ -6,5 +6,8 @@ DUWS_player_injured = false; player setpos [getpos hq_blu1 select 0, (getpos hq_blu1 select 1)+10]; player allowdamage true; -closedialog 0; +if(!staminaEnabled) then { + player enableStamina false; +}; +closedialog 0; diff --git a/source/params.hpp b/source/params.hpp index bc0b9d1..932719a 100644 --- a/source/params.hpp +++ b/source/params.hpp @@ -6,10 +6,17 @@ class Params { default = true; }; - class DeatPenalty { + class DeathPenalty { title = "CP death penalty"; values[] = {1,2,3,4,5,6,7,8,9,10,0}; texts[] = {"1","2","3","4","5","6","7","8","9","10","No penalty"}; default = 1; }; -} \ No newline at end of file + + class Stamina { + title = "Stamina System"; + values[] = {1,0}; + texts[] = {"On","Off"}; + default = 1; + }; +} diff --git a/source/support/veh_refit.sqf b/source/support/veh_refit.sqf index d348b81..2230dc7 100644 --- a/source/support/veh_refit.sqf +++ b/source/support/veh_refit.sqf @@ -1,23 +1,44 @@ +_vehicle = false; _mounted_veh = vehicle player; +_uav = false; +_connected_uav = getConnectedUAV player; +_distanceFromHQ = 0; -if (commandpointsblu1<2) exitWith +if (commandpointsblu1<2) exitWith { ["info",["Not enough command points","Not enough Command Points (2CP required)"]] call bis_fnc_showNotification; }; -if (_mounted_veh==player) exitWith { -Hint "You must be inside a vehicle to refit it." +if(_mounted_veh == player) then { // No vehicle to refit + if(!isNull _connected_uav) then { // UAV to refit + _uav = true; + _distanceFromHQ = hq_blu1 distance _connected_uav; + }; +} else { // Vehicle takes priority over UAV; + _vehicle = true; + _distanceFromHQ = hq_blu1 distance _mounted_veh; }; -// check if near the officer -if ((hq_blu1 distance player)>100) exitWith { -["veh_refit_hint",["Too far away","Your vehicle must be near the base"]] call bis_fnc_showNotification; +if(!_vehicle && !_uav) exitWith { + hint "You must be connected to or inside a vehicle to refit it"; +}; + +if (_distanceFromHQ > 100) exitWith { + ["veh_refit_hint",["Too far away","Your vehicle must be near the base"]] call bis_fnc_showNotification; +}; + +if(_vehicle) then { + _mounted_veh setDamage 0; + _mounted_veh setFuel 1; + _mounted_veh setVehicleAmmoDef 1; +}; + +if(_uav) then { // If refitting UAV, check UAV distance from HQ. + _connected_uav setDamage 0; + _connected_uav setFuel 1; + _connected_uav setVehicleAmmoDef 1; }; commandpointsblu1 = commandpointsblu1 - 2; publicVariable "commandpointsblu1"; -_mounted_veh setDamage 0; -_mounted_veh setFuel 1; -_mounted_veh setVehicleAmmoDef 1; ["veh_refit_hint",["Vehicle ready !","Your vehicle has been rearmed, refueled and repaired"]] call bis_fnc_showNotification; -