DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
FenceKit.c
См. документацию.
1class FenceKit extends KitBase
2{
3 override bool CanReceiveAttachment(EntityAI attachment, int slotId)
4 {
5 if ( !super.CanReceiveAttachment(attachment, slotId) )
6 return false;
7
8 ItemBase att = ItemBase.Cast(GetInventory().FindAttachment(slotId));
9 if (att)
10 return false;
11
12 return true;
13 }
14
15 //================================================================
16 // ADVANCED PLACEMENT
17 //================================================================
18
19 override void OnPlacementComplete( Man player, vector position = "0 0 0", vector orientation = "0 0 0" )
20 {
21 super.OnPlacementComplete( player, position, orientation );
22
23 if ( GetGame().IsServer() )
24 {
25 //Create fence
26
27 Fence fence = Fence.Cast( GetGame().CreateObjectEx( "Fence", GetPosition(), ECE_PLACE_ON_SURFACE ) );
28 fence.SetPosition( position );
29 fence.SetOrientation( orientation );
30
31 //make the kit invisible, so it can be destroyed from deploy UA when action ends
32 HideAllSelections();
33 }
34 }
35
36 override bool DoPlacingHeightCheck()
37 {
38 return true;
39 }
40
41 override float HeightCheckOverride()
42 {
43 return 2.54;
44 }
45
46 override void DisassembleKit(ItemBase item)
47 {
48 if (!IsHologram())
49 {
50 ItemBase stick = ItemBase.Cast(GetGame().CreateObjectEx("WoodenStick",GetPosition(),ECE_PLACE_ON_SURFACE));
51 MiscGameplayFunctions.TransferItemProperties(this, stick);
52 stick.SetQuantity(2);
53 Rope rope = Rope.Cast(item);
54 CreateRope(rope);
55 }
56 }
57
58 //Debug menu Spawn Ground Special
59 override void OnDebugSpawn()
60 {
61 SpawnEntityOnGroundPos("Shovel", GetPosition());
62 SpawnEntityOnGroundPos("Hammer", GetPosition());
63 SpawnEntityOnGroundPos("Hammer", GetPosition());
64 SpawnEntityOnGroundPos("Pliers", GetPosition());
65
66 SpawnEntityOnGroundPos("WoodenLog", GetPosition());
67 SpawnEntityOnGroundPos("WoodenLog", GetPosition());
68 SpawnEntityOnGroundPos("Nail", GetPosition());
69 SpawnEntityOnGroundPos("CamoNet", GetPosition());
70 SpawnEntityOnGroundPos("BarbedWire", GetPosition());
71 SpawnEntityOnGroundPos("BarbedWire", GetPosition());
72 SpawnEntityOnGroundPos("MetalWire", GetPosition());
73 SpawnEntityOnGroundPos("CombinationLock", GetPosition());
74 SpawnEntityOnGroundPos("WoodenPlank", GetPosition());
75 SpawnEntityOnGroundPos("WoodenPlank", GetPosition());
76 SpawnEntityOnGroundPos("WoodenPlank", GetPosition());
77 SpawnEntityOnGroundPos("WoodenPlank", GetPosition());
78 }
79}
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
override bool IsHologram()
Определения ItemBase.c:5753
Определения Building.c:6
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Определения PileOfWoodenPlanks.c:88
Определения InventoryItem.c:731
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Определения FenceKit.c:3
override float HeightCheckOverride()
Определения FenceKit.c:41
override void DisassembleKit(ItemBase item)
Определения FenceKit.c:46
override void OnDebugSpawn()
Определения FenceKit.c:59
override bool DoPlacingHeightCheck()
Определения FenceKit.c:36
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Определения FenceKit.c:19
Определения FenceKit.c:2
Определения EnConvert.c:106
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9