Add dayz_onBack to surrender

This commit is contained in:
ebaydayz
2016-11-16 13:34:48 -05:00
parent 20d84ddba8
commit f994b95c1d
5 changed files with 51 additions and 50 deletions

View File

@@ -0,0 +1,47 @@
private ["_canDo","_iPos","_inVehicle","_item","_onLadder","_pistol","_primary","_removed"];
_inVehicle = (vehicle player != player);
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder && !_inVehicle);
if (_canDo && !DZE_Surrender && !(player isKindOf "PZombie_VB")) then {
DZE_Surrender = true;
_primary = primaryWeapon player;
_pistol = "";
{
if (getNumber (configFile >> "CfgWeapons" >> _x >> "type") == 2) exitWith {
_pistol = _x;
};
} count (weapons player);
if (_primary != "" or _pistol != "" or dayz_onBack != "") then {
player playActionNow "PutDown";
_iPos = getPosATL player;
_item = createVehicle ["WeaponHolder", _iPos, [], 1, "CAN_COLLIDE"];
_item setposATL _iPos;
if (_primary != "") then {
_removed = ([player,_primary,1] call BIS_fnc_invRemove);
if (_removed == 1) then {
_item addWeaponCargoGlobal [_primary,1];
};
};
if (_pistol != "") then {
_removed = ([player,_pistol,1] call BIS_fnc_invRemove);
if (_removed == 1) then {
_item addWeaponCargoGlobal [_pistol,1];
};
};
if (dayz_onBack != "") then {
_item addWeaponCargoGlobal [dayz_onBack,1];
dayz_onBack = ""; // Remove from back
if (!isNull findDisplay 106) then {findDisplay 106 displayCtrl 1209 ctrlSetText "";};
};
player reveal _item;
};
// set publicvariable that allows other player to access gear
player setVariable ["DZE_Surrendered", true, true];
// surrender animation
player playMove "AmovPercMstpSsurWnonDnon";
};

View File

@@ -105,54 +105,7 @@ if (isNil "keyboard_keys") then {
};
};
_surrender = {
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder && !_inVehicle);
if (_canDo && !DZE_Surrender && !(player isKindOf "PZombie_VB")) then {
DZE_Surrender = true;
_dropPrimary = false;
_dropSecondary = false;
_primaryWeapon = primaryWeapon player;
if (_primaryWeapon != "") then {_dropPrimary = true;};
_secondaryWeapon = "";
{
if ((getNumber (configFile >> "CfgWeapons" >> _x >> "Type")) == 2) exitWith {
_secondaryWeapon = _x;
};
} count (weapons player);
if (_secondaryWeapon != "") then {_dropSecondary = true;};
if (_dropPrimary || _dropSecondary) then {
player playActionNow "PutDown";
_iPos = getPosATL player;
_radius = 1;
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
_item setposATL _iPos;
if (_dropPrimary) then {
_iItem = _primaryWeapon;
_removed = ([player,_iItem,1] call BIS_fnc_invRemove);
if (_removed == 1) then {
_item addWeaponCargoGlobal [_iItem,1];
};
};
if (_dropSecondary) then {
_iItem = _secondaryWeapon;
_removed = ([player,_iItem,1] call BIS_fnc_invRemove);
if (_removed == 1) then {
_item addWeaponCargoGlobal [_iItem,1];
};
};
player reveal _item;
};
// set publicvariable that allows other player to access gear
player setVariable ["DZE_Surrendered", true, true];
// surrender animation
player playMove "AmovPercMstpSsurWnonDnon";
};
call player_surrender;
_handled = true;
};
_gear = {

View File

@@ -69,4 +69,4 @@ while {(!isNull _display) && !r_player_dead} do {
};
TimeOutDisplayed = false;
if (r_player_dead) exitWith {_btnAbort ctrlEnable true;};
if (r_player_dead) then {_btnAbort ctrlEnable true;};

View File

@@ -184,6 +184,7 @@ if (!isDedicated) then {
player_removeItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_removeItems.sqf";
player_removeNearby = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeNearby.sqf";
player_removeObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf";
player_surrender = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_surrender.sqf";
player_traderCity = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderCity.sqf";
player_unlockDoor = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockDoor.sqf";
player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf";

View File

@@ -7534,7 +7534,7 @@
<German>Du kannst dich nicht in der Nähe eines anderen Spielers ausloggen!</German>
</Key>
<Key ID="str_abort_zedsclose">
<English>You cannot abort near Zombies!</English>
<English>You cannot abort near zombies!</English>
<Russian>Нельзя выходить находясь рядом с зомби!</Russian>
<Spanish>¡No puedes abortar cerca de zombies!</Spanish>
<Czech>Nemůžete ukončit hru, když jsou zombie poblíž.</Czech>