mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
cba'd functions
This commit is contained in:
parent
d85c05ffe3
commit
5871053564
@ -5,10 +5,12 @@ private ["_unit", "_side"];
|
||||
_unit = _this select 0;
|
||||
_side = _this select 1;
|
||||
|
||||
_unit getVariable ["AGM_canMoveRallypoint", false]
|
||||
// rallypoint names are defined in CfgVehicles.hpp
|
||||
|
||||
_unit getVariable ["ACE_canMoveRallypoint"), false]
|
||||
&& {!isNull ([
|
||||
objNull,
|
||||
missionNamespace getVariable ["AGM_Rallypoint_West", objNull],
|
||||
missionNamespace getVariable ["AGM_Rallypoint_East", objNull],
|
||||
missionNamespace getVariable ["AGM_Rallypoint_Independent", objNull]
|
||||
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
|
||||
missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
|
||||
missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
|
||||
] select ([west, east, independent] find _side) + 1)}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Name: AGM_Respawn_fnc_handleKilled
|
||||
Name: ACE_Respawn_fnc_handleKilled
|
||||
|
||||
Author(s):
|
||||
bux578
|
||||
@ -20,12 +20,12 @@ private ["_killedUnit"];
|
||||
_killedUnit = _this select 0;
|
||||
|
||||
// Saves the gear when the player is killed
|
||||
AGM_Respawn_unitGear = [];
|
||||
GVAR(unitGear) = [];
|
||||
|
||||
if (AGM_Respawn_SavePreDeathGear) then {
|
||||
AGM_Respawn_unitGear = [_killedUnit] call AGM_Respawn_fnc_getAllGear;
|
||||
if (GVAR(SavePreDeathGear)) then {
|
||||
GVAR(unitGear) = [_killedUnit] call FUNC(getAllGear);
|
||||
};
|
||||
|
||||
if (missionNamespace getVariable ["AGM_showFriendlyFireMessage", false]) then {
|
||||
[_this, "AGM_Respawn_fnc_showFriendlyFireMessage", 2] call AGM_Core_fnc_execRemoteFnc;
|
||||
if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then {
|
||||
[_this, FUNC(showFriendlyFireMessage), 2] call EFUNC(Core, execRemoteFnc);
|
||||
};
|
||||
|
@ -20,6 +20,6 @@ private ["_respawnedUnit"];
|
||||
_respawnedUnit = _this select 0;
|
||||
|
||||
// Restores the gear when the player respawns
|
||||
if (AGM_Respawn_SavePreDeathGear) then {
|
||||
[_respawnedUnit, AGM_Respawn_unitGear] call AGM_Respawn_fnc_restoreGear;
|
||||
if (GVAR(SavePreDeathGear)) then {
|
||||
[_respawnedUnit, GVAR(unitGear)] call FUNC(restoreGear);
|
||||
};
|
||||
|
@ -13,5 +13,5 @@ if (isNil _name) then {
|
||||
publicVariable _name;
|
||||
} else {
|
||||
deleteVehicle _rallypoint;
|
||||
diag_log text "[AGM] Respawn: ERROR Multiple Rallypoints of same type.";
|
||||
diag_log text "[ACE] Respawn: ERROR Multiple Rallypoints of same type.";
|
||||
};
|
||||
|
@ -16,28 +16,28 @@ _activated = _this select 2;
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
AGM_Respawn_Module = true;
|
||||
GVAR(Module) = true;
|
||||
|
||||
[_logic, "AGM_Respawn_SavePreDeathGear", "SavePreDeathGear"] call AGM_Core_fnc_readBooleanParameterFromModule;
|
||||
[_logic, "AGM_Respawn_RemoveDeadBodiesDisonncected", "RemoveDeadBodiesDisonncected"] call AGM_Core_fnc_readBooleanParameterFromModule;
|
||||
[_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(Core, readBooleanParameterFromModule);
|
||||
[_logic, QGVAR(RemoveDeadBodiesDisonncected), "RemoveDeadBodiesDisonncected"] call EFUNC(Core, readBooleanParameterFromModule);
|
||||
|
||||
if (isServer) then {
|
||||
if (AGM_Respawn_RemoveDeadBodiesDisonncected) then {
|
||||
_fnc_deleteDisconnected = {
|
||||
_this spawn {
|
||||
_unit = _this select 0;
|
||||
if (GVAR(RemoveDeadBodiesDisonncected)) then {
|
||||
_fnc_deleteDisconnected = {
|
||||
_this spawn {
|
||||
_unit = _this select 0;
|
||||
|
||||
sleep 4;
|
||||
sleep 4;
|
||||
|
||||
if (!alive _unit) then {
|
||||
deleteVehicle _unit;
|
||||
};
|
||||
};
|
||||
false
|
||||
};
|
||||
if (!alive _unit) then {
|
||||
deleteVehicle _unit;
|
||||
};
|
||||
};
|
||||
false
|
||||
};
|
||||
|
||||
addMissionEventHandler ["HandleDisconnect", _fnc_deleteDisconnected];
|
||||
};
|
||||
addMissionEventHandler ["HandleDisconnect", _fnc_deleteDisconnected];
|
||||
};
|
||||
};
|
||||
|
||||
diag_log text "[AGM]: Respawn Module Initialized.";
|
||||
diag_log text "[ACE]: Respawn Module Initialized.";
|
||||
|
@ -18,11 +18,11 @@ _this spawn {
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
if (isServer) then {
|
||||
_varName = "AGM_showFriendlyFireMessage";
|
||||
_varName = QGVAR(showFriendlyFireMessage);
|
||||
|
||||
missionNamespace setVariable [_varName, true];
|
||||
publicVariable _varName;
|
||||
};
|
||||
|
||||
diag_log text "[AGM]: Friendly Fire Messages Module Initialized.";
|
||||
diag_log text "[ACE]: Friendly Fire Messages Module Initialized.";
|
||||
};
|
||||
|
@ -16,10 +16,8 @@ _activated = _this select 2;
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
//_mode = parseNumber (_logic getVariable "Action");
|
||||
|
||||
{
|
||||
_x setVariable ["AGM_canMoveRallypoint", true];
|
||||
_x setVariable ["ACE_canMoveRallypoint", true];
|
||||
} forEach _units;
|
||||
|
||||
diag_log text "[AGM]: Rallypoint Module Initialized.";
|
||||
diag_log text "[ACE]: Rallypoint Module Initialized.";
|
||||
|
@ -4,11 +4,13 @@ _this spawn {
|
||||
_unit = _this select 0;
|
||||
_side = _this select 1;
|
||||
|
||||
// rallypoint names are defined in CfgVehicles.hpp
|
||||
|
||||
_rallypoint = [
|
||||
objNull,
|
||||
missionNamespace getVariable ["AGM_RallypointExit_West", objNull],
|
||||
missionNamespace getVariable ["AGM_RallypointExit_East", objNull],
|
||||
missionNamespace getVariable ["AGM_RallypointExit_Independent", objNull]
|
||||
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
|
||||
missionNamespace getVariable ["ACE_RallypointExit_East", objNull],
|
||||
missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull]
|
||||
] select ([west, east, independent] find _side) + 1;
|
||||
|
||||
if (isNull _rallypoint) exitWith {};
|
||||
@ -19,7 +21,7 @@ _this spawn {
|
||||
|
||||
_position set [2, 0];
|
||||
|
||||
["Deploy in 5 seconds ..."] call AGM_Core_fnc_displayTextStructured;
|
||||
[localize "STR_ACE_Respawn_Deploy"] call EFUNC(Core, displayTextStructured);
|
||||
|
||||
sleep 5;
|
||||
_rallypoint setPosATL _position;
|
||||
@ -31,5 +33,5 @@ _this spawn {
|
||||
_marker setMarkerTextLocal format ["%1:%2", [date select 3, 2, 0] call CBA_fnc_FORMATNumber, [date select 4, 2, 0] call CBA_fnc_FORMATNumber];
|
||||
*/
|
||||
|
||||
["Rallypoint deployed"] call AGM_Core_fnc_displayTextStructured;
|
||||
[localize "STR_ACE_Respawn_Deploy"] call EFUNC(Core, displayTextStructured);
|
||||
};
|
||||
|
@ -15,7 +15,7 @@ private ["_body", "_forceRemove", "_bodyRemoveTimer"];
|
||||
_body = _this select 0;
|
||||
_forceRemove = _this select 1;
|
||||
|
||||
_bodyRemoveTimer = AGM_Respawn_BodyRemoveTimer max 0;
|
||||
_bodyRemoveTimer = GVAR(BodyRemoveTimer) max 0;
|
||||
|
||||
// could be used for SpecOps missions.
|
||||
if (_forceRemove) then {
|
||||
|
@ -11,5 +11,5 @@ _forceRemove = _this select 0;
|
||||
} forEach playableUnits;
|
||||
|
||||
if (!isNil "_body" && {!alive _body}) then {
|
||||
[_body, _forceRemove] call AGM_Respawn_fnc_removeBody;
|
||||
[_body, _forceRemove] call FUNC(removeBody);
|
||||
};
|
||||
|
@ -5,8 +5,8 @@ private ["_unit", "_killer"];
|
||||
_unit = _this select 0;
|
||||
_killer = _this select 1;
|
||||
|
||||
if (_unit != _killer && side group _unit in [side group AGM_player, civilian] && {side group _killer == side group AGM_player}) then {
|
||||
systemChat format ["%1 was killed by %2", [_unit] call AGM_Core_fnc_getName, [_killer] call AGM_Core_fnc_getName];
|
||||
if (_unit != _killer && side group _unit in [side group ACE_player, civilian] && {side group _killer == side group ACE_player}) then {
|
||||
systemChat format ["%1 was killed by %2", [_unit] call EFUNC(Core, getName), [_killer] call EFUNC(Core, getName)];
|
||||
|
||||
[_unit, "killedByFriendly", [_unit, _killer]] call AGM_Core_fnc_callCustomEventHandlers;
|
||||
[_unit, "killedByFriendly", [_unit, _killer]] call EFUNC(Core, callCustomEventHandlers);
|
||||
};
|
||||
|
@ -6,22 +6,24 @@ _unit = _this select 0;
|
||||
_side = _this select 1;
|
||||
_toBase = _this select 2;
|
||||
|
||||
// rallypoint names are defined in CfgVehicles.hpp
|
||||
|
||||
_rallypoint = ([
|
||||
[
|
||||
objNull,
|
||||
missionNamespace getVariable ["AGM_RallypointExit_West", objNull],
|
||||
missionNamespace getVariable ["AGM_RallypointExit_East", objNull],
|
||||
missionNamespace getVariable ["AGM_RallypointExit_Independent", objNull]
|
||||
missionNamespace getVariable ["ACE_RallypointExit_West", objNull],
|
||||
missionNamespace getVariable ["ACE_RallypointExit_East", objNull],
|
||||
missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull]
|
||||
],
|
||||
[
|
||||
objNull,
|
||||
missionNamespace getVariable ["AGM_Rallypoint_West", objNull],
|
||||
missionNamespace getVariable ["AGM_Rallypoint_East", objNull],
|
||||
missionNamespace getVariable ["AGM_Rallypoint_Independent", objNull]
|
||||
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
|
||||
missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
|
||||
missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
|
||||
]
|
||||
] select _toBase) select ([west, east, independent] find _side) + 1;
|
||||
|
||||
if (isNull _rallypoint) exitWith {};
|
||||
|
||||
_unit setPosASL (getPosASL _rallypoint);
|
||||
[["Teleported to Rallypoint", "Teleported to Base"] select _toBase] call AGM_Core_fnc_displayTextStructured;
|
||||
[[localize "STR_ACE_Respawn_TeleportedToRallypoint", localize "STR_ACE_Respawn_TeleportedToBase"] select _toBase] call EFUNC(Core, displayTextStructured);
|
||||
|
21
addons/respawn/stringtable.xml
Normal file
21
addons/respawn/stringtable.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="Interaction">
|
||||
<Key ID="STR_ACE_Respawn_Deploy">
|
||||
<English>Deploy in 5 seconds ...</English>
|
||||
<German>Wird in 5 Sekunden errichtet ...</German>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Respawn_Deployed">
|
||||
<English>Rallypoint deployed</English>
|
||||
<German>Rallypoint errichtet</German>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Respawn_TeleportedToBase">
|
||||
<English>Teleported to Base</English>
|
||||
<German>Zur Basis teleportiert</German>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Respawn_TeleportedToRallypoint">
|
||||
<English>Teleported to Rallypoint</English>
|
||||
<German>Zum Rallypoint teleportiert</German>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user