truck_01_cargo.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. class Truck_01_Cargo extends Truck_01_Chassis {};
  2. /*
  3. {
  4. override int GetAnimInstance()
  5. {
  6. return VehicleAnimInstances.V3S;
  7. }
  8. override int GetSeatAnimationType( int posIdx )
  9. {
  10. switch( posIdx )
  11. {
  12. case 0:
  13. return DayZPlayerConstants.VEHICLESEAT_DRIVER;
  14. case 1:
  15. return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
  16. }
  17. return 0;
  18. }
  19. override bool CrewCanGetThrough( int posIdx )
  20. {
  21. CarDoor carDoor;
  22. switch( posIdx )
  23. {
  24. case 0:
  25. Class.CastTo( carDoor, FindAttachmentBySlotName("V3SDriverDoors") );
  26. if ( carDoor )
  27. {
  28. if ( carDoor.GetAnimationPhase("DoorsSource") > 0.5 ) return true;
  29. }
  30. else
  31. {
  32. return true;
  33. }
  34. return false;
  35. break;
  36. case 1:
  37. Class.CastTo( carDoor, FindAttachmentBySlotName("V3SCoDriverDoors") );
  38. if ( carDoor )
  39. {
  40. if ( carDoor.GetAnimationPhase("DoorsSource") > 0.5 ) return true;
  41. }
  42. else
  43. {
  44. return true;
  45. }
  46. return false;
  47. break;
  48. }
  49. return false;
  50. }
  51. override float OnSound( CarSoundCtrl ctrl, float oldValue )
  52. {
  53. switch ( ctrl )
  54. {
  55. case CarSoundCtrl.DOORS:
  56. float newValue = 0;
  57. //-----
  58. CarDoor carDoor;
  59. Class.CastTo( carDoor, FindAttachmentBySlotName("V3SDriverDoors") );
  60. if ( carDoor )
  61. {
  62. if ( carDoor.GetAnimationPhase("DoorsSource") > 0.5)
  63. {
  64. newValue = newValue + 0.8;
  65. }
  66. }
  67. else
  68. {
  69. newValue = newValue + 0.8;
  70. }
  71. //-----
  72. Class.CastTo( carDoor, FindAttachmentBySlotName("V3SCoDriverDoors") );
  73. if ( carDoor )
  74. {
  75. if ( carDoor.GetAnimationPhase("DoorsSource") > 0.5)
  76. {
  77. newValue = newValue + 0.8;
  78. }
  79. }
  80. else
  81. {
  82. newValue = newValue + 0.8;
  83. }
  84. if ( newValue > 1 )
  85. newValue = 1;
  86. return newValue;
  87. break;
  88. }
  89. return oldValue;
  90. }
  91. override string GetAnimSourceFromSelection( string selection )
  92. {
  93. switch( selection )
  94. {
  95. case "wheelsideplate1":
  96. return "WheelSidePlate1";
  97. case "wheelsideplate2":
  98. return "WheelSidePlate2";
  99. }
  100. return "";
  101. }
  102. override bool IsVitalCarBattery()
  103. {
  104. return false;
  105. }
  106. override bool IsVitalSparkPlug()
  107. {
  108. return false;
  109. }
  110. override bool IsVitalGlowPlug()
  111. {
  112. return false;
  113. }
  114. override bool IsVitalEngineBelt()
  115. {
  116. return false;
  117. }
  118. }
  119. */