DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ImprovisedSuppressor.c
См. документацию.
1class ImprovisedSuppressor extends SuppressorBase
2{
3
4 const int SLOTS_ARRAY = 9;
5
6 string slot_names[SLOTS_ARRAY] = { /*"weaponMuzzleAK", */"weaponBayonetAK", "weaponBayonet", "weaponBayonetMosin", "weaponBayonetSKS",/* "weaponMuzzleM4",*/ "weaponMuzzleMosin", /*"pistolMuzzle",*/ "weaponMuzzleMP5" };
7
8
9 override bool CanPutAsAttachment( EntityAI parent )
10 {
11 bool cond_state = true;
12 if (!super.CanPutAsAttachment(parent))
13 return false;
14
15 for ( int i = 0; i < SLOTS_ARRAY ; i++ )
16 {
17 if (parent.IsSlotReserved(InventorySlots.GetSlotIdFromString(slot_names[i])))
18 {
19 cond_state = false;
20 break;
21 }
22
23 if ( parent.FindAttachmentBySlotName(slot_names[i]) != NULL )
24 {
25 cond_state = false;
26 break;
27 }
28 }
29
30 if ( cond_state && !parent.IsKindOf("PlateCarrierHolster") && !parent.IsKindOf("PlateCarrierComplete") && !parent.IsKindOf("CarrierHolsterSolo") && !parent.IsKindOf("ChestHolster") )
31 {
32 return true;
33 }
34 return false;
35 }
36}
Определения Building.c:6
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
provides access to slot configuration
Определения InventorySlots.c:6
const int SLOTS_ARRAY
Определения ImprovisedSuppressor.c:4
override bool CanPutAsAttachment(EntityAI parent)
Определения ImprovisedSuppressor.c:9
string slot_names[SLOTS_ARRAY]
Определения ImprovisedSuppressor.c:6