1.8.7 player_switchWeapon updates

This commit is contained in:
ebaydayz
2016-03-03 21:31:32 -05:00
parent e660704f97
commit 479097e7a8
37 changed files with 1883 additions and 202 deletions

View File

@@ -38,6 +38,27 @@ if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
s_player_removeflare = -1;
};
if (s_player_equip_carry < 0) then
{
if (dayz_onBack != "" && { !_inVehicle && { !_onLadder && { !r_player_unconscious } } }) then
{
dz_plr_carryActionItem = dayz_onBack;
_text = getText (configFile >> "CfgWeapons" >> dz_plr_carryActionItem >> "displayName");
s_player_equip_carry = player addAction [
format [localize "STR_ACTIONS_WEAPON", _text],
"\z\addons\dayz_code\actions\player_switchWeapon_action.sqf",
nil, 0.5, false, true];
};
}
else
{
if (dayz_onBack != dz_plr_carryActionItem || { _inVehicle || { _onLadder || { r_player_unconscious } } } ) then
{
player removeAction s_player_equip_carry;
s_player_equip_carry = -1;
};
};
if (_inVehicle && {_vehicleOwnerID != "0"} && {!(_vehicle isKindOf "Bicycle")}) then {
if (s_player_lockUnlockInside_ctrl < 0) then {
DZE_myVehicle = _vehicle;

View File

@@ -44,15 +44,15 @@ if (isNil "keyboard_keys") then {
_handled = true;
};
_rifle = {
["rifle"] spawn player_switchWeapon;
2 call dz_fn_switchWeapon;
_handled = true;
};
_pistol = {
["pistol"] spawn player_switchWeapon;
3 call dz_fn_switchWeapon;
_handled = true;
};
_melee = {
["melee"] spawn player_switchWeapon;
4 call dz_fn_switchWeapon;
_handled = true;
};
_throwable = { // select next non empty throwable weapon
@@ -74,7 +74,7 @@ if (isNil "keyboard_keys") then {
};
} forEach getArray(configFile >> "cfgWeapons" >> _weapon >> _muzz >> "magazines");
} forEach _muzzles;
} forEach [ "Flare", "Throw" ];
} forEach [ "Throw"];
_magCount = count _ammo_throwable;
if (_magCount > 0) then {