GunSafe Scripts + Configs

This commit is contained in:
He-Man 2019-02-28 23:04:21 +01:00
parent 8c38f75901
commit 804673e8bb
13 changed files with 129 additions and 19 deletions

View File

@ -0,0 +1,47 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors:
Description:
Run scheduled animations on objects
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/functions/EPOCH_fnc_AnimateScheduled.sqf
Example:
[
_object, // object
[ // animationarray
['door1',1],
['door2',1],
['handle1',1],
['handle2',1]
],
[0,1,0] // delays
] remoteexec ['EPOCH_fnc_AnimateScheduled',_player];
Parameter(s):
_this select 0: OBJ - Object for the animations
_this select 1: ARRAY - Array of animations and their final state
_this select 2: ARRAY - Array of delays between each animation
Returns:
NOTHING
*/
private ["_ins","_target"];
params [["_object",objnull], ["_animarray",[]], ["_delays",[]]];
if (isnull _object) exitwith {};
if !(_animarray isEqualType []) exitwith {};
if !(_delays isEqualType []) exitwith {};
{
if (_x isEqualType []) then {
_x params [["_animation",""],["_state",0]];
_object animate [_animation,_state];
uisleep (_delays param [_foreachindex,0]);
};
} foreach _animarray;

View File

@ -131,14 +131,14 @@ class lock_lockbox
}; };
class unlock_safe class unlock_safe
{ {
condition = "(dyna_cursorTargetType in ['Safe_EPOCH','SafeProxy_EPOCH']) && (dyna_cursorTarget getVariable ['EPOCH_Locked',false])"; condition = "(dyna_cursorTargetType in ['Safe_EPOCH','SafeProxy_EPOCH','GunSafe_EPOCH']) && (dyna_cursorTarget getVariable ['EPOCH_Locked',false])";
action = "dyna_cursorTarget call Epoch_secureStorageHandler"; action = "dyna_cursorTarget call Epoch_secureStorageHandler";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\pad_can_unlock.paa"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\pad_can_unlock.paa";
tooltip = "Unlock Safe"; tooltip = "Unlock Safe";
}; };
class lock_safe class lock_safe
{ {
condition = "(dyna_cursorTargetType in ['Safe_EPOCH','SafeProxy_EPOCH']) && !(dyna_cursorTarget getVariable ['EPOCH_Locked',false])"; condition = "(dyna_cursorTargetType in ['Safe_EPOCH','SafeProxy_EPOCH','GunSafe_EPOCH']) && !(dyna_cursorTarget getVariable ['EPOCH_Locked',false])";
action = "dyna_cursorTarget call Epoch_secureStorageHandler"; action = "dyna_cursorTarget call Epoch_secureStorageHandler";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\pad_cannot_lock.paa"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\pad_cannot_lock.paa";
tooltip = "Lock Safe"; tooltip = "Lock Safe";
@ -154,7 +154,7 @@ class pack_lockbox
}; };
class pack_safe class pack_safe
{ {
condition = "(dyna_cursorTargetType in ['Safe_EPOCH','SafeProxy_EPOCH']) && (dyna_cursorTarget getVariable ['EPOCH_Locked',false])"; condition = "(dyna_cursorTargetType in ['Safe_EPOCH','SafeProxy_EPOCH','GunSafe_EPOCH']) && (dyna_cursorTarget getVariable ['EPOCH_Locked',false])";
action = "[dyna_cursorTarget,player,Epoch_personalToken] remoteExec ['EPOCH_server_packStorage',2];"; action = "[dyna_cursorTarget,player,Epoch_personalToken] remoteExec ['EPOCH_server_packStorage',2];";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\build_pack.paa"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\build_pack.paa";
tooltip = "Pack Safe"; tooltip = "Pack Safe";

View File

@ -1375,6 +1375,21 @@ class CfgBaseBuilding
{ {
returnOnPack[] = {}; returnOnPack[] = {};
}; };
class GunSafe_EPOCH : Default
{
returnOnPack[] = {{"ItemGunSafe",1}};
simulClass = "GunSafe_SIM_EPOCH";
staticClass = "GunSafe_EPOCH";
weaponHolderProxy = "SafeProxy_EPOCH";
GhostPreview = "GunSafe_EPOCH";
bypassJammer = 1;
limitNearby = 2;
isSecureStorage = 1;
};
class GunSafe_SIM_EPOCH : GunSafe_EPOCH
{
returnOnPack[] = {};
};
class Jack_EPOCH : Default class Jack_EPOCH : Default
{ {
simulClass = "Jack_SIM_EPOCH"; simulClass = "Jack_SIM_EPOCH";

View File

@ -171,6 +171,7 @@ class CfgClientFunctions
class fnc_setVariableLimited {}; class fnc_setVariableLimited {};
class fnc_createLocalMarkerSet {}; class fnc_createLocalMarkerSet {};
class fnc_deleteLocalMarkerSet {}; class fnc_deleteLocalMarkerSet {};
class fnc_AnimateScheduled {};
}; };
class environment class environment
{ {

View File

@ -249,6 +249,10 @@ class CfgItemInteractions
{ {
buildClass = "Safe_SIM_EPOCH"; buildClass = "Safe_SIM_EPOCH";
}; };
class ItemGunSafe : Item_Build_base
{
buildClass = "GunSafe_SIM_EPOCH";
};
class JackKit : Item_Build_base class JackKit : Item_Build_base
{ {
buildClass = "Jack_SIM_EPOCH"; buildClass = "Jack_SIM_EPOCH";

View File

@ -1151,6 +1151,7 @@ class CfgItemSort
"ItemLockbox", "ItemLockbox",
"Pelt_EPOCH", "Pelt_EPOCH",
"ItemSafe", "ItemSafe",
"ItemGunSafe",
"ItemSolar", "ItemSolar",
"ItemCables", "ItemCables",
"ItemBattery", "ItemBattery",

View File

@ -330,6 +330,11 @@ class CfgPricing
price = 1250; price = 1250;
tax = 0.5; tax = 0.5;
}; };
class ItemGunSafe
{
price = 1250;
tax = 0.5;
};
class ItemCompass class ItemCompass
{ {
price = 3; price = 3;

View File

@ -53,6 +53,11 @@ if (isText _staticClassConfig) then {
if (getNumber(_cfgBaseBuilding >> _staticClass >> "isSecureStorage") == 1) then{ if (getNumber(_cfgBaseBuilding >> _staticClass >> "isSecureStorage") == 1) then{
_storageObj setVariable["EPOCH_Locked", false, true]; _storageObj setVariable["EPOCH_Locked", false, true];
if (_storageObj isKindOf "GunSafe_EPOCH") then {
{
_storageObj animate [_x,1];
} foreach ["door1","door2","handle1","handle2"];
};
}; };
_storageObj setVariable["STORAGE_OWNERS", [_playerUID]]; _storageObj setVariable["STORAGE_OWNERS", [_playerUID]];

View File

@ -27,6 +27,10 @@ _playerGroup = _player getVariable["GROUP", ""];
_fnc_Lock_Unlock = { _fnc_Lock_Unlock = {
_locked = !_locked; _locked = !_locked;
_unit setVariable ["EPOCH_Locked", _locked, true]; _unit setVariable ["EPOCH_Locked", _locked, true];
if (_unit iskindof "GunSafe_EPOCH") then {
_animations = if (_locked) then {[['door1',0],['door2',0],['handle1',0],['handle2',0]]} else {[['handle1',1],['handle2',1],['door1',1],['door2',1]]};
[_unit,_animations,[0,1,0]] remoteexec ['EPOCH_fnc_AnimateScheduled',_player];
};
_LockStateChanged = true; _LockStateChanged = true;
}; };

View File

@ -80,6 +80,13 @@ class CfgLootTable
{ { "FAK", "magazine" }, 20 } { { "FAK", "magazine" }, 20 }
}; };
}; };
class Safes
{
items[] = {
{ { "ItemSafe", "magazine" }, 1 },
{ { "ItemGunSafe", "magazine" }, 1 }
};
};
class Repairs class Repairs
{ {
items[] = { items[] = {
@ -331,7 +338,7 @@ class CfgLootTable
{ { "ItemBattery", "magazine" }, 5 }, { { "ItemBattery", "magazine" }, 5 },
{ { "ItemCables", "magazine" }, 5 }, { { "ItemCables", "magazine" }, 5 },
{ { "ItemPipe", "magazine" }, 5 }, { { "ItemPipe", "magazine" }, 5 },
{ { "ItemSafe", "magazine" }, 1 }, { { "Safes", "CfgLootTable" }, 1 },
{ { "ItemBarrelE", "magazine" }, 1 } { { "ItemBarrelE", "magazine" }, 1 }
@ -342,7 +349,7 @@ class CfgLootTable
{ {
items[] = { items[] = {
{ { "VehicleDocs", "CfgLootTable" }, 4 }, { { "VehicleDocs", "CfgLootTable" }, 4 },
{ { "ItemSafe", "magazine" }, 1 }, { { "Safes", "CfgLootTable" }, 1 },
{ { "ItemLockbox", "magazine" }, 4 }, { { "ItemLockbox", "magazine" }, 4 },
{ { "jerrycan_epoch", "magazine" }, 5 }, { { "jerrycan_epoch", "magazine" }, 5 },
{ { "CircuitParts", "magazine" }, 6 }, { { "CircuitParts", "magazine" }, 6 },
@ -1001,7 +1008,7 @@ class CfgLootTable
{ { "KitCinderWall", "magazine" }, 5 }, { { "KitCinderWall", "magazine" }, 5 },
{ { "KitFoundation", "magazine" }, 5 }, { { "KitFoundation", "magazine" }, 5 },
{ { "KitWoodFoundation", "magazine" }, 14 }, { { "KitWoodFoundation", "magazine" }, 14 },
{ { "ItemSafe", "magazine" }, 1 } { { "Safes", "CfgLootTable" }, 1 }
}; };
}; };
@ -1014,7 +1021,7 @@ class CfgLootTable
{ { "BaseBuilding", "CfgLootTable" }, 20 }, { { "BaseBuilding", "CfgLootTable" }, 20 },
{ { "GenericLarge", "CfgLootTable" }, 24 }, { { "GenericLarge", "CfgLootTable" }, 24 },
{ { "ItemLockbox", "magazine" }, 4 }, { { "ItemLockbox", "magazine" }, 4 },
{ { "ItemSafe", "magazine" }, 1 }, { { "Safes", "CfgLootTable" }, 1 },
{ { "Generic", "CfgLootTable" }, 10 }, { { "Generic", "CfgLootTable" }, 10 },
{ { "Tools", "CfgLootTable" }, 19 } { { "Tools", "CfgLootTable" }, 19 }
}; };

View File

@ -80,6 +80,13 @@ class CfgLootTable_CUP
{ { "FAK", "magazine" }, 20 } { { "FAK", "magazine" }, 20 }
}; };
}; };
class Safes
{
items[] = {
{ { "ItemSafe", "magazine" }, 1 },
{ { "ItemGunSafe", "magazine" }, 1 }
};
};
class Repairs class Repairs
{ {
items[] = { items[] = {
@ -424,7 +431,7 @@ class CfgLootTable_CUP
{ { "ItemBattery", "magazine" }, 5 }, { { "ItemBattery", "magazine" }, 5 },
{ { "ItemCables", "magazine" }, 5 }, { { "ItemCables", "magazine" }, 5 },
{ { "ItemPipe", "magazine" }, 5 }, { { "ItemPipe", "magazine" }, 5 },
{ { "ItemSafe", "magazine" }, 1 }, { { "Safes", "CfgLootTable" }, 1 },
{ { "ItemBarrelE", "magazine" }, 1 } { { "ItemBarrelE", "magazine" }, 1 }
}; };
}; };
@ -433,7 +440,7 @@ class CfgLootTable_CUP
{ {
items[] = { items[] = {
{ { "VehicleDocs", "CfgLootTable" }, 4 }, { { "VehicleDocs", "CfgLootTable" }, 4 },
{ { "ItemSafe", "magazine" }, 1 }, { { "Safes", "CfgLootTable" }, 1 },
{ { "ItemLockbox", "magazine" }, 4 }, { { "ItemLockbox", "magazine" }, 4 },
{ { "jerrycan_epoch", "magazine" }, 5 }, { { "jerrycan_epoch", "magazine" }, 5 },
{ { "CircuitParts", "magazine" }, 6 }, { { "CircuitParts", "magazine" }, 6 },
@ -1550,7 +1557,7 @@ class CfgLootTable_CUP
{ { "KitCinderWall", "magazine" }, 5 }, { { "KitCinderWall", "magazine" }, 5 },
{ { "KitFoundation", "magazine" }, 5 }, { { "KitFoundation", "magazine" }, 5 },
{ { "KitWoodFoundation", "magazine" }, 14 }, { { "KitWoodFoundation", "magazine" }, 14 },
{ { "ItemSafe", "magazine" }, 1 } { { "Safes", "CfgLootTable" }, 1 }
}; };
}; };
@ -1563,7 +1570,7 @@ class CfgLootTable_CUP
{ { "BaseBuilding", "CfgLootTable" }, 20 }, { { "BaseBuilding", "CfgLootTable" }, 20 },
{ { "GenericLarge", "CfgLootTable" }, 24 }, { { "GenericLarge", "CfgLootTable" }, 24 },
{ { "ItemLockbox", "magazine" }, 4 }, { { "ItemLockbox", "magazine" }, 4 },
{ { "ItemSafe", "magazine" }, 1 }, { { "Safes", "CfgLootTable" }, 1 },
{ { "Generic", "CfgLootTable" }, 10 }, { { "Generic", "CfgLootTable" }, 10 },
{ { "Tools", "CfgLootTable" }, 19 } { { "Tools", "CfgLootTable" }, 19 }
}; };

