DayZ 1.24
Loading...
Searching...
No Matches
AnalyticsManagerClient.c
Go to the documentation of this file.
2{
3 static const int GEAR_COUNT = 3;
4 static string m_FullGear[GEAR_COUNT] = {"Shoulder", "Melee", "Back"};
5
11
17
18 //===================================
19 // OnActionEat
20 //===================================
22 {
24 }
25
26 //===================================
27 // OnActionDrink
28 //===================================
33
34 //===================================
35 // OnActionCookedSteak - not implemented
36 //===================================
41
42 //===================================
43 // OnActionFinishedShaveSelf
44 //===================================
49
50 //===================================
51 // OnActionFinishedGutDeer
52 //===================================
57
58 //===================================
59 // OnActionRestrain
60 //===================================
65
66 //===================================
67 // OnActionBandageTarget
68 //===================================
73
74 //===================================
75 // OnItemAttachedAtPlayer
76 //===================================
78 {
79 bool weapon_present;
80 bool melee_present;
83
84 if (GetDayZGame().GetGameState() != DayZGameState.IN_GAME)
85 return;
86
87 Man player = GetGame().GetPlayer();
88 if (!player)
89 return;
90
91 inventory = player.GetHumanInventory();
92
93 if (player && inventory)
94 {
95 for (int i = 0; i < GEAR_COUNT; ++i)
96 {
98 EntityAI att_item = inventory.FindAttachment(slot_id); // Boris V [27.2.2019]: Consider using player.GetItemOnSlot(m_FullGear[i]) instead.
99
100 if (!att_item)
101 {
102 //Print("index: "+ i +" slot_id: "+ slot_id +" = "+ att_item + " EMPTY");
103 continue;
104 }
105
106 //checks for firearm
107 if (att_item.IsWeapon())
108 weapon_present = true;
109 //checks for melee weapon
110 else if (!att_item.IsWeapon() && att_item.GetInventory().HasInventorySlot(InventorySlots.GetSlotIdFromString("Melee")))
111 melee_present = true;
112 //checks for backpack
113 else if (!att_item.IsWeapon() && att_item.GetInventory().HasInventorySlot(InventorySlots.GetSlotIdFromString("Back")))
114 backpack_present = true;
115 //Print("index: "+ i +" slot_id: "+ slot_id +" = "+ att_item + " ATTACHED");
116 }
117
118 //separate check for hand slot; TODO remove duplicates
119 att_item = inventory.GetEntityInHands();
120 if (att_item)
121 {
122 //checks for firearm
123 if (att_item.IsWeapon())
124 weapon_present = true;
125 //checks for melee weapon
126 else if (!att_item.IsWeapon() && att_item.GetInventory().HasInventorySlot(InventorySlots.GetSlotIdFromString("Melee")))
127 melee_present = true;
128 //checks for backpack
129 else if (!att_item.IsWeapon() && att_item.GetInventory().HasInventorySlot(InventorySlots.GetSlotIdFromString("Back")))
130 backpack_present = true;
131 }
132
134 {
135 //Print("---EAchievementActionId.ACTION_EQUIP_GEAR");
137 }
138 }
139 }
140
141 //===================================
142 // Event_OnPlayerIgnitedFireplace
143 //===================================
145 {
146 switch (ignite_type)
147 {
148 case EFireIgniteType.Matchbox:
149 {
151 break;
152 }
153 case EFireIgniteType.Roadflare:
154 {
156 break;
157 }
158 case EFireIgniteType.HandDrill:
159 {
161 break;
162 }
163 }
164 }
165
166 //===================================
167 // Event_OnEntityKilled
168 //===================================
174}
DayZGame GetDayZGame()
Definition DayZGame.c:3530
EFireIgniteType
int GetID()
Get the ID registered in SEffectManager.
Definition Effect.c:517
PlayerBase GetPlayer()
static void OnActionIgniteRoadflare()
static void OnCookedSteak()
static void OnActionDrink()
static void OnActionIgniteMatchbox()
static void OnActionIgniteDrill()
static void OnActionHandcuff()
static void OnActionMedsSurvivor()
static void OnActionEat()
static void OnEquippedFullGear()
static void OnActionGutDeer()
static void OnActionShave()
static void OnPlayerKilled(EntityAI victim, EntityAI killer, EntityAI source, bool is_headshot)
static string m_FullGear[GEAR_COUNT]
void Event_OnEntityKilled(EntityAI victim, EntityAI killer, EntityAI source, bool is_headshot)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
void Event_OnPlayerIgnitedFireplace(EFireIgniteType ignite_type)
static ref ScriptInvoker SyncEvent_OnPlayerIgnitedFireplace
Definition ClientData.c:5
static ref ScriptInvoker SyncEvent_OnEntityKilled
Definition ClientData.c:4
inventory for plain man/human
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
proto native CGame GetGame()