DayZ 1.24
Loading...
Searching...
No Matches
ActionInstallSparkplug.c
Go to the documentation of this file.
1/*
2 This is a generic user action for attaching sparkplug on any EntityAI object. The receiver must have a "sparkplug" selection in its View Geometry that the action_data.m_Player can look at.
3*/
4
5
7{
9 {
10 }
11
18
19 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
20 {
21 EntityAI target_EAI = EntityAI.Cast(target.GetObject());
22 string selection = target_EAI.GetActionComponentName(target.GetComponentIndex());
23
24 if (selection == "sparkplug" && target_EAI.GetInventory().CanAddAttachment(item))
25 return true;
26
27 return false;
28 }
29
31 {
32 EntityAI target_EAI = EntityAI.Cast(action_data.m_Target.GetObject()); // cast to ItemBase
33 target_EAI.LocalTakeEntityAsAttachment(action_data.m_MainItem);
34 }
36 {
37 EntityAI target_EAI = EntityAI.Cast(action_data.m_Target.GetObject()); // cast to ItemBase
38 target_EAI.LocalTakeEntityAsAttachment(action_data.m_MainItem);
39 }
40};
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnExecuteServer(ActionData action_data)
override void OnExecuteClient(ActionData action_data)
const float DEFAULT