gear access on surrendered player test

This commit is contained in:
[VB]AWOL
2013-11-10 16:29:10 -06:00
parent 8f5f01477c
commit 32ac2c7d92
2 changed files with 23 additions and 2 deletions

View File

@@ -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,7 +34,9 @@ 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";

View File

@@ -270,6 +270,8 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
};
};
If(DZE_AllowCargoCheck) then {
if((_isVehicle or _isTent or _isnewstorage) and _isAlive and !_isMan and !locked _cursorTarget) then {
if (s_player_checkGear < 0) 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;
};
};