55 {
56 if ( !target )
57 return false;
58
61
62 array<int> compLock = ItemBaseType.Cast(item.GetEntityType()).m_CompatibleLocks;
64
65 if ( target_IB && parent_EAI )
66 {
67
68
69 CarDoor targetDoor = CarDoor.Cast(target_IB);
70 if ( targetDoor )
71 {
72 InventoryLocation loc = new InventoryLocation();
73 bool isPresent = targetDoor.GetInventory().GetCurrentInventoryLocation( loc );
74
75 if ( !isPresent || loc.
GetSlot() == -1 )
76 return false;
77
80 return false;
81 }
82
83
84
85 bool hasConstruction = parent_EAI.CanUseConstruction();
86 bool isPlayerInside = parent_EAI.IsPlayerInsideEx(player, "");
87 if (hasConstruction && !isPlayerInside)
88 return false;
89
90
92 if (codeLock)
93 {
94 array<string> selections = new array<string>;
95 codeLock.GetActionComponentNameList(target.GetComponentIndex(), selections);
96
97 foreach (string selectionName : selections)
98 {
100 return false;
101 }
102 }
103
104 if ( target_IB.IsLockedInSlot() )
106 else if ( target_IB.IsAlive() )
108 else if ( !target_IB.IsLockedInSlot() )
109 return false;
110
111 targetType = target_IB.GetLockType();
112
113 for (int i = 0; i < compLock.Count(); i++)
114 {
115 if ( targetType == compLock[i] && targetType !=
eLockTypes.NONE)
116 {
117 return true;
118 }
119 }
120 }
121 return false;
122 }
PlayerSpawnPreset slotName
class GP5GasMask extends MaskBase ItemBase
const string CODE_LOCK_SELECTION_BACK
const string UNLOCK_VERSION
const string LOCK_VERSION
proto native int GetSlot()
returns slot id if current type is Attachment