Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scriptName "Functions\misc\fn_selfActions.sqf";
- /***********************************************************
- ADD ACTIONS FOR SELF
- - Function
- - [] call fnc_usec_selfActions;
- ************************************************************/
- private ["_buildOwner","_nearestBuilding","_nearestBuildList","_originHousing","_isWreckBuilding","_temp_keys","_magazinesPlayer","_isPZombie","_vehicle","_inVehicle","_hasFuelE","_hasRawMeat","_hasKnife","_hasToolbox","_onLadder","_nearLight","_canPickLight","_canDo","_text","_isHarvested","_isVehicle","_isVehicletype","_isMan","_traderType","_ownerID","_isAnimal","_isDog","_isZombie","_isDestructable","_isTent","_isFuel","_isAlive","_Unlock","_lock","_buy","_dogHandle","_lieDown","_warn","_hastinitem","_allowedDistance","_menu","_menu1","_humanity_logic","_low_high","_cancel","_metals_trader","_traderMenu","_isWreck","_isRemovable","_isDisallowRepair","_rawmeat","_humanity","_speed","_dog","_hasbottleitem","_isAir","_isShip","_playersNear","_findNearestGens","_findNearestGen","_IsNearRunningGen","_cursorTarget","_isnewstorage","_itemsPlayer","_ownerKeyId","_typeOfCursorTarget","_hasKey","_oldOwner","_combi","_key_colors","_player_deleteBuild","_player_flipveh","_player_lockUnlock_crtl","_player_butcher","_player_studybody","_player_cook","_player_boil","_hasFuelBarrelE","_hasHotwireKit","_player_SurrenderedGear","_isSurrendered","_isModular","_isModularDoor","_ownerKeyName","_temp_keys_names","_hasAttached","_allowTow","_liftHeli","_found","_posL","_posC","_height","_liftHelis","_attached"];
- IF (DZE_ActionInProgress) exitWith {}; // Do NOT allow IF any script IS running.
- _vehicle = vehicle player;
- _isPZombie = player isKindOf "PZombie_VB";
- _inVehicle = (_vehicle != player);
- _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
- _canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
- _adminsList= CALL compile preProcessFileLineNumbers "superadmins.sqf";
- IF(("Cobalt_File" IN items player) AND ((getPlayerUID player) IN _adminsList)) THEN {
- IF (s_player_run_events < 0) THEN {
- s_player_run_events = player addaction [("<t color=""#0074E8"">" + ("Events Menu") +"</t>"),"custom\fixes\execute.sqf","",5,FALSE,TRUE,"",""];
- };
- } ELSE {
- player removeAction s_player_run_events;
- s_player_run_events = -1;
- };
- _nearLight = nearestObject [player,"LitObject"];
- _canPickLight = FALSE;
- IF (!isNull _nearLight) THEN {
- IF (_nearLight distance player < 4) THEN {
- _canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
- };
- };
- //Grab Flare
- IF (_canPickLight && !dayz_hasLight && !_isPZombie) THEN {
- IF (s_player_grabflare < 0) THEN {
- _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
- s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, FALSE, TRUE, "", ""];
- s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, FALSE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_player_grabflare;
- player removeAction s_player_removeflare;
- s_player_grabflare = -1;
- s_player_removeflare = -1;
- };
- IF (_inVehicle && {_vehicle isKindOf "MV22"}) THEN {
- IF (isEngineOn _vehicle) THEN {[_vehicle,0] CALL mv22_pack;};
- IF (mv22_fold < 0) THEN {
- themv22 = _vehicle;
- IF !(isEngineOn themv22) THEN {
- mv22_fold = themv22 addAction ["Fold","scripts\animate\mv22_fold.sqf","",5,FALSE,TRUE];
- mv22_unfold = themv22 addAction ["UnFold","scripts\animate\mv22_unfold.sqf","",5,FALSE,TRUE];
- mv22_open = themv22 addAction ["Open Ramp","scripts\animate\mv22_open.sqf","",5,FALSE,TRUE];
- mv22_close = themv22 addAction ["Close Ramp","scripts\animate\mv22_close.sqf","",5,FALSE,TRUE];
- };
- };
- IF (isEngineOn themv22) THEN {
- themv22 removeAction mv22_fold;
- mv22_fold = -1;
- themv22 removeAction mv22_unfold;
- mv22_unfold = -1;
- themv22 removeAction mv22_open;
- mv22_open = -1;
- themv22 removeAction mv22_close;
- mv22_close = -1;
- };
- } ELSE {
- IF (!isNil "themv22") THEN {
- themv22 removeAction mv22_fold;
- mv22_fold = -1;
- themv22 removeAction mv22_unfold;
- mv22_unfold = -1;
- themv22 removeAction mv22_open;
- mv22_open = -1;
- themv22 removeAction mv22_close;
- mv22_close = -1;
- };
- };
- IF (_inVehicle && {_vehicle isKindOf "ArmoredSUV_Base_PMC"}) THEN {
- IF ((_vehicle animationPhase "HideGun_01") == 1) THEN {
- _unit = _vehicle turretUnit [0];
- IF (!(isNull _unit)) THEN {
- _unit action ["moveToCargo",_vehicle,2];
- titleText ["\n\nYou must open the hatch first.","PLAIN DOWN"];titleFadeOut 4;
- };
- };
- IF (suv_close < 0) THEN {
- thesuv = _vehicle;
- suv_close = thesuv addAction ["Close Hatch","scripts\animate\suv_close.sqf","",5,FALSE,TRUE];
- suv_open = thesuv addAction ["Open Hatch","scripts\animate\suv_open.sqf","",5,FALSE,TRUE];
- };
- } ELSE {
- IF (!isNil "thesuv") THEN {
- thesuv removeAction suv_close;
- suv_close = -1;
- thesuv removeAction suv_open;
- suv_open = -1;
- };
- };
- IF (DZE_HeliLift) THEN {
- _hasAttached = _vehicle getVariable["hasAttached",FALSE];
- IF(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] CALL FNC_getPos) SELECT 2) < 30) && (speed _vehicle < 5) && (typeName _hasAttached == "OBJECT")) THEN {
- IF (s_player_heli_detach < 0) THEN {
- dayz_myLiftVehicle = _vehicle;
- s_player_heli_detach = dayz_myLiftVehicle addAction ["Detach Vehicle","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,FALSE,TRUE,"",""];
- };
- } ELSE {
- dayz_myLiftVehicle removeAction s_player_heli_detach;
- s_player_heli_detach = -1;
- };
- };
- IF(DZE_HaloJump) THEN {
- IF(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] CALL FNC_getPos) SELECT 2) > 400)) THEN {
- IF (s_halo_action < 0) THEN {
- DZE_myHaloVehicle = _vehicle;
- s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,FALSE,TRUE,"",""];
- };
- } ELSE {
- DZE_myHaloVehicle removeAction s_halo_action;
- s_halo_action = -1;
- };
- };
- IF (!DZE_ForceNameTagsOff) THEN {
- IF (s_player_showname < 0 && !_isPZombie) THEN {
- IF (DZE_ForceNameTags) THEN {
- s_player_showname = 1;
- player setVariable["DZE_display_name",TRUE,TRUE];
- } ELSE {
- s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",TRUE, 0, TRUE, FALSE, "",""];
- s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",FALSE, 0, TRUE, FALSE, "",""];
- };
- };
- };
- IF(DZE_Origins_Building_System) THEN {
- IF(isnil "s_player_build_origins_house") THEN {s_player_build_origins_house = -1;};
- IF(isnil "s_player_build_origins_garage") THEN {s_player_build_origins_garage = -1;};
- IF(isnil "s_player_build_origins_stronghold") THEN {s_player_build_origins_stronghold = -1;};
- IF(isnil "s_player_origins_unlock") THEN {s_player_origins_unlock = -1;};
- IF(isnil "s_player_origins_stronghold_doors") THEN {s_player_origins_stronghold_doors = -1;};
- _cursorTarget = cursorTarget;
- IF (!isNull _cursorTarget) THEN {
- _typeOfCursorTarget = (typeOf _cursorTarget);
- IF(_typeOfCursorTarget == DZE_Origins_Container ) THEN {
- IF((player distance _cursorTarget) < DZE_Origins_Build_Distance) THEN {
- private["_humanity","_playerUID","_hasLevel1","_hasLevel2","_hasLevel3","_hasSG","_hasLG","_hasKING","_hasSH","_canBuildHouse","_houselevel","_humanityNeed","_actionText","_classname","_neededMaterials","_canBuildSH","_canBuildGarage"];
- _humanity = player getVariable["humanity",0];
- _playerUID = dayz_playerUID;
- _hasLevel1 = (_playerUID IN owner_H1 || _playerUID IN owner_B1);
- _hasLevel2 = (_playerUID IN owner_H2 || _playerUID IN owner_B2);
- _hasLevel3 = (_playerUID IN owner_H3 || _playerUID IN owner_B3);
- _hasSG = (_playerUID IN owner_SG);
- _hasLG = (_playerUID IN owner_LG);
- _hasKING = (_playerUID IN owner_KING);
- _hasSH = (_playerUID IN owner_SH);
- {
- _houselevel = _x SELECT 0;
- _humanityNeed = _x SELECT 1;
- _actionText = _x SELECT 2;
- _classname = _x SELECT 3;
- _neededMaterials = _x SELECT 4;
- _canBuildHouse = FALSE;
- _canBuildGarage = FALSE;
- _canBuildSH = FALSE;
- IF((_humanityNeed > 0 && _humanity >= _humanityNeed) || (_humanityNeed < 0 && _humanity <= _humanityNeed)) THEN {
- IF(_houselevel IN ["H1","B1"] && !_hasLevel1) THEN {
- _canBuildHouse = TRUE;
- };
- IF(_houselevel IN ["H2","B2"] && !_hasLevel2) THEN {
- _canBuildHouse = TRUE;
- };
- IF(_houselevel IN ["H3","B3"] && !_hasLevel3) THEN {
- _canBuildHouse = TRUE;
- };
- IF(_houselevel IN ["SGH","SGB"] && _hasLevel1 && !_hasSG) THEN {
- _canBuildGarage = TRUE;
- };
- IF(_houselevel IN ["LGH","LGB"] && _hasLevel3 && !_hasLG) THEN {
- _canBuildGarage = TRUE;
- };
- IF(_houselevel IN ["KINGH","KINGB"] && _hasLevel3 && _hasLG && !_hasKING) THEN {
- _canBuildGarage = TRUE;
- };
- IF(_houselevel IN ["SHH","SHB"] && _hasLevel1 && _hasLevel2 && _hasLevel3 && !_hasSH) THEN {
- _canBuildSH = TRUE;
- };
- };
- IF(_canBuildHouse) THEN {
- IF(s_player_build_origins_house < 0) THEN {
- s_player_build_origins_house = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
- };
- };
- IF(_canBuildGarage) THEN {
- IF(s_player_build_origins_garage < 0) THEN {
- s_player_build_origins_garage = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
- };
- };
- IF(_canBuildSH) THEN {
- IF(s_player_build_origins_stronghold < 0) THEN {
- s_player_build_origins_stronghold = player addAction ["Build " + _actionText, "origins\player_build.sqf", [_cursorTarget, _houselevel, _classname, _neededMaterials, _actionText]];
- };
- };
- } forEach DZE_Origins_Build_HousesGarages;
- } ELSE {
- [1] CALL origins_removeActions;
- };
- };
- IF(_typeOfCursorTarget IN DZE_Origins_Buildings && (player distance _cursorTarget) < DZE_Origins_LockUnlock_Distance) THEN {
- private["_ownerUID","_ownerName","_playerUID","_state","_openClose"];
- _playerUID = dayz_playerUID;
- _ownerUID = _cursorTarget getVariable ["OwnerUID","0"];
- _ownerName = _cursorTarget getVariable ["OwnerName","0"];
- IF(_playerUID != _ownerUID && !(_typeOfCursorTarget IN DZE_Origins_Stronghold)) exitWith {
- cutText [format["This house was built by %1", _ownerName], "PLAIN DOWN",5];
- sleep 5;
- };
- _state = (_cursorTarget getVariable ["CanBeUpdated",FALSE]);
- IF(_typeOfCursorTarget IN DZE_Origins_Stronghold && _state) THEN {
- private["_strongholdDoorsOpen"];
- _strongholdDoorsOpen = (_cursorTarget getVariable ["DoorsOpen",FALSE]);
- IF(_strongholdDoorsOpen) THEN {
- IF(s_player_origins_stronghold_doors < 0) THEN {
- s_player_origins_stronghold_doors = player addAction [ "Close Doors","origins\origins_strongholdDoors.sqf",[_cursorTarget,0]];
- };
- } ELSE {
- IF(s_player_origins_stronghold_doors < 0)THEN {
- s_player_origins_stronghold_doors = player addAction [ "Open Doors","origins\origins_strongholdDoors.sqf",[_cursorTarget,1]];
- };
- };
- } ELSE {
- [3] CALL origins_removeActions;
- };
- IF(s_player_origins_unlock < 0) THEN {
- _matched = FALSE;
- {
- IF(_typeOfCursorTarget == (_x SELECT 0)) THEN {
- IF(_state) THEN {
- _openClose = format["Lock %1", _X SELECT 1];
- } ELSE {
- _openClose = format["Unlock %1", _X SELECT 1];
- };
- _matched = TRUE;
- };
- IF (_matched) exitWith {
- s_player_origins_unlock = player addAction [_openClose, "origins\player_lockUnlock.sqf", [_cursorTarget,_typeOfCursorTarget,_state]];
- };
- } COUNT DZE_Origins_NameLookup;
- };
- } ELSE {
- [2] CALL origins_removeActions;
- };
- } ELSE {
- [0] CALL origins_removeActions;
- };
- };
- //allow demolition OF Origins Housing
- IF (typeOf _vehicle =="ori_excavator") THEN
- {
- IF (bucketOut < 0) THEN {
- bucketOut = _vehicle addAction ["Bucket Out","custom\build\bucketOut.sqf","",5,FALSE,TRUE];
- };
- IF(bucketIn < 0) THEN {
- bucketIn = _vehicle addAction ["Bucket In","custom\build\bucketIn.sqf","",5,FALSE,TRUE];
- };
- _originHousing = DZE_Origins_Buildings;
- _nearestBuildList = nearestObjects [_vehicle, _originHousing, 20];
- _nearestBuilding = _nearestBuildList SELECT 0;
- _buildOwner = _nearestBuilding getVariable['OwnerUID','0'];
- IF(s_demolish == -1) THEN {
- IF (_buildOwner == (getplayerUID player)) THEN {
- s_demolish = _vehicle addaction [("<t color=""#ff0000"">" + format["Demolish %1",typeOf(_nearestBuilding)] +"</t>"),"custom\build\demolish.sqf",_nearestBuilding,6,FALSE,TRUE,"",""];
- sleep 5;
- };
- } ELSE {
- _vehicle removeAction s_demolish;
- s_demolish = -1;
- };
- } ELSE {
- _vehicle removeAction bucketIn;
- bucketIn = -1;
- _vehicle removeAction bucketOut;
- bucketOut = -1;
- _vehicle removeAction s_demolish;
- s_demolish = -1;
- };
- IF(_isPZombie) THEN {
- IF (s_player_callzombies < 0) THEN {
- s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, TRUE, FALSE, "",""];
- };
- IF (DZE_PZATTACK) THEN {
- CALL pz_attack;
- DZE_PZATTACK = FALSE;
- };
- IF (s_player_pzombiesvision < 0) THEN {
- s_player_pzombiesvision = player addAction [localize "STR_EPOCH_ACTIONS_NIGHTVIS", "\z\addons\dayz_code\actions\pzombie\pz_vision.sqf", [], 4, FALSE, TRUE, "nightVision", "_this == _target"];
- };
- IF (!isNull cursorTarget && (player distance cursorTarget < 3)) THEN { //Has SOME kind OF target
- _isAnimal = cursorTarget isKindOf "Animal";
- _isZombie = cursorTarget isKindOf "zZombie_base";
- _isHarvested = cursorTarget getVariable["meatHarvested",FALSE];
- _isMan = cursorTarget isKindOf "Man";
- // Pzombie Gut human corpse || animal
- IF (!alive cursorTarget && (_isAnimal || _isMan) && !_isZombie && !_isHarvested) THEN {
- IF (s_player_pzombiesfeed < 0) THEN {
- s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",cursorTarget, 3, TRUE, FALSE, "",""];
- };
- } ELSE {
- player removeAction s_player_pzombiesfeed;
- s_player_pzombiesfeed = -1;
- };
- } ELSE {
- player removeAction s_player_pzombiesfeed;
- s_player_pzombiesfeed = -1;
- };
- };
- // Increase distance ONLY IF AIR || SHIP
- _allowedDistance = 4;
- _isAir = cursorTarget isKindOf "Air";
- _isShip = cursorTarget isKindOf "Ship";
- IF(_isAir || _isShip) THEN {
- _allowedDistance = 8;
- };
- IF (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance cursorTarget < _allowedDistance) && _canDo) THEN { //Has SOME kind OF target
- // SET cursortarget TO variable
- _cursorTarget = cursorTarget;
- // GET typeof cursortarget once
- _typeOfCursorTarget = typeOf _cursorTarget;
- // hintsilent _typeOfCursorTarget;
- _isVehicle = _cursorTarget isKindOf "AllVehicles";
- _isVehicletype = _typeOfCursorTarget IN ["ATV_US_EP1","ATV_CZ_EP1"];
- _isnewstorage = _typeOfCursorTarget IN DZE_isNewStorage;
- // GET items && magazines ONLY once
- _magazinesPlayer = magazines player;
- //boiled Water
- _hasbottleitem = "ItemWaterbottle" IN _magazinesPlayer;
- _hastinitem = FALSE;
- {
- IF (_x IN _magazinesPlayer) THEN {
- _hastinitem = TRUE;
- };
- } COUNT boil_tin_cans;
- _hasFuelE = "ItemJerrycanEmpty" IN _magazinesPlayer;
- _hasFuelBarrelE = "ItemFuelBarrelEmpty" IN _magazinesPlayer;
- _hasHotwireKit = "ItemHotwireKit" IN _magazinesPlayer;
- _itemsPlayer = items player;
- _temp_keys = [];
- _temp_keys_names = [];
- // find available KEYS
- _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
- {
- IF (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) IN _key_colors) THEN {
- _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
- _ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
- _temp_keys_names SET [_ownerKeyId,_ownerKeyName];
- _temp_keys SET [COUNT _temp_keys,str(_ownerKeyId)];
- };
- } COUNT _itemsPlayer;
- _hasKnife = "ItemKnife" IN _itemsPlayer;
- _hasToolbox = "ItemToolbox" IN _itemsPlayer;
- _isMan = _cursorTarget isKindOf "Man";
- _traderType = _typeOfCursorTarget;
- _ownerID = _cursorTarget getVariable ["CharacterID","0"];
- _isAnimal = _cursorTarget isKindOf "Animal";
- _isDog = (_cursorTarget isKindOf "DZ_Pastor" || _cursorTarget isKindOf "DZ_Fin");
- _isZombie = _cursorTarget isKindOf "zZombie_base";
- _isDestructable = _cursorTarget isKindOf "BuiltItems";
- _isWreck = _typeOfCursorTarget IN DZE_isWreck;
- _isWreckBuilding = _typeOfCursorTarget IN DZE_isWreckBuilding;
- _isModular = _cursorTarget isKindOf "ModularItems";
- _isModularDoor = _typeOfCursorTarget IN ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ"];
- _isRemovable = _typeOfCursorTarget IN DZE_isRemovable;
- _isDisallowRepair = _typeOfCursorTarget IN ["M240Nest_DZ"];
- _isTent = _cursorTarget isKindOf "TentStorage";
- _isAlive = alive _cursorTarget;
- _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName");
- _rawmeat = meatraw;
- _hasRawMeat = FALSE;
- {
- IF (_x IN _magazinesPlayer) THEN {
- _hasRawMeat = TRUE;
- };
- } COUNT _rawmeat;
- _isFuel = FALSE;
- IF (_hasFuelE || _hasFuelBarrelE) THEN {
- {
- IF(_cursorTarget isKindOf _x) exitWith {_isFuel = TRUE;};
- } COUNT dayz_fuelsources;
- };
- // diag_log ("OWNERID = " + _ownerID + " CHARID = " + dayz_characterID + " " + str(_ownerID == dayz_characterID));
- // logic vars
- _player_flipveh = FALSE;
- _player_deleteBuild = FALSE;
- _player_lockUnlock_crtl = FALSE;
- IF (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) THEN {
- IF (s_player_plotManagement < 0) THEN {
- _adminList = ["76561197966087279","76561198038360592"]; // ADD admins here IF you admins TO able TO manage ALL plotpoles
- _owner = _cursorTarget getVariable ["CharacterID","0"];
- _friends = _cursorTarget getVariable ["plotfriends", []];
- _fuid = [];
- {
- _friendUID = _x SELECT 0;
- _fuid = _fuid + [_friendUID];
- } forEach _friends;
- _allowed = [_owner];
- _allowed = [_owner] + _adminList + _fuid;
- IF(_owner == dayz_characterID || (getPlayerUID player) IN _allowed)THEN{
- s_player_plotManagement = player addAction ["<t color='#0059FF'>Manage Plot</t>", "plotManagement\initPlotManagement.sqf", [], 5, FALSE];
- };
- };
- IF (s_player_maintain_area < 0) THEN {
- s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, FALSE];
- s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, FALSE];
- };
- } ELSE {
- player removeAction s_player_plotManagement;
- s_player_plotManagement = -1;
- player removeAction s_player_maintain_area;
- s_player_maintain_area = -1;
- player removeAction s_player_maintain_area_preview;
- s_player_maintain_area_preview = -1;
- };
- // CURSOR TARGET ALIVE
- IF(_isAlive) THEN {
- //Allow player TO DELETE objects
- IF(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding) THEN {
- IF(_hasToolbox && "ItemCrowbar" IN _itemsPlayer) THEN {
- _player_deleteBuild = TRUE;
- };
- };
- ///Allow owners TO DELETE modulars
- IF(_isModular) THEN {
- IF(_hasToolbox && "ItemCrowbar" IN _itemsPlayer) THEN {
- _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole SELECT 0];
- _IsNearPlot = COUNT (_findNearestPoles);
- _fuid = [];
- _allowed = [];
- IF(_IsNearPlot > 0)THEN{
- _thePlot = _findNearestPoles SELECT 0;
- _owner = _thePlot getVariable ["CharacterID","010"];
- _friends = _thePlot getVariable ["plotfriends", []];
- {
- _friendUID = _x SELECT 0;
- _fuid = _fuid + [_friendUID];
- } forEach _friends;
- _allowed = [_owner];
- _allowed = [_owner] + _fuid;
- IF (_owner == dayz_characterID || (getPlayerUID player) IN _allowed) THEN { // // IF u want that the object also belongs TO someone ON the plotpole.
- _player_deleteBuild = TRUE;
- };
- }ELSE{
- IF(_owner == dayz_characterID)THEN{
- _player_deleteBuild = TRUE;
- };
- };
- };
- };
- //Allow owners TO DELETE modular doors WITHOUT locks
- IF(_isModularDoor) THEN {
- IF(_hasToolbox && "ItemCrowbar" IN _itemsPlayer) THEN {
- _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole SELECT 0];
- _IsNearPlot = COUNT (_findNearestPoles);
- _fuid = [];
- _allowed = [];
- IF(_IsNearPlot > 0)THEN{
- _thePlot = _findNearestPoles SELECT 0;
- _owner = _thePlot getVariable ["CharacterID","010"];
- _friends = _thePlot getVariable ["plotfriends", []];
- {
- _friendUID = _x SELECT 0;
- _fuid = _fuid + [_friendUID];
- } forEach _friends;
- _allowed = [_owner];
- _allowed = [_owner] + _fuid;
- IF (_owner == dayz_characterID || (getPlayerUID player) IN _allowed) THEN { // // IF u want that the object also belongs TO someone ON the plotpole.
- _player_deleteBuild = TRUE;
- };
- }ELSE{
- IF(_owner == dayz_characterID)THEN{
- _player_deleteBuild = TRUE;
- };
- };
- };
- };
- // CURSOR TARGET VEHICLE
- IF(_isVehicle) THEN {
- //flip vehicle small vehicles BY your SELF && ALL other vehicles WITH help nearby
- IF (!(canmove _cursorTarget) && (player distance _cursorTarget >= 2) && (COUNT (crew _cursorTarget))== 0 && ((vectorUp _cursorTarget) SELECT 2) < 0.5) THEN {
- _playersNear = {isPlayer _x} COUNT (player nearEntities ["CAManBase", 6]);
- IF(_isVehicletype || (_playersNear >= 2)) THEN {
- _player_flipveh = TRUE;
- };
- };
- IF(!_isMan && _ownerID != "0" && !(_cursorTarget isKindOf "Bicycle")) THEN {
- _player_lockUnlock_crtl = TRUE;
- };
- };
- };
- IF(_player_deleteBuild) THEN {
- IF (s_player_deleteBuild < 0) THEN {
- s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_player_deleteBuild;
- s_player_deleteBuild = -1;
- };
- IF (DZE_HeliLift) THEN {
- _liftHeli = objNull;
- _found = FALSE;
- _allowTow = FALSE;
- IF ((COUNT (crew _cursorTarget)) == 0) THEN {
- {
- IF(!_allowTow) THEN {
- _allowTow = _cursorTarget isKindOf _x;
- };
- } COUNT DZE_HeliAllowToTow;
- };
- //diag_log format["CREW: %1 ALLOW: %2",(COUNT (crew _cursorTarget)),_allowTow];
- IF (_allowTow) THEN {
- _liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15];
- {
- IF(!_found) THEN {
- _posL = [_x] CALL FNC_getPos;
- _posC = [_cursorTarget] CALL FNC_getPos;
- _height = (_posL SELECT 2) - (_posC SELECT 2);
- _hasAttached = _x getVariable["hasAttached",FALSE];
- IF(_height < 15 && _height > 5 && (typeName _hasAttached != "OBJECT")) THEN {
- IF(((abs((_posL SELECT 0) - (_posC SELECT 0))) < 10) && ((abs((_posL SELECT 1) - (_posC SELECT 1))) < 10)) THEN {
- _liftHeli = _x;
- _found = TRUE;
- };
- };
- };
- } COUNT _liftHelis;
- };
- //diag_log format["HELI: %1 TARGET: %2",_found,_cursorTarget];
- _attached = _cursorTarget getVariable["attached",FALSE];
- IF(_found && _allowTow && _canDo && !locked _cursorTarget && !_isPZombie && (typeName _attached != "OBJECT")) THEN {
- IF (s_player_heli_lift < 0) THEN {
- s_player_heli_lift = player addAction ["Attach to Heli", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, FALSE, TRUE, "",""];
- };
- } ELSE {
- player removeAction s_player_heli_lift;
- s_player_heli_lift = -1;
- };
- };
- // Allow Owner TO LOCK && UNLOCK vehicle
- IF(_player_lockUnlock_crtl) THEN {
- IF (s_player_lockUnlock_crtl < 0) THEN {
- _hasKey = _ownerID IN _temp_keys;
- _oldOwner = (_ownerID == dayz_playerUID);
- IF(locked _cursorTarget) THEN {
- IF(_hasKey || _oldOwner) THEN {
- _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[_cursorTarget,(_temp_keys_names SELECT (parseNumber _ownerID))], 2, TRUE, TRUE, "", ""];
- s_player_lockunlock SET [COUNT s_player_lockunlock,_Unlock];
- s_player_lockUnlock_crtl = 1;
- } ELSE {
- IF(_hasHotwireKit) THEN {
- _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursorTarget, 2, TRUE, TRUE, "", ""];
- } ELSE {
- _Unlock = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_VEHLOCKED"], "",_cursorTarget, 2, TRUE, TRUE, "", ""];
- };
- s_player_lockunlock SET [COUNT s_player_lockunlock,_Unlock];
- s_player_lockUnlock_crtl = 1;
- };
- } ELSE {
- IF(_hasKey || _oldOwner) THEN {
- _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
- s_player_lockunlock SET [COUNT s_player_lockunlock,_lock];
- s_player_lockUnlock_crtl = 1;
- };
- };
- };
- } ELSE {
- {player removeAction _x} COUNT s_player_lockunlock;s_player_lockunlock = [];
- s_player_lockUnlock_crtl = -1;
- };
- IF(DZE_AllowForceSave) THEN {
- //Allow player TO force save
- IF((_isVehicle || _isTent) && !_isMan) THEN {
- IF (s_player_forceSave < 0) THEN {
- s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_player_forceSave;
- s_player_forceSave = -1;
- };
- };
- IF(DZE_AllowCargoCheck) THEN {
- IF((_isVehicle || _isTent || _isnewstorage || _typeOfCursorTarget IN DZE_Origins_Buildings) && _isAlive && !_isMan && !locked _cursorTarget) THEN { IF (s_player_checkGear < 0) THEN {
- s_player_checkGear = player addAction [localize "STR_EPOCH_PLAYER_CARGO", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_player_checkGear;
- s_player_checkGear = -1;
- };
- };
- //flip vehicle small vehicles BY your SELF && ALL other vehicles WITH help nearby
- IF(_player_flipveh) THEN {
- IF (s_player_flipveh < 0) THEN {
- s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_player_flipveh;
- s_player_flipveh = -1;
- };
- //Allow player TO fill jerrycan
- IF((_hasFuelE || _hasFuelBarrelE) && _isFuel) THEN {
- IF (s_player_fillfuel < 0) THEN {
- s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, FALSE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_player_fillfuel;
- s_player_fillfuel = -1;
- };
- // logic vars FOR addactions
- _player_butcher = FALSE;
- _player_studybody = FALSE;
- _player_SurrenderedGear = FALSE;
- IF ( cursorTarget isKindOf "GraveDZE") THEN {
- _player_studybody = TRUE;
- };
- // CURSOR TARGET NOT ALIVE
- IF (!_isAlive) THEN {
- // Gut animal/zed
- IF((_isAnimal || _isZombie) && _hasKnife) THEN {
- _isHarvested = _cursorTarget getVariable["meatHarvested",FALSE];
- IF (!_isHarvested) THEN {
- _player_butcher = TRUE;
- };
- };
- // Study body
- IF (_isMan && !_isZombie && !_isAnimal) THEN {
- _player_studybody = TRUE;
- }
- } ELSE {
- // unit alive
- // gear access ON surrendered player
- IF(_isMan && !_isZombie && !_isAnimal) THEN {
- _isSurrendered = _cursorTarget getVariable ["DZE_Surrendered",FALSE];
- IF (_isSurrendered) THEN {
- _player_SurrenderedGear = TRUE;
- };
- };
- };
- // Human Gut animal || zombie
- IF (_player_butcher) THEN {
- IF (s_player_butcher < 0) THEN {
- IF(_isZombie) THEN {
- s_player_butcher = player addAction [localize "STR_EPOCH_ACTIONS_GUTZOM", "\z\addons\dayz_code\actions\gather_zparts.sqf",_cursorTarget, 0, TRUE, TRUE, "", ""];
- } ELSE {
- s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",_cursorTarget, 3, TRUE, TRUE, "", ""];
- };
- };
- } ELSE {
- player removeAction s_player_butcher;
- s_player_butcher = -1;
- };
- // Study Body
- IF (_player_studybody) THEN {
- IF (s_player_studybody < 0) THEN {
- s_player_studybody = player addAction [("<t color=""#FF0000"">"+("Check Wallet") + "</t>"), "ZSC\actions\check_wallet.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- };
- } ELSE {
- player removeAction s_player_studybody;
- s_player_studybody = -1;
- };
- // logic vars
- _player_cook = FALSE;
- _player_boil = FALSE;
- // CURSOR TARGET IS FIRE
- IF (inflamed _cursorTarget) THEN {
- //Fireplace Actions CHECK
- IF (_hasRawMeat) THEN {
- _player_cook = TRUE;
- };
- // Boil water
- IF (_hasbottleitem && _hastinitem) THEN {
- _player_boil = TRUE;
- };
- };
- IF (_player_SurrenderedGear) THEN {
- IF (s_player_SurrenderedGear < 0) THEN {
- s_player_SurrenderedGear = player addAction [localize "STR_EPOCH_ACTIONS_GEAR", "\z\addons\dayz_code\actions\surrender_gear.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_player_SurrenderedGear;
- s_player_SurrenderedGear = -1;
- };
- //Fireplace Actions CHECK
- IF (_player_cook) THEN {
- IF (s_player_cook < 0) THEN {
- s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",_cursorTarget, 3, TRUE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_player_cook;
- s_player_cook = -1;
- };
- // Boil water
- IF (_player_boil) THEN {
- IF (s_player_boil < 0) THEN {
- s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursorTarget, 3, TRUE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_player_boil;
- s_player_boil = -1;
- };
- IF(_cursorTarget == dayz_hasFire) THEN {
- IF ((s_player_fireout < 0) && !(inflamed _cursorTarget) && (player distance _cursorTarget < 3)) THEN {
- s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- };
- } ELSE {
- player removeAction s_player_fireout;
- s_player_fireout = -1;
- };
- //Packing my tent
- IF(_isTent && (player distance _cursorTarget < 3)) THEN {
- IF (_ownerID == dayz_characterID) THEN {
- IF (s_player_packtent < 0) THEN {
- s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- };
- } ELSE {
- IF(("ItemJerrycan" IN _magazinesPlayer) && ("ItemMatchbox_DZE" IN weapons player)) THEN {
- IF (s_player_packtent < 0) THEN {
- s_player_packtent = player addAction [localize "STR_EPOCH_ACTIONS_DESTROYTENT", "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, TRUE, TRUE, "", ""];
- };
- };
- };
- } ELSE {
- player removeAction s_player_packtent;
- s_player_packtent = -1;
- };
- //Allow owner TO UNLOCK vault
- IF((_typeOfCursorTarget IN DZE_LockableStorage) && _ownerID != "0" && (player distance _cursorTarget < 3)) THEN {
- IF (s_player_unlockvault < 0) THEN {
- IF(_typeOfCursorTarget IN DZE_LockedStorage) THEN {
- IF(_ownerID == dayz_combination || _ownerID == dayz_playerUID) THEN {
- _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- s_player_combi SET [COUNT s_player_combi,_combi];
- } ELSE {
- _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- s_player_combi SET [COUNT s_player_combi,_combi];
- };
- s_player_unlockvault = 1;
- } ELSE {
- IF(_ownerID != dayz_combination && _ownerID != dayz_playerUID) THEN {
- _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- s_player_combi SET [COUNT s_player_combi,_combi];
- s_player_unlockvault = 1;
- };
- };
- };
- } ELSE {
- {player removeAction _x} COUNT s_player_combi;s_player_combi = [];
- s_player_unlockvault = -1;
- };
- IF(_typeOfCursorTarget IN ZSC_MoneyStorage && (player distance _cursorTarget < 5)) THEN {
- IF (s_bank_dialog < 0) THEN {
- s_bank_dialog = player addAction ["Money Storage", "ZSC\actions\bank_dialog.sqf",_cursorTarget, 3, TRUE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_bank_dialog;
- s_bank_dialog = -1;
- };
- // cars
- IF( _isVehicle && !_isMan &&_isAlive && !_isMan && !locked _cursorTarget && !(_cursorTarget isKindOf "Bicycle") && (player distance _cursorTarget < 5)) THEN {
- IF (s_bank_dialog2 < 0) THEN {
- s_bank_dialog2 = player addAction ["Money Storage", "ZSC\actions\bank_dialog.sqf",_cursorTarget, 3, TRUE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_bank_dialog2;
- s_bank_dialog2 = -1;
- };
- //Allow owner TO pack vault
- IF(_typeOfCursorTarget IN DZE_UnLockedStorage && _ownerID != "0" && (player distance _cursorTarget < 3)) THEN {
- IF (s_player_lockvault < 0) THEN {
- IF(_ownerID == dayz_combination || _ownerID == dayz_playerUID) THEN {
- s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- };
- };
- IF (s_player_packvault < 0 && (_ownerID == dayz_combination || _ownerID == dayz_playerUID)) THEN {
- s_player_packvault = player addAction [format["<t color='#ff0000'>%1</t>",(format[localize "STR_EPOCH_ACTIONS_PACK",_text])], "\z\addons\dayz_code\actions\vault_pack.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- };
- } ELSE {
- player removeAction s_player_packvault;
- s_player_packvault = -1;
- player removeAction s_player_lockvault;
- s_player_lockvault = -1;
- };
- //Player Deaths
- IF(_typeOfCursorTarget == "Info_Board_EP1") THEN {
- IF (s_player_information < 0) THEN {
- s_player_information = player addAction [localize "STR_EPOCH_ACTIONS_MURDERS", "\z\addons\dayz_code\actions\list_playerDeaths.sqf",[], 7, FALSE, TRUE, "",""];
- };
- } ELSE {
- player removeAction s_player_information;
- s_player_information = -1;
- };
- IF (_isMan AND _isAlive AND !_isZombie AND !_isAnimal AND !(_traderType IN serverTraders)) THEN {
- IF (s_givemoney_dialog < 0) THEN {
- s_givemoney_dialog = player addAction [format["Give Money to %1", (name _cursorTarget)], "ZSC\actions\give_player_dialog.sqf",_cursorTarget, 3, TRUE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_givemoney_dialog;
- s_givemoney_dialog = -1;
- };
- //Fuel Pump
- IF(_typeOfCursorTarget IN dayz_fuelpumparray) THEN {
- IF (s_player_fuelauto < 0) THEN {
- // CHECK IF Generator_DZ IS running WITHIN 30 meters
- _findNearestGens = nearestObjects [player, ["Generator_DZ"], 30];
- _findNearestGen = [];
- {
- IF (alive _x && (_x getVariable ["GeneratorRunning", FALSE])) THEN {
- _findNearestGen SET [(COUNT _findNearestGen),_x];
- };
- } COUNT _findNearestGens;
- _IsNearRunningGen = COUNT (_findNearestGen);
- // SHOW that pump needs POWER IF no generator nearby.
- IF(_IsNearRunningGen > 0) THEN {
- s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, FALSE, TRUE, "",""];
- } ELSE {
- s_player_fuelauto = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, FALSE, TRUE, "",""];
- };
- };
- } ELSE {
- player removeAction s_player_fuelauto;
- s_player_fuelauto = -1;
- };
- //Fuel Pump ON truck
- IF(_typeOfCursorTarget IN DZE_fueltruckarray && alive _cursorTarget) THEN {
- IF (s_player_fuelauto2 < 0) THEN {
- // SHOW that fuel truck pump needs POWER.
- IF(isEngineOn _cursorTarget) THEN {
- s_player_fuelauto2 = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- } ELSE {
- s_player_fuelauto2 = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_NEEDPOWER"], "",[], 0, FALSE, TRUE, "",""];
- };
- };
- } ELSE {
- player removeAction s_player_fuelauto2;
- s_player_fuelauto2 = -1;
- };
- // inplace upgrade tool
- IF ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) THEN {
- IF ((s_player_lastTarget SELECT 0) != _cursorTarget) THEN {
- IF (s_player_upgrade_build > 0) THEN {
- player removeAction s_player_upgrade_build;
- s_player_upgrade_build = -1;
- };
- };
- IF (s_player_upgrade_build < 0) THEN {
- // s_player_lastTarget = _cursorTarget;
- s_player_lastTarget SET [0,_cursorTarget];
- s_player_upgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_UPGRADE",_text], "custom\BuildVectors\action\player_upgrade.sqf",_cursorTarget, -1, FALSE, TRUE, "",""];
- };
- } ELSE {
- player removeAction s_player_upgrade_build;
- s_player_upgrade_build = -1;
- };
- // downgrade system
- IF((_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base") && (DZE_Lock_Door == _ownerID)) THEN {
- IF ((s_player_lastTarget SELECT 1) != _cursorTarget) THEN {
- IF (s_player_downgrade_build > 0) THEN {
- player removeAction s_player_downgrade_build;
- s_player_downgrade_build = -1;
- };
- };
- IF (s_player_downgrade_build < 0) THEN {
- s_player_lastTarget SET [1,_cursorTarget];
- s_player_downgrade_build = player addAction [format[localize "STR_EPOCH_ACTIONS_REMLOCK",_text], "custom\BuildVectors\action\player_buildingDowngrade.sqf",_cursorTarget, -2, FALSE, TRUE, "",""];
- };
- } ELSE {
- player removeAction s_player_downgrade_build;
- s_player_downgrade_build = -1;
- };
- // inplace maintenance tool
- IF((_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ") && (damage _cursorTarget >= DZE_DamageBeforeMaint)) THEN {
- IF ((s_player_lastTarget SELECT 2) != _cursorTarget) THEN {
- IF (s_player_maint_build > 0) THEN {
- player removeAction s_player_maint_build;
- s_player_maint_build = -1;
- };
- };
- IF (s_player_maint_build < 0) THEN {
- s_player_lastTarget SET [2,_cursorTarget];
- s_player_maint_build = player addAction [format[localize "STR_EPOCH_ACTIONS_MAINTAIN",_text], "\z\addons\dayz_code\actions\player_buildingMaint.sqf",_cursorTarget, -2, FALSE, TRUE, "",""];
- };
- } ELSE {
- player removeAction s_player_maint_build;
- s_player_maint_build = -1;
- };
- //START Generator
- IF(_cursorTarget isKindOf "Generator_DZ") THEN {
- IF (s_player_fillgen < 0) THEN {
- // CHECK IF NOT running
- IF((_cursorTarget getVariable ["GeneratorRunning", FALSE])) THEN {
- s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- } ELSE {
- // CHECK IF NOT filled && player has jerry.
- IF((_cursorTarget getVariable ["GeneratorFilled", FALSE])) THEN {
- s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- } ELSE {
- IF("ItemJerrycan" IN _magazinesPlayer) THEN {
- s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR3", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- };
- };
- };
- };
- } 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, "",""];
- };
- };
- } else {
- player removeAction s_player_towing;
- s_player_towing = -1;
- };
- */
- //Sleep
- IF(_isTent && _ownerID == dayz_characterID) THEN {
- IF ((s_player_sleep < 0) && (player distance _cursorTarget < 3)) THEN {
- s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, FALSE, TRUE, "",""];
- };
- } ELSE {
- player removeAction s_player_sleep;
- s_player_sleep = -1;
- };
- //Repairing Vehicles
- IF ((dayz_myCursorTarget != _cursorTarget) && _isVehicle && !_isMan && _hasToolbox && (damage _cursorTarget < 1) && !_isDisallowRepair) THEN {
- IF (s_player_repair_crtl < 0) THEN {
- dayz_myCursorTarget = _cursorTarget;
- _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, TRUE, FALSE, "",""];
- _menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, TRUE, FALSE, "",""];
- s_player_repairActions SET [COUNT s_player_repairActions,_menu];
- s_player_repairActions SET [COUNT s_player_repairActions,_menu1];
- s_player_repair_crtl = 1;
- } ELSE {
- {dayz_myCursorTarget removeAction _x} COUNT s_player_repairActions;s_player_repairActions = [];
- s_player_repair_crtl = -1;
- };
- };
- // ALL Traders
- IF (_isMan && !_isPZombie && _traderType IN serverTraders) THEN {
- IF (s_player_parts_crtl < 0) THEN {
- // GET humanity
- _humanity = player getVariable ["humanity",0];
- _traderMenu = CALL compile format["menu_%1;",_traderType];
- // diag_log ("TRADER = " + str(_traderMenu));
- _low_high = "low";
- _humanity_logic = FALSE;
- IF((_traderMenu SELECT 2) == "friendly") THEN {
- _humanity_logic = (_humanity < -5000);
- };
- IF((_traderMenu SELECT 2) == "hostile") THEN {
- _low_high = "high";
- _humanity_logic = (_humanity > -5000);
- };
- IF((_traderMenu SELECT 2) == "minorhero") THEN {
- _humanity_logic = (_humanity < 5000);
- };
- IF((_traderMenu SELECT 2) == "hero") THEN {
- _humanity_logic = (_humanity < 10000);
- };
- IF((_traderMenu SELECT 2) == "superhero") THEN {
- _humanity_logic = (_humanity < 20000);
- };
- IF(_humanity_logic) THEN {
- _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, TRUE, FALSE, "",""];
- s_player_parts SET [COUNT s_player_parts,_cancel];
- } ELSE {
- // Static Menu
- {
- //diag_log format["DEBUG TRADER: %1", _x];
- _buy = player addAction [format["Trade %1 %2 for %3 %4",(_x SELECT 3),(_x SELECT 5),(_x SELECT 2),(_x SELECT 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x SELECT 0),(_x SELECT 1),(_x SELECT 2),(_x SELECT 3),(_x SELECT 4),(_x SELECT 5),(_x SELECT 6)], (_x SELECT 7), TRUE, TRUE, "",""];
- s_player_parts SET [COUNT s_player_parts,_buy];
- } COUNT (_traderMenu SELECT 1);
- _buyV = player addAction ["<t color='#0059FF'>Advanced Trading</t>", "zupa\advancedTrading\init.sqf",(_traderMenu SELECT 0), 999, TRUE, FALSE, "",""];
- s_player_parts SET [COUNT s_player_parts,_buyV];
- // DATABASE menu
- _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu SELECT 0), 999, TRUE, FALSE, "",""];
- s_player_parts SET [COUNT s_player_parts,_buy];
- };
- s_player_parts_crtl = 1;
- };
- } ELSE {
- {player removeAction _x} COUNT s_player_parts;s_player_parts = [];
- s_player_parts_crtl = -1;
- };
- IF(dayz_tameDogs) THEN {
- //Dog
- IF (_isDog && _isAlive && (_hasRawMeat) && _ownerID == "0" && player getVariable ["dogID", 0] == 0) THEN {
- IF (s_player_tamedog < 0) THEN {
- s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\tame_dog.sqf", _cursorTarget, 1, FALSE, TRUE, "", ""];
- };
- } ELSE {
- player removeAction s_player_tamedog;
- s_player_tamedog = -1;
- };
- IF (_isDog && _ownerID == dayz_characterID && _isAlive) THEN {
- _dogHandle = player getVariable ["dogID", 0];
- IF (s_player_feeddog < 0 && _hasRawMeat) THEN {
- s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, FALSE, TRUE,"",""];
- };
- IF (s_player_waterdog < 0 && "ItemWaterbottle" IN _magazinesPlayer) THEN {
- s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, FALSE, TRUE,"",""];
- };
- IF (s_player_staydog < 0) THEN {
- _lieDown = _dogHandle getFSMVariable "_actionLieDown";
- IF (_lieDown) THEN { _text = "str_actions_liedog"; } ELSE { _text = "str_actions_sitdog"; };
- s_player_staydog = player addAction [localize _text,"\z\addons\dayz_code\actions\dog\stay.sqf", _dogHandle, 5, FALSE, TRUE,"",""];
- };
- IF (s_player_trackdog < 0) THEN {
- s_player_trackdog = player addAction [localize "str_actions_trackdog","\z\addons\dayz_code\actions\dog\track.sqf", _dogHandle, 4, FALSE, TRUE,"",""];
- };
- IF (s_player_barkdog < 0) THEN {
- s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, FALSE, TRUE,"",""];
- };
- IF (s_player_warndog < 0) THEN {
- _warn = _dogHandle getFSMVariable "_watchDog";
- IF (_warn) THEN { _text = (localize "str_epoch_player_247"); _warn = FALSE; } ELSE { _text = (localize "str_epoch_player_248"); _warn = TRUE; };
- s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, FALSE, TRUE,"",""];
- };
- IF (s_player_followdog < 0) THEN {
- s_player_followdog = player addAction [localize "str_actions_followdog","\z\addons\dayz_code\actions\dog\follow.sqf",[_dogHandle,TRUE], 6, FALSE, TRUE,"",""];
- };
- } ELSE {
- player removeAction s_player_feeddog;
- s_player_feeddog = -1;
- player removeAction s_player_waterdog;
- s_player_waterdog = -1;
- player removeAction s_player_staydog;
- s_player_staydog = -1;
- player removeAction s_player_trackdog;
- s_player_trackdog = -1;
- player removeAction s_player_barkdog;
- s_player_barkdog = -1;
- player removeAction s_player_warndog;
- s_player_warndog = -1;
- player removeAction s_player_followdog;
- s_player_followdog = -1;
- };
- };
- } ELSE {
- //Engineering
- player removeAction s_player_plotManagement;
- s_player_plotManagement = -1;
- {dayz_myCursorTarget removeAction _x} COUNT s_player_repairActions;s_player_repairActions = [];
- s_player_repair_crtl = -1;
- {player removeAction _x} COUNT s_player_combi;s_player_combi = [];
- dayz_myCursorTarget = objNull;
- s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
- {player removeAction _x} COUNT s_player_parts;s_player_parts = [];
- s_player_parts_crtl = -1;
- {player removeAction _x} COUNT s_player_lockunlock;s_player_lockunlock = [];
- s_player_lockUnlock_crtl = -1;
- player removeAction s_player_checkGear;
- s_player_checkGear = -1;
- player removeAction s_player_SurrenderedGear;
- s_player_SurrenderedGear = -1;
- //Others
- player removeAction s_player_maintain_area;
- s_player_maintain_area = -1;
- player removeAction s_player_maintain_area_preview;
- s_player_maintain_area_preview = -1;
- player removeAction s_player_forceSave;
- s_player_forceSave = -1;
- player removeAction s_player_flipveh;
- s_player_flipveh = -1;
- player removeAction s_player_sleep;
- s_player_sleep = -1;
- player removeAction s_player_deleteBuild;
- s_player_deleteBuild = -1;
- player removeAction s_player_butcher;
- s_player_butcher = -1;
- player removeAction s_player_cook;
- s_player_cook = -1;
- player removeAction s_player_boil;
- s_player_boil = -1;
- player removeAction s_player_fireout;
- s_player_fireout = -1;
- player removeAction s_player_packtent;
- s_player_packtent = -1;
- player removeAction s_player_fillfuel;
- s_player_fillfuel = -1;
- player removeAction s_player_studybody;
- s_player_studybody = -1;
- //Dog
- player removeAction s_player_tamedog;
- s_player_tamedog = -1;
- player removeAction s_player_feeddog;
- s_player_feeddog = -1;
- player removeAction s_player_waterdog;
- s_player_waterdog = -1;
- player removeAction s_player_staydog;
- s_player_staydog = -1;
- player removeAction s_player_trackdog;
- s_player_trackdog = -1;
- player removeAction s_player_barkdog;
- s_player_barkdog = -1;
- player removeAction s_player_warndog;
- s_player_warndog = -1;
- player removeAction s_player_followdog;
- s_player_followdog = -1;
- // vault
- player removeAction s_player_unlockvault;
- s_player_unlockvault = -1;
- player removeAction s_player_packvault;
- s_player_packvault = -1;
- player removeAction s_player_lockvault;
- s_player_lockvault = -1;
- player removeAction s_player_information;
- s_player_information = -1;
- player removeAction s_player_fillgen;
- s_player_fillgen = -1;
- player removeAction s_player_upgrade_build;
- s_player_upgrade_build = -1;
- player removeAction s_player_maint_build;
- s_player_maint_build = -1;
- player removeAction s_player_downgrade_build;
- s_player_downgrade_build = -1;
- player removeAction s_player_towing;
- s_player_towing = -1;
- player removeAction s_player_fuelauto;
- s_player_fuelauto = -1;
- player removeAction s_player_fuelauto2;
- s_player_fuelauto2 = -1;
- player removeAction s_givemoney_dialog;
- s_givemoney_dialog = -1;
- player removeAction s_bank_dialog;
- s_bank_dialog = -1;
- player removeAction s_bank_dialog2;
- s_bank_dialog2 = -1;
- };
- //Dog actions ON player SELF
- _dogHandle = player getVariable ["dogID", 0];
- IF (_dogHandle > 0) THEN {
- _dog = _dogHandle getFSMVariable "_dog";
- _ownerID = "0";
- IF (!isNull cursorTarget) THEN { _ownerID = cursorTarget getVariable ["CharacterID","0"]; };
- IF (_canDo && !_inVehicle && alive _dog && _ownerID != dayz_characterID) THEN {
- IF (s_player_movedog < 0) THEN {
- s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID", 0], 1, FALSE, TRUE, "", ""];
- };
- IF (s_player_speeddog < 0) THEN {
- _text = (localize "str_epoch_player_249");
- _speed = 0;
- IF (_dog getVariable ["currentSpeed",1] == 0) THEN { _speed = 1; _text = (localize "str_epoch_player_250"); };
- s_player_speeddog = player addAction [format[localize "str_actions_speeddog", _text], "\z\addons\dayz_code\actions\dog\speed.sqf",[player getVariable ["dogID", 0],_speed], 0, FALSE, TRUE, "", ""];
- };
- IF (s_player_calldog < 0) THEN {
- s_player_calldog = player addAction [localize "str_actions_calldog", "\z\addons\dayz_code\actions\dog\follow.sqf", [player getVariable ["dogID", 0], TRUE], 2, FALSE, TRUE, "", ""];
- };
- };
- } ELSE {
- player removeAction s_player_movedog;
- s_player_movedog = -1;
- player removeAction s_player_speeddog;
- s_player_speeddog = -1;
- player removeAction s_player_calldog;
- s_player_calldog = -1;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement