Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
cacontinuousrepeatstartengine.c
Go to the documentation of this file.
2 {
3  void CAContinuousRepeatStartEngine( float time_to_complete_action )
4  {
5  m_DefaultTimeToComplete = time_to_complete_action;
6  }
7 
8  override int Execute( ActionData action_data )
9  {
10  if ( !action_data.m_Player )
11  {
12  return UA_ERROR;
13  }
14 
15  HumanCommandVehicle vehCommand = action_data.m_Player.GetCommand_Vehicle();
16  if( vehCommand )
17  {
18  Transport trans = vehCommand.GetTransport();
19 
20  if ( trans )
21  {
22  Car car;
23  if ( Class.CastTo(car, trans) && car.EngineIsOn() )
24  {
25  return UA_FINISHED;
26  }
27  }
28  }
29 
30  if ( m_TimeElpased < m_TimeToComplete )
31  {
32  m_TimeElpased += action_data.m_Player.GetDeltaT();
33  m_TotalTimeElpased += action_data.m_Player.GetDeltaT();
34  return UA_PROCESSING;
35  }
36  else
37  {
38  m_SpentUnits.param1 = m_TimeElpased;
39  SetACData(m_SpentUnits);
40  m_TimeElpased = 0;
41  OnCompletePogress(action_data);
42  return UA_PROCESSING;
43  }
44  }
45 };
UA_ERROR
const int UA_ERROR
Definition: constants.c:455
CAContinuousRepeat
Definition: cacontinuousrepeat.c:1
CAContinuousRepeatStartEngine
Definition: cacontinuousrepeatstartengine.c:1
UA_FINISHED
const int UA_FINISHED
Definition: constants.c:436
ActionData
Definition: actionbase.c:20
Transport
Base native class for all motorized wheeled vehicles.
Definition: car.c:79
HumanCommandVehicle
Definition: human.c:689
UA_PROCESSING
const int UA_PROCESSING
Definition: constants.c:434
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10