diff --git a/addons/main/REVIVE/fn_clientInit.sqf b/addons/main/REVIVE/fn_clientInit.sqf index d12569b0..5745d394 100644 --- a/addons/main/REVIVE/fn_clientInit.sqf +++ b/addons/main/REVIVE/fn_clientInit.sqf @@ -54,9 +54,16 @@ DFUNC(SelfCare) = // Var setzen player setVariable ["OPT_isUnconscious", 0, true]; player setVariable ["OPT_isStabilized", 0, true]; + player setVariable ["OPT_SpawnTime", time, false]; GVAR(OPT_isDragging) = false; player setVariable ["OPT_isDragged", 0, true]; + if (GVAR(Respawnzeitdynamisch)) then + { + // Respawnzeit setzen + setPlayerRespawnTime GVAR(Respawnzeit); + }; + //Chat abschaltung bei Bewustlosigkeit (findDisplay 46) displayAddEventHandler ["KeyDown", {_this call FUNC(keyUnbind)}]; diff --git a/addons/main/REVIVE/fn_clientInitEH.sqf b/addons/main/REVIVE/fn_clientInitEH.sqf index 807bd31f..dd7a066d 100644 --- a/addons/main/REVIVE/fn_clientInitEH.sqf +++ b/addons/main/REVIVE/fn_clientInitEH.sqf @@ -157,6 +157,7 @@ DFUNC(HandleDamage) = _newPlayer setVariable ["OPT_isUnconscious", 0, true]; _newPlayer setVariable ["OPT_isStabilized", 0, true]; _newPlayer setVariable ["OPT_isDragged", 0, true]; + _newPlayer setVariable ["OPT_SpawnTime", time, false]; _newPlayer allowDamage true; _newPlayer setVariable ["tf_unable_to_use_radio", false]; diff --git a/addons/main/REVIVE/fn_dialog.sqf b/addons/main/REVIVE/fn_dialog.sqf index e229cbd6..707ae6bc 100644 --- a/addons/main/REVIVE/fn_dialog.sqf +++ b/addons/main/REVIVE/fn_dialog.sqf @@ -131,6 +131,24 @@ GVAR(startzeit) = time; } forEach _units; }; + //Dynamische Respawnzeit + if (GVAR(Respawnzeitdynamisch)) then + { + //Dynamische Respawnzeit + private _PlayerOnMapTime = player getVariable ['OPT_SpawnTime',GVAR(Respawnzeit)]; + private _PlayerRespawnTime = GVAR(Respawnzeit) - (time - _PlayerOnMapTime); + + // Respawnzeit setzen + if (_PlayerRespawnTime <= 0) then + { + setPlayerRespawnTime 10; + } + else + { + setPlayerRespawnTime _PlayerRespawnTime; + }; + }; + // Textausgabe über Medic entfernung _MedicNearLabel_Meter ctrlSetText format ["%1", _hintMsg]; diff --git a/addons/main/REVIVE/fn_initCBASettings.sqf b/addons/main/REVIVE/fn_initCBASettings.sqf index a4e2acfc..df2a7556 100644 --- a/addons/main/REVIVE/fn_initCBASettings.sqf +++ b/addons/main/REVIVE/fn_initCBASettings.sqf @@ -109,3 +109,29 @@ 1, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer {} // function that will be executed once on mission start and every time the setting is changed. ] call CBA_Settings_fnc_init; + +[ + QGVAR(Respawnzeitdynamisch), // Internal setting name, should always contain a tag! This will be the global variable which takes the value of the setting. + "CHECKBOX", // setting type + [ + "Dynamische Respawn Zeit", // Pretty name shown inside the ingame settings menu. Can be stringtable entry. + "Dynamische Respawn Zeit aktivieren" + endl // Mouse-Over description of the above + ], + "OPT Respawn", // Pretty name of the category where the setting can be found. Can be stringtable entry. + false, // Default value + 1, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer + {} // function that will be executed once on mission start and every time the setting is changed. +] call CBA_Settings_fnc_init; + +[ + QGVAR(Respawnzeit), // Internal setting name, should always contain a tag! This will be the global variable which takes the value of the setting. + "SLIDER", // setting type + [ + "Respawnzeit Spieler", // Pretty name shown inside the ingame settings menu. Can be stringtable entry. + "Maximale Respawn-Zeit [in s]" + endl // Mouse-Over description of the above + ], + "OPT Respawn", // Pretty name of the category where the setting can be found. Can be stringtable entry. + [0, 1200, 900, 0], // [min, max, default, decimal] + 1, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer + {} // function that will be executed once on mission start and every time the setting is changed. +] call CBA_Settings_fnc_init; \ No newline at end of file