mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
* switchModel, jerry_fill, water_fill, drinkWater, packTent changes/fixes player_packTent: Add private array since there was none. Make it match player_packVault so a player can't pack the tent with others near (to stop duping) water_fill: Fixed the massive lag issue with the check for ponds etc, Originally was being done searching for all which is quite intensive, now only searching for waterholeproxy which matches all the water holes on chernarus I could try. Fixed a few localizations. Thanks @schwanzkopfhegel player_drinkWater: Same as above. Also removed a lot of unused private variables. jerry_fill: Made the minimum fill level of fuel tanks 10% of dayz_randomMaxFuelAmount so the tank will always have fuel Fixed issue with ItemFuelBarrel only using 40 litres from a tank. Thanks @schwanzkopfhegel Display how much fuel was needed if the tank is empty Fix issue if the tank was empty that dayz_actionInProgress was not reset player_switchModel: Fixed issue of coins dissapearing on gear change Fixed old commented out code that was broken so now you will go back into the camera view you were in before you changed clothes * Revert drinkWater/water_fill changes My previous commit can only be used on chernarus since it's the only map that has the waterholeproxy we rely on. * crafting localization fix * Update german translations * Rework * Missed private variable * Rework again * Update german string
91 lines
2.9 KiB
Plaintext
91 lines
2.9 KiB
Plaintext
/*
|
|
[_obj] call player_packTent;
|
|
*/
|
|
if (dayz_actionInProgress) exitWith {localize "str_player_beingpacked" call dayz_rollingMessages;};
|
|
dayz_actionInProgress = true;
|
|
|
|
private ["_activatingPlayer","_alreadyPacking","_backpacks","_bag","_campItems","_countr","_dir","_holder","_magazines","_obj","_objWpnQty","_objWpnTypes","_objectID","_objectUID","_ownerID","_packobj","_playerNear","_pos","_weapons"];
|
|
|
|
_obj = _this;
|
|
_ownerID = _obj getVariable["CharacterID","0"];
|
|
_objectID = _obj getVariable["ObjectID","0"];
|
|
_objectUID = _obj getVariable["ObjectUID","0"];
|
|
if (DZE_permanentPlot) then {
|
|
_ownerID = _obj getVariable["ownerPUID","0"];
|
|
};
|
|
|
|
_playerNear = _obj call dze_isnearest_player;
|
|
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_16" call dayz_rollingMessages;};
|
|
|
|
_packobj = getText (configFile >> "CfgVehicles" >> typeOf _obj >> "pack");
|
|
_activatingPlayer = player;
|
|
|
|
player removeAction s_player_packtent;
|
|
s_player_packtent = -1;
|
|
player removeAction s_player_packtentinfected;
|
|
s_player_packtentinfected = -1;
|
|
|
|
_campItems = ["IC_DomeTent","IC_Tent"];
|
|
|
|
if (_ownerID in [dayz_characterID,dayz_playerUID] or typeOf _obj in _campItems) then {
|
|
player playActionNow "Medic";
|
|
_alreadyPacking = _obj getVariable["packing",0];
|
|
if (_alreadyPacking == 1) exitWith {localize "str_player_beingpacked" call dayz_rollingMessages; dayz_actionInProgress = false;};
|
|
|
|
_obj setVariable["packing",1];
|
|
_dir = direction _obj;
|
|
_pos = getPosATL _obj;
|
|
|
|
[player,"tentpack",0,false,20] call dayz_zombieSpeak;
|
|
[player,20,true,getPosATL player] call player_alertZombies;
|
|
uiSleep 3;
|
|
|
|
//place tent (local)
|
|
_bag = createVehicle [_packobj, _pos, [], 0, "CAN_COLLIDE"];
|
|
_bag setDir _dir;
|
|
player reveal _bag;
|
|
|
|
_holder = createVehicle ["WeaponHolder", _pos, [], 0, "CAN_COLLIDE"];
|
|
|
|
_weapons = getWeaponCargo _obj;
|
|
_magazines = getMagazineCargo _obj;
|
|
_backpacks = getBackpackCargo _obj;
|
|
|
|
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer];
|
|
publicVariableServer "PVDZ_obj_Destroy";
|
|
|
|
if (isServer) then {PVDZ_obj_Destroy call server_deleteObj;};
|
|
deleteVehicle _obj;
|
|
|
|
//Add weapons
|
|
_objWpnTypes = _weapons select 0;
|
|
_objWpnQty = _weapons select 1;
|
|
_countr = 0;
|
|
{
|
|
_holder addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
|
|
_countr = _countr + 1;
|
|
} count _objWpnTypes;
|
|
|
|
//Add Magazines
|
|
_objWpnTypes = _magazines select 0;
|
|
_objWpnQty = _magazines select 1;
|
|
_countr = 0;
|
|
{
|
|
_holder addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
|
|
_countr = _countr + 1;
|
|
} count _objWpnTypes;
|
|
|
|
//Add Backpacks
|
|
_objWpnTypes = _backpacks select 0;
|
|
_objWpnQty = _backpacks select 1;
|
|
_countr = 0;
|
|
{
|
|
_holder addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
|
|
_countr = _countr + 1;
|
|
} count _objWpnTypes;
|
|
|
|
localize "str_success_tent_pack" call dayz_rollingMessages;
|
|
} else {
|
|
localize "str_fail_tent_pack" call dayz_rollingMessages;
|
|
};
|
|
dayz_actionInProgress = false; |