Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
fencekit.c
Go to the documentation of this file.
1
class
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
(
g_Game
.IsServer() )
24
{
25
//Create fence
26
27
Fence fence = Fence.Cast(
g_Game
.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(
g_Game
.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
}
ECE_PLACE_ON_SURFACE
const int ECE_PLACE_ON_SURFACE
Definition
centraleconomy.c:37
EntityAI
Definition
inventoryitem.c:2
ItemBase
Definition
inventoryitem.c:742
ItemBase::SetQuantity
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Definition
pileofwoodenplanks.c:88
KitBase
Definition
fencekit.c:2
KitBase::OnDebugSpawn
override void OnDebugSpawn()
Definition
fencekit.c:59
KitBase::DisassembleKit
override void DisassembleKit(ItemBase item)
Definition
fencekit.c:46
KitBase::OnPlacementComplete
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Definition
fencekit.c:19
KitBase::DoPlacingHeightCheck
override bool DoPlacingHeightCheck()
Definition
fencekit.c:36
KitBase::HeightCheckOverride
override float HeightCheckOverride()
Definition
fencekit.c:41
KitBase::CanReceiveAttachment
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Definition
fencekit.c:3
vector
Definition
enconvert.c:119
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
GetPosition
vector GetPosition()
Get the world position of the Effect.
Definition
effect.c:473
IsHologram
override bool IsHologram()
Definition
itembase.c:5885
Games
Dayz
scripts
4_world
entities
itembase
fencekit.c
Generated by
1.17.0