mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Add toggleable salivals Take Clothes to Epoch Core
This also adds the option to disable taking clothes for certain clothing.
This commit is contained in:
45
SQF/dayz_code/actions/takeClothes.sqf
Normal file
45
SQF/dayz_code/actions/takeClothes.sqf
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
Originally by Zabn
|
||||
Modified for DayZ Epoch 1.0.7+ by salival (https://github.com/oiad)
|
||||
*/
|
||||
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
private ["_body","_clothesTaken","_finished","_itemNew","_itemNewName","_okSkin","_playerNear","_result","_skin"];
|
||||
|
||||
_body = _this select 3;
|
||||
|
||||
player removeAction s_player_clothes;
|
||||
s_player_clothes = -1;
|
||||
|
||||
if (isNull _body) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
|
||||
|
||||
_playerNear = {isPlayer _x} count (([_body] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1;
|
||||
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;};
|
||||
|
||||
_clothesTaken = _body getVariable["clothesTaken",false];
|
||||
if (_clothesTaken) exitWith {dayz_actionInProgress = false; localize "STR_CL_TC_ALREADY_TAKEN" call dayz_rollingMessages;};
|
||||
|
||||
_skin = typeOf _body;
|
||||
_itemNew = _skin;
|
||||
_itemNew = "Skin_" + _itemNew;
|
||||
_okSkin = isClass (configFile >> "CfgMagazines" >> _itemNew);
|
||||
|
||||
if (!_okSkin || _skin in DZE_Disable_Take_Clothes) exitWith {dayz_actionInProgress = false; format[localize "STR_CL_TC_NOT_SUPPORTED",_skin] call dayz_rollingMessages;};
|
||||
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
if (_finished) then {
|
||||
_itemNewName = getText (configFile >> "CfgMagazines" >> _itemNew >> "displayName");
|
||||
_result = [player,_itemNew] call BIS_fnc_invAdd;
|
||||
if (_result) then {
|
||||
_body setVariable["clothesTaken",true,true];
|
||||
format[localize "STR_CL_TC_ADD_OK",_itemNewName] call dayz_rollingMessages;
|
||||
} else {
|
||||
format[localize "STR_CL_TC_ADD_FAIL",_itemNewName] call dayz_rollingMessages;
|
||||
};
|
||||
} else {
|
||||
localize "str_epoch_player_26" call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
dayz_actionInProgress = false;
|
||||
@@ -789,23 +789,18 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis
|
||||
} else {
|
||||
player removeAction s_player_fillgen;
|
||||
s_player_fillgen = -1;
|
||||
};
|
||||
|
||||
//Towing with tow truck
|
||||
/*
|
||||
if(_typeOfCursorTarget == "TOW_DZE") then {
|
||||
if (s_player_towing < 0) then {
|
||||
if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
|
||||
s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_ATTACH" "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true];
|
||||
} else {
|
||||
s_player_towing = player addAction [localize "STR_EPOCH_ACTIONS_DETACH", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true];
|
||||
};
|
||||
|
||||
if (DZE_Take_Clothes) then {
|
||||
if (_isMan && !_isAlive && !_isZombie && {!(_cursorTarget isKindOf "Animal")} && {!(_cursorTarget getVariable["clothesTaken",false])} && {_typeOfCursorTarget in AllPlayers} && {!(_typeOfCursorTarget in DZE_Disable_Take_Clothes)}) then {
|
||||
if (s_player_clothes < 0) then {
|
||||
s_player_clothes = player addAction [format["<t color='#0059FF'>%1</t>",localize "STR_CL_TC_TAKE_CLOTHES"],"\z\addons\dayz_code\actions\takeClothes.sqf",_cursorTarget,0, false,true];
|
||||
};
|
||||
} else {
|
||||
player removeAction s_player_clothes;
|
||||
s_player_clothes = -1;
|
||||
};
|
||||
} else {
|
||||
player removeAction s_player_towing;
|
||||
s_player_towing = -1;
|
||||
};
|
||||
*/
|
||||
};
|
||||
|
||||
// ZSC
|
||||
if (Z_singleCurrency) then {
|
||||
@@ -1079,6 +1074,8 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis
|
||||
s_bank_dialog3 = -1;
|
||||
player removeAction s_player_checkWallet;
|
||||
s_player_checkWallet = -1;
|
||||
player removeAction s_player_clothes;
|
||||
s_player_clothes = -1;
|
||||
};
|
||||
|
||||
//Dog actions on player self
|
||||
|
||||
@@ -161,6 +161,10 @@ if (!isDedicated) then {
|
||||
dayz_matchboxCount = false; // Enable match stick count. After five uses matches run out and must be replaced.
|
||||
dayz_waterBottleBreaking = false; // Water bottles have a chance to break when boiling and require duct tape to fix
|
||||
|
||||
// Take Clothes
|
||||
DZE_Take_Clothes = false; // Allows to take the clothing from dead players and AIs
|
||||
DZE_Disable_Take_Clothes = []; // Enter the skins you do not want to be allowed to be recovered from dead bodies. E.g.: DZE_Disable_Take_Clothes = ["Doctor_DZ","Assistant_DZ","Worker1_DZ"];
|
||||
|
||||
/*
|
||||
DZE_CLICK_ACTIONS
|
||||
This is where you register your right-click actions
|
||||
@@ -192,7 +196,7 @@ if (!isDedicated) then {
|
||||
];
|
||||
};
|
||||
|
||||
DZE_LocateVehicle = true; // Enable/Disable the option to locate a vehicle from a key in the inventory with a rightclick on the GPS.
|
||||
DZE_LocateVehicle = false; // Enable/Disable the option to locate a vehicle from a key in the inventory with a rightclick on the GPS.
|
||||
|
||||
if (DZE_LocateVehicle) then {
|
||||
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [
|
||||
|
||||
@@ -207,6 +207,7 @@ if (!isDedicated) then {
|
||||
s_bank_dialog2 = -1;
|
||||
s_bank_dialog3 = -1;
|
||||
s_player_checkWallet = -1;
|
||||
s_player_clothes = -1;
|
||||
};
|
||||
call dayz_resetSelfActions;
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user