View File

@ -80,6 +80,13 @@ class CfgLootTable_MAD
{ { "FAK", "magazine" }, 20 } { { "FAK", "magazine" }, 20 }
}; };
}; };
class Safes
{
items[] = {
{ { "ItemSafe", "magazine" }, 1 },
{ { "ItemGunSafe", "magazine" }, 1 }
};
};
class Repairs class Repairs
{ {
items[] = { items[] = {
@ -329,7 +336,7 @@ class CfgLootTable_MAD
{ { "ItemBattery", "magazine" }, 5 }, { { "ItemBattery", "magazine" }, 5 },
{ { "ItemCables", "magazine" }, 5 }, { { "ItemCables", "magazine" }, 5 },
{ { "ItemPipe", "magazine" }, 5 }, { { "ItemPipe", "magazine" }, 5 },
{ { "ItemSafe", "magazine" }, 1 }, { { "Safes", "CfgLootTable" }, 1 },
{ { "ItemBarrelE", "magazine" }, 1 } { { "ItemBarrelE", "magazine" }, 1 }
@ -340,7 +347,7 @@ class CfgLootTable_MAD
{ {
items[] = { items[] = {
{ { "VehicleDocs", "CfgLootTable" }, 4 }, { { "VehicleDocs", "CfgLootTable" }, 4 },
{ { "ItemSafe", "magazine" }, 1 }, { { "Safes", "CfgLootTable" }, 1 },
{ { "ItemLockbox", "magazine" }, 4 }, { { "ItemLockbox", "magazine" }, 4 },
{ { "jerrycan_epoch", "magazine" }, 5 }, { { "jerrycan_epoch", "magazine" }, 5 },
{ { "CircuitParts", "magazine" }, 6 }, { { "CircuitParts", "magazine" }, 6 },
@ -990,7 +997,7 @@ class CfgLootTable_MAD
{ { "KitCinderWall", "magazine" }, 5 }, { { "KitCinderWall", "magazine" }, 5 },
{ { "KitFoundation", "magazine" }, 5 }, { { "KitFoundation", "magazine" }, 5 },
{ { "KitWoodFoundation", "magazine" }, 14 }, { { "KitWoodFoundation", "magazine" }, 14 },
{ { "ItemSafe", "magazine" }, 1 } { { "Safes", "CfgLootTable" }, 1 }
}; };
}; };
@ -1003,7 +1010,7 @@ class CfgLootTable_MAD
{ { "BaseBuilding", "CfgLootTable" }, 20 }, { { "BaseBuilding", "CfgLootTable" }, 20 },
{ { "GenericLarge", "CfgLootTable" }, 24 }, { { "GenericLarge", "CfgLootTable" }, 24 },
{ { "ItemLockbox", "magazine" }, 4 }, { { "ItemLockbox", "magazine" }, 4 },
{ { "ItemSafe", "magazine" }, 1 }, { { "Safes", "CfgLootTable" }, 1 },
{ { "Generic", "CfgLootTable" }, 10 }, { { "Generic", "CfgLootTable" }, 10 },
{ { "Tools", "CfgLootTable" }, 19 } { { "Tools", "CfgLootTable" }, 19 }
}; };

View File

@ -80,6 +80,13 @@ class CfgLootTable_MADCUP
{ { "FAK", "magazine" }, 20 } { { "FAK", "magazine" }, 20 }
}; };
}; };
class Safes
{
items[] = {
{ { "ItemSafe", "magazine" }, 1 },
{ { "ItemGunSafe", "magazine" }, 1 }
};
};
class Repairs class Repairs
{ {
items[] = { items[] = {
@ -424,7 +431,7 @@ class CfgLootTable_MADCUP
{ { "ItemBattery", "magazine" }, 5 }, { { "ItemBattery", "magazine" }, 5 },
{ { "ItemCables", "magazine" }, 5 }, { { "ItemCables", "magazine" }, 5 },
{ { "ItemPipe", "magazine" }, 5 }, { { "ItemPipe", "magazine" }, 5 },
{ { "ItemSafe", "magazine" }, 1 }, { { "Safes", "CfgLootTable" }, 1 },
{ { "ItemBarrelE", "magazine" }, 1 } { { "ItemBarrelE", "magazine" }, 1 }
}; };
}; };
@ -433,7 +440,7 @@ class CfgLootTable_MADCUP
{ {
items[] = { items[] = {
{ { "VehicleDocs", "CfgLootTable" }, 4 }, { { "VehicleDocs", "CfgLootTable" }, 4 },
{ { "ItemSafe", "magazine" }, 1 }, { { "Safes", "CfgLootTable" }, 1 },
{ { "ItemLockbox", "magazine" }, 4 }, { { "ItemLockbox", "magazine" }, 4 },
{ { "jerrycan_epoch", "magazine" }, 5 }, { { "jerrycan_epoch", "magazine" }, 5 },
{ { "CircuitParts", "magazine" }, 6 }, { { "CircuitParts", "magazine" }, 6 },
@ -1557,7 +1564,7 @@ class CfgLootTable_MADCUP
{ { "KitCinderWall", "magazine" }, 5 }, { { "KitCinderWall", "magazine" }, 5 },
{ { "KitFoundation", "magazine" }, 5 }, { { "KitFoundation", "magazine" }, 5 },
{ { "KitWoodFoundation", "magazine" }, 14 }, { { "KitWoodFoundation", "magazine" }, 14 },
{ { "ItemSafe", "magazine" }, 1 } { { "Safes", "CfgLootTable" }, 1 }
}; };
}; };
@ -1570,7 +1577,7 @@ class CfgLootTable_MADCUP
{ { "BaseBuilding", "CfgLootTable" }, 20 }, { { "BaseBuilding", "CfgLootTable" }, 20 },
{ { "GenericLarge", "CfgLootTable" }, 24 }, { { "GenericLarge", "CfgLootTable" }, 24 },
{ { "ItemLockbox", "magazine" }, 4 }, { { "ItemLockbox", "magazine" }, 4 },
{ { "ItemSafe", "magazine" }, 1 }, { { "Safes", "CfgLootTable" }, 1 },
{ { "Generic", "CfgLootTable" }, 10 }, { { "Generic", "CfgLootTable" }, 10 },
{ { "Tools", "CfgLootTable" }, 19 } { { "Tools", "CfgLootTable" }, 19 }
}; };