From 32ac2c7d92a174638a4cb8486ad767ce10bfd860 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Sun, 10 Nov 2013 16:29:10 -0600 Subject: [PATCH] gear access on surrendered player test --- SQF/dayz_code/actions/dayz_spaceInterrupt.sqf | 8 ++++++-- SQF/dayz_code/compile/fn_selfActions.sqf | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/SQF/dayz_code/actions/dayz_spaceInterrupt.sqf b/SQF/dayz_code/actions/dayz_spaceInterrupt.sqf index 9402b48e4..4436e8ab2 100644 --- a/SQF/dayz_code/actions/dayz_spaceInterrupt.sqf +++ b/SQF/dayz_code/actions/dayz_spaceInterrupt.sqf @@ -22,6 +22,8 @@ if (_dikCode in actionKeys "Surrender") then { [objNull, player, rSwitchMove,""] call RE; player playActionNow ""; + player setVariable ["DZE_Surrendered", false, true]; + } else { DZE_Surrender = true; @@ -32,8 +34,10 @@ if (_dikCode in actionKeys "Surrender") then { if (secondaryWeapon player != "") then { player action ["dropWeapon",player, (secondaryWeapon player)]; }; - {player action ["dropMagazine", player, _x]} forEach magazines player; - + + // set publicvariable that allows other player to access gear + player setVariable ["DZE_Surrendered", true, true]; + // surrender animation player playMove "AmovPercMstpSsurWnonDnon"; }; diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 944f9df2a..9c96f6535 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -269,6 +269,8 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu s_player_forceSave = -1; }; }; + + If(DZE_AllowCargoCheck) then { if((_isVehicle or _isTent or _isnewstorage) and _isAlive and !_isMan and !locked _cursorTarget) then { @@ -321,6 +323,21 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu if (_isMan and !_isZombie and !_isAnimal) then { _player_studybody = true; } + } else { + // unit alive + + // gear access on surrendered player + if(_isMan and !_isZombie and !_isAnimal) then { + if (_cursorTarget getVariable ["DZE_Surrendered",false]) then { + if (s_player_SurrenderedGear < 0) then { + //s_player_SurrenderedGear = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""]; + s_player_SurrenderedGear = player addAction ["Gear",_text], (player action ["Gear", _cursorTarget]),_cursorTarget, 1, true, true, "", ""]; + }; + }; + } else { + player removeAction s_player_SurrenderedGear; + s_player_SurrenderedGear = -1; + }; };