9 Transport trans = vehCommand.GetTransport();
12 if (!PlayerIsDriver(trans, player))
18 if (
Class.CastTo(car, trans))
20 return BatteryIsVital(car.GetBattery());
30 if (!pActionData.m_Player)
33 if (!pActionData.m_Car)
36 pActionData.m_Car.SetCarHornState(pState);
41 return trans.GetSeatAnimationType(trans.CrewMemberIndex(player)) ==
DayZPlayerConstants.VEHICLESEAT_DRIVER;
44 protected static bool BatteryIsVital(
ItemBase battery)
46 return battery && battery.GetHealthLevel(
"Health") <=
GameConstants.STATE_DAMAGED;
50 class CarHornActionReceiveData : ActionReciveData
69 m_CallbackClass = ActionCarHornShortCB;
119 super.OnUpdate(action_data);
122 if (carHornData.m_WasExecuted && carHornData.m_ActionNeedEnd)
125 carHornData.m_ActionNeedEnd =
false;
131 super.OnEndInput(action_data);
140 super.OnStart(action_data);
143 carHornData.m_ActionNeedEnd =
true;
144 carHornData.m_Car =
CarScript.Cast(action_data.m_Player.GetCommand_Vehicle().GetTransport());
149 super.OnStartServer(action_data);
157 super.OnEndServer(action_data);
165 super.WriteToContext(ctx, action_data);
169 ctx.Write(carHornData.m_ActionNeedEnd);
170 ctx.Write(carHornData.m_Car);
175 if (!action_recive_data)
177 action_recive_data =
new CarHornActionReceiveData();
180 super.ReadFromContext(ctx, action_recive_data);
183 if (!ctx.Read(needUpdate))
187 if (!ctx.Read(carScript))
190 CarHornActionReceiveData carHornReceivedData = CarHornActionReceiveData.Cast(action_recive_data);
191 carHornReceivedData.m_ActionNeedEnd = needUpdate;
192 carHornReceivedData.m_Car = carScript;
199 super.HandleReciveData(action_recive_data, action_data);
201 CarHornActionReceiveData carHornReceivedData = CarHornActionReceiveData.Cast(action_recive_data);
203 carHornData.m_ActionNeedEnd = carHornReceivedData.m_ActionNeedEnd;
204 carHornData.m_Car = carHornReceivedData.m_Car;
216 override bool HasTarget()
221 override bool HasProgress()
226 override bool CanBeUsedInVehicle()
231 override typename GetInputType()
236 override bool UseMainItem()
241 override void CreateConditionComponents()
259 override void OnUpdate(
ActionData action_data)
261 super.OnUpdate(action_data);
264 if (carHornData.m_ReciveEndInput && carHornData.m_ActionNeedEnd)
267 carHornData.m_ActionNeedEnd =
false;
271 override void OnEndInput(
ActionData action_data)
273 super.OnEndInput(action_data);
281 super.OnStart(action_data);
284 carHornData.m_ActionNeedEnd =
true;
285 carHornData.m_Car =
CarScript.Cast(action_data.m_Player.GetCommand_Vehicle().GetTransport());
288 override void OnStartServer(
ActionData action_data)
290 super.OnStartServer(action_data);
293 carHornData.m_ActionNeedEnd =
true;
297 override void OnEndServer(
ActionData action_data)
299 super.OnEndServer(action_data);
307 super.WriteToContext(ctx, action_data);
311 ctx.Write(carHornData.m_ActionNeedEnd);
312 ctx.Write(carHornData.m_Car);
315 override bool ReadFromContext(
ParamsReadContext ctx, out ActionReciveData action_recive_data)
317 if (!action_recive_data)
319 action_recive_data =
new CarHornActionReceiveData();
322 super.ReadFromContext(ctx, action_recive_data);
325 if (!ctx.Read(needUpdate))
329 if (!ctx.Read(carScript))
332 CarHornActionReceiveData carHornReceivedData = CarHornActionReceiveData.Cast(action_recive_data);
333 carHornReceivedData.m_ActionNeedEnd = needUpdate;
334 carHornReceivedData.m_Car = carScript;
339 override void HandleReciveData(ActionReciveData action_recive_data,
ActionData action_data)
341 super.HandleReciveData(action_recive_data, action_data);
343 CarHornActionReceiveData carHornReceivedData = CarHornActionReceiveData.Cast(action_recive_data);
345 carHornData.m_ActionNeedEnd = carHornReceivedData.m_ActionNeedEnd;
346 carHornData.m_Car = carHornReceivedData.m_Car;