diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf
index 741bd41a0..996e147f5 100644
--- a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf
+++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf
@@ -25,6 +25,7 @@ btc_p_respawn_fromFOBToBase = ("btc_p_respawn_fromFOBToBase" call BIS_fnc_getPar
btc_p_rallypointTimer = "btc_p_rallypointTimer" call BIS_fnc_getParamValue;
btc_p_respawn_arsenal = ("btc_p_respawn_arsenal" call BIS_fnc_getParamValue) isEqualTo 1;
btc_p_respawn_ticketsAtStart = "btc_p_respawn_ticketsAtStart" call BIS_fnc_getParamValue;
+btc_p_respawn_ticketsLost = 1 - ("btc_p_respawn_ticketsLost" call BIS_fnc_getParamValue);
btc_p_respawn_ticketsShare = ("btc_p_respawn_ticketsShare" call BIS_fnc_getParamValue) isEqualTo 0;
btc_p_body_timeBeforeShowMarker = ("btc_p_body_timeBeforeShowMarker" call BIS_fnc_getParamValue) * 60;
diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp
index 9534af8e2..fe7a43a9e 100644
--- a/=BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp
+++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp
@@ -89,6 +89,12 @@ class Params {
texts[]={$STR_DISABLED,"0","1","2","3","4","5","10","15","20","25","30","50","70","100","150","200"};
default = 20;
};
+ class btc_p_respawn_ticketsLost { // Number of tickets lost per death:
+ title = __EVAL(format [" %1", localize "STR_BTC_HAM_RESP_TICKETSLOST"]);
+ values[]={1,2,3,4,5,6,7,8,9,10};
+ texts[]={"1","2","3","4","5","6","7","8","9","10"};
+ default = 1;
+ };
class btc_p_respawn_ticketsShare { // Tickets are share between:
title = __EVAL(format [" %1", localize "STR_BTC_HAM_RESP_TICKETSHARE"]);
values[]={0,1};
diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load.sqf
index 99bbf8461..f40d2dc93 100644
--- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load.sqf
+++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load.sqf
@@ -217,9 +217,6 @@ private _id = ["ace_tagCreated", {
//Player respawn tickets
if (btc_p_respawn_ticketsAtStart >= 0) then {
btc_respawn_tickets = +(profileNamespace getVariable [format ["btc_hm_%1_respawnTickets", _name], btc_respawn_tickets]);
- if (btc_p_respawn_ticketsShare) then {
- btc_p_respawn_ticketsAtStart = btc_respawn_tickets getOrDefault [str btc_player_side, btc_p_respawn_ticketsAtStart];
- };
private _deadBodyPlayers = +(profileNamespace getVariable [format ["btc_hm_%1_deadBodyPlayers", _name], []]);
private _group = createGroup btc_player_side;
diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/save.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/save.sqf
index 147fcce73..d7605875d 100644
--- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/save.sqf
+++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/save.sqf
@@ -216,9 +216,6 @@ profileNamespace setVariable [format ["btc_hm_%1_tags", _name], +_tags_propertie
//Player respawn tickets
if (btc_p_respawn_ticketsAtStart >= 0) then {
- if (btc_p_respawn_ticketsShare) then {
- btc_respawn_tickets set [str btc_player_side, [btc_player_side] call BIS_fnc_respawnTickets];
- };
profileNamespace setVariable [format ["btc_hm_%1_respawnTickets", _name], +btc_respawn_tickets];
private _deadBodyPlayers = (btc_body_deadPlayers - [objNull]) apply {[
diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf
index 297c80c50..c853cd257 100644
--- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf
+++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf
@@ -35,6 +35,9 @@ params [
if (_unit isNotEqualTo player) exitWith {};
if (ace_map_mapIllumination) then {ace_map_mapIllumination = false;};
if (isObjectHidden player) exitWith {};
+ if !(isServer) then { // Don't add twice the event in player host
+ ["btc_respawn_player", [_unit, player]] call CBA_fnc_localEvent;
+ };
["btc_respawn_player", [_unit, player]] call CBA_fnc_serverEvent;
}] call CBA_fnc_addEventHandler;
{
@@ -117,6 +120,16 @@ inGameUISetEventHandler ["Action", '["btc_inGameUISetEventHandler", _this] call
(findDisplay 46) displayAddEventHandler ["MouseButtonDown", btc_int_fnc_horn];
}] call CBA_fnc_waitUntilAndExecute;
+if (btc_p_respawn_ticketsAtStart >= 0) then {
+ ["btc_respawn_player", {
+ [
+ [player, btc_player_side] select btc_p_respawn_ticketsShare,
+ btc_p_respawn_ticketsLost
+ ] call BIS_fnc_respawnTickets; // Need to be handle locally
+ _this remoteExecCall ["btc_respawn_fnc_player", 2];
+ }] call CBA_fnc_addEventHandler;
+};
+
["ace_marker_flags_placed", {
params ["_unit", "_flag"];
_flag remoteExecCall ["btc_log_fnc_init", 2];
diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/server.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/server.sqf
index 849dd84cd..47faa7d32 100644
--- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/server.sqf
+++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/server.sqf
@@ -41,9 +41,7 @@ addMissionEventHandler ["BuildingChanged", btc_rep_fnc_buildingchanged];
}, false] call CBA_fnc_addClassEventHandler;
} forEach btc_civ_type_veh;
["ace_killed", btc_mil_fnc_unit_killed] call CBA_fnc_addEventHandler;
-["ace_repair_setWheelHitPointDamage", {
- _this remoteExecCall ["btc_rep_fnc_wheelChange", 2];
-}] call CBA_fnc_addEventHandler;
+["ace_repair_setWheelHitPointDamage", btc_rep_fnc_wheelChange] call CBA_fnc_addEventHandler;
["ace_disarming_dropItems", btc_rep_fnc_foodRemoved] call CBA_fnc_addEventHandler;
["btc_respawn_player", {
params ["", "_player"];
@@ -107,7 +105,6 @@ if (btc_p_set_skill) then {
["ace_tagCreated", btc_tag_fnc_eh] call CBA_fnc_addEventHandler;
if (btc_p_respawn_ticketsAtStart >= 0) then {
- ["btc_respawn_player", btc_respawn_fnc_player] call CBA_fnc_addEventHandler;
["ace_placedInBodyBag", btc_body_fnc_setBodyBag] call CBA_fnc_addEventHandler;
if !(btc_p_respawn_ticketsShare) then {
diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/respawn/addTicket.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/respawn/addTicket.sqf
index b86316ce6..6c9baacd8 100644
--- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/respawn/addTicket.sqf
+++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/respawn/addTicket.sqf
@@ -34,7 +34,7 @@ params [
["_uid", "", [""]]
];
-if !(_player isEqualTo objNull) then {
+if (_player isNotEqualTo objNull) then {
private _ticketValue = [_player, _ticket] call BIS_fnc_respawnTickets;
[24, _ticketValue] remoteExecCall ["btc_fnc_show_hint", _player];
};
diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/respawn/player.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/respawn/player.sqf
index 0f3ab5e46..994a06190 100644
--- a/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/respawn/player.sqf
+++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/respawn/player.sqf
@@ -24,8 +24,11 @@ params ["_unit", "_player"];
_unit setVariable ["btc_dont_delete", true];
btc_body_deadPlayers pushBack _unit;
_unit setVariable ["btc_UID", getPlayerUID _player];
-if !(btc_p_respawn_ticketsShare) then {
- btc_respawn_tickets set [getPlayerUID _player, ([_player] call BIS_fnc_respawnTickets) - 1];
+
+if (btc_p_respawn_ticketsShare) then {
+ btc_respawn_tickets set [str btc_player_side, [btc_player_side] call BIS_fnc_respawnTickets];
+} else {
+ btc_respawn_tickets set [getPlayerUID _player, [_player] call BIS_fnc_respawnTickets];
};
if (btc_p_body_timeBeforeShowMarker isEqualTo -1) exitwith {};
diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/core/init_server.sqf b/=BTC=co@30_Hearts_and_Minds.Altis/core/init_server.sqf
index 4c696ac2e..71ff9cbf2 100644
--- a/=BTC=co@30_Hearts_and_Minds.Altis/core/init_server.sqf
+++ b/=BTC=co@30_Hearts_and_Minds.Altis/core/init_server.sqf
@@ -54,12 +54,13 @@ if (btc_p_side_mission_cycle > 0) then {
["btc_tag_remover" + _x, "STR_BTC_HAM_ACTION_REMOVETAG", _x, ["#(rgb,8,8,3)color(0,0,0,0)"], "\a3\Modules_F_Curator\Data\portraitSmoke_ca.paa"] call ace_tagging_fnc_addCustomTag;
} forEach ["ACE_SpraypaintRed"];
-if (btc_p_respawn_ticketsAtStart >= 0) then {
- if (btc_p_respawn_ticketsShare) then {
- private _tickets = btc_p_respawn_ticketsAtStart;
- if (btc_p_respawn_ticketsAtStart isEqualTo 0) then {
- _tickets = -1;
- };
- [btc_player_side, _tickets] call BIS_fnc_respawnTickets;
+if (
+ btc_p_respawn_ticketsShare &&
+ {btc_p_respawn_ticketsAtStart >= 0}
+) then {
+ private _tickets = btc_respawn_tickets getOrDefault [str btc_player_side, btc_p_respawn_ticketsAtStart];;
+ if (_tickets isEqualTo 0) then {
+ _tickets = -1;
};
+ [btc_player_side, _tickets] call BIS_fnc_respawnTickets;
};
diff --git a/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml b/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml
index 60f9ddeb5..a3b3c487f 100644
--- a/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml
+++ b/=BTC=co@30_Hearts_and_Minds.Altis/stringtable.xml
@@ -729,6 +729,9 @@
任务开始时的重生票数:
Počet životu na začátku mise:
+
+ Number of tickets lost per death:
+
Tickets are share between:
Tickets werden aufgeteilt zwischen?