Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
handcuffslocked.c
Go to the documentation of this file.
1
class
RestrainingToolLocked
extends
ItemBase
2
{
3
void
~RestrainingToolLocked
()
4
{
5
PlayerBase
player =
PlayerBase
.Cast(GetHierarchyRootPlayer());
6
if
( player && player.IsRestrained() )
7
{
8
player.SetRestrained(
false
);
9
}
10
}
11
12
override
void
EEItemLocationChanged
(notnull
InventoryLocation
oldLoc, notnull
InventoryLocation
newLoc)
13
{
14
super.EEItemLocationChanged(oldLoc, newLoc);
15
16
if
(
g_Game
.IsServer() )
17
{
18
if
( oldLoc.IsValid() && oldLoc.GetParent() )
19
{
20
PlayerBase
old_player =
PlayerBase
.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
21
if
(old_player && old_player.IsRestrained())
22
{
23
old_player.SetRestrained(
false
);
24
}
25
}
26
}
27
28
if
( newLoc.IsValid() )
29
{
30
if
(newLoc.GetParent())
31
{
32
PlayerBase
player =
PlayerBase
.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
33
34
if
( player )
35
{
36
if
( newLoc.GetType() ==
InventoryLocationType
.HANDS )
37
{
38
if
( !player.IsRestrained() )
39
{
40
player.SetRestrained(
true
);
41
player.OnItemInHandsChanged();
42
}
43
44
if
(player.IsControlledPlayer())
45
player.OnRestrainStart();
46
}
47
}
48
}
49
}
50
51
if
(
g_Game
.IsServer() )
52
{
53
if
( newLoc.GetType() !=
InventoryLocationType
.HANDS )
54
{
55
if
(oldLoc.GetParent())
56
{
57
PlayerBase
old_p =
PlayerBase
.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
58
if
(old_p)
59
{
60
MiscGameplayFunctions.TransformRestrainItem(
this
, null, old_p, old_p);
61
return
;
62
}
63
}
64
65
Delete();
66
}
67
}
68
}
69
70
override
void
EEKilled
(
Object
killer)
71
{
72
super.EEKilled(killer);
73
74
InventoryLocation
inventoryLocation =
new
InventoryLocation
();
75
GetInventory().GetCurrentInventoryLocation(inventoryLocation);
76
if
(!inventoryLocation || !inventoryLocation.
IsValid
())
77
return
;
78
79
if
(inventoryLocation.
GetType
() ==
InventoryLocationType
.HANDS)
80
{
81
PlayerBase
player =
PlayerBase
.Cast(inventoryLocation.
GetParent
());
82
if
(player && player.IsRestrained())
83
{
84
player.SetRestrained(
false
);
85
MiscGameplayFunctions.TransformRestrainItem(
this
, null, player, player);
86
}
87
}
88
}
89
90
override
void
SetActions
()
91
{
92
super.SetActions();
93
94
AddAction
(
ActionUnrestrainSelf
);
95
}
96
}
97
98
class
HandcuffsLocked
extends
RestrainingToolLocked
99
{
100
}
101
102
class
RopeLocked
extends
RestrainingToolLocked
103
{
104
}
105
106
class
DuctTapeLocked
extends
RestrainingToolLocked
107
{
108
}
109
110
class
MetalWireLocked
extends
RestrainingToolLocked
111
{
112
}
113
114
class
BarbedWireLocked
extends
RestrainingToolLocked
115
{
116
}
AddAction
void AddAction(typename actionName)
Definition
advancedcommunication.c:220
ActionUnrestrainSelf
Definition
actionunrestrainself.c:49
InventoryLocation
InventoryLocation.
Definition
inventorylocation.c:30
InventoryLocation::GetParent
proto native EntityAI GetParent()
returns parent of current inventory location
InventoryLocation::IsValid
proto native bool IsValid()
verify current set inventory location
InventoryLocation::GetType
proto native int GetType()
returns type of InventoryLocation
ItemBase
Definition
inventoryitem.c:742
ItemBase::~RestrainingToolLocked
void ~RestrainingToolLocked()
Definition
handcuffslocked.c:3
ItemBase::EEKilled
override void EEKilled(Object killer)
Definition
handcuffslocked.c:70
ItemBase::EEItemLocationChanged
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
Definition
handcuffslocked.c:12
ItemBase::SetActions
override void SetActions()
Definition
handcuffslocked.c:90
Object
Definition
objecttyped.c:2
PlayerBase
Definition
playerbaseclient.c:2
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
InventoryLocationType
InventoryLocationType
types of Inventory Location
Definition
inventorylocation.c:4
Games
Dayz
scripts
4_world
entities
itembase
handcuffslocked.c
Generated by
1.17.0