646{
  650 
  652    {
  653        
  654    
  655        m_EngineStartOK         = "offroad_engine_start_SoundSet";
  656        m_EngineStartBattery    = "offroad_engine_failed_start_battery_SoundSet";
  657        m_EngineStartPlug       = "offroad_engine_failed_start_sparkplugs_SoundSet";
  658        m_EngineStartFuel       = "offroad_engine_failed_start_fuel_SoundSet";
  659        m_EngineStop            = "offroad_engine_stop_SoundSet";
  660        m_EngineStopFuel        = "offroad_engine_stop_fuel_SoundSet";
  661        
  662        m_CarDoorOpenSound      = "offroad_door_open_SoundSet";
  663        m_CarDoorCloseSound     = "offroad_door_close_SoundSet";
  664        m_CarSeatShiftInSound   = "Offroad_SeatShiftIn_SoundSet";
  665        m_CarSeatShiftOutSound  = "Offroad_SeatShiftOut_SoundSet";
  666        
  667        m_CarHornShortSoundName = "Offroad_Horn_Short_SoundSet";
  668        m_CarHornLongSoundName  = "Offroad_Horn_SoundSet";
  669        
  670        SetEnginePos("0 0.7 1.2");
  671    }
  672    
  674    {       
  675        super.EEInit();
  676        
  678        {
  685            
  688        }       
  689    }
  690    
  692    {
  693        super.OnEngineStart();
  694 
  696        {
  698        }
  699    }
  700    
  702    {
  703        super.OnEngineStop();
  704 
  706        {
  708        }
  709    }
  710    
  712    {
  714        {
  716            {
  718            }
  719        }
  720    }
  721    
  723    {
  725    }
  726    
  728    {
  729        return 3.5;
  730    }
  731 
  733    {
  734        switch (posIdx)
  735        {
  736        case 0:
  738        case 1:
  740        case 2:
  742        case 3:
  744        }
  745 
  746        return 0;
  747 
  748    }
  749    
  750    
  752    {
  754    }
  755    
  757    {
  759    }
  760 
  762    {
  763        if (!super.CanReleaseAttachment(attachment))
  764        {
  765            return false;
  766        }
  767        
  769        {
  770            string attType = attachment.GetType();
  771            if (attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
  772            {
  773                return false;
  774            }
  775        }
  776 
  777        return true;
  778    }
  779    
  781    {
  783    }
  784 
  786    {
  787        if (!super.CanDisplayAttachmentCategory(category_name))
  788        {
  789            return false;
  790        }
  791    
  793        if (category_name.
Contains(
"engine"))
 
  794        {
  796            {
  797                return false;
  798            }
  799        }
  800                
  801        return true;
  802    }
  803    
  805    {
  806        if (!super.CanDisplayCargo())
  807        {
  808            return false;
  809        }
  810        
  812        {
  813            return false;
  814        }
  815        
  816        return true;
  817    }
  818 
  820    {
  822        
  823        Class.
CastTo(carDoor, FindAttachmentBySlotName(slotType));
 
  824        if (!carDoor)
  825        {
  827        }
  828 
  829        switch (slotType)
  830        {
  831            case "NivaDriverDoors":
  832                return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
  833                
  834            case "NivaCoDriverDoors":
  835                return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
  836                
  837            case "NivaHood":
  838                return TranslateAnimationPhaseToCarDoorState("DoorsHood");
  839                
  840            case "NivaTrunk":
  841                return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
  842        }
  843 
  845    }
  846    
  848    {
  850        switch (posIdx)
  851        {
  852            case 0:
  854                    return false;
  855                else if (GetAnimationPhase("SeatDriver") > 0.5)
  856                    return false;
  857    
  858                return true;
  859    
  860            case 1:
  862                    return false;
  863                else if (GetAnimationPhase("SeatCoDriver") > 0.5)
  864                    return false;
  865    
  866                return true;
  867    
  868            case 2:
  870                    return false;
  871                else if (GetAnimationPhase("SeatDriver") <= 0.5)
  872                    return false;
  873    
  874                return true;
  875    
  876            case 3:
  878                    return false;
  879                else if (GetAnimationPhase("SeatCoDriver") <= 0.5)
  880                    return false;
  881    
  882                return true;
  883        }
  884 
  885        return false;
  886    }
  887 
  889    {
  890        switch (posIdx)
  891        {
  892            case 0:
  893            case 2:
  894                return "doors_driver";
  895            case 1:
  896            case 3:
  897                return "doors_codriver";
  898        }
  899        
  900        return super.GetDoorSelectionNameFromSeatPos(posIdx);
  901    }
  902 
  904    {
  905        switch (posIdx)
  906        {
  907            case 0:
  908            case 2:
  909                return "NivaDriverDoors";
  910            case 1:
  911            case 3:
  912                return "NivaCoDriverDoors";
  913        }
  914        
  915        return super.GetDoorInvSlotNameFromSeatPos(posIdx);
  916    }
  917    
  918    
  919    
  921    {
  922        float tempCap = 0.0;
  923 
  924        switch (ctrl)
  925        {
  927            float newValue = 0;
  929            {
  930                newValue += 0.5;
  931            }
  932 
  934            {
  935                newValue += 0.5;
  936            }
  937 
  939            {
  940                newValue += 0.3;
  941            }
  942        
  944            {
  945                newValue -= 0.6;
  946            }
  947 
  949            {
  950                newValue -= 0.2;
  951            }
  952        
  954            {
  955                newValue -= 0.2;
  956            }
  957 
  959        break;
  960        }
  961 
  962        return super.OnSound(ctrl, oldValue);
  963    }
  964 
  966    {
  967        switch (selection)
  968        {
  969        case "doors_driver":
  970            return "DoorsDriver";
  971        case "doors_codriver":
  972            return "DoorsCoDriver";
  973        case "doors_hood":
  974            return "DoorsHood";
  975        case "doors_trunk":
  976            return "DoorsTrunk";
  977        case "seatback_driver":
  978            return "SeatDriver";
  979        case "seatback_codriver":
  980            return "SeatCoDriver";
  981        }
  982 
  983        return "";
  984    }
  985    
  987    {
  988        switch (selection)
  989        {
  990            case "seat_driver":
  991            case "seatback_driver":
  992            case "seat_cargo1":
  993                return "seat_con_1_1";
  994            case "seat_codriver":
  995            case "seatback_codriver":
  996            case "seat_cargo2":
  997                return "seat_con_2_1";
  998        }
  999        
 1000        return "";
 1001    }
 1002 
 1004    {
 1005        switch (selection)
 1006        {
 1007            case "seatback_driver":
 1008                return 0;
 1009            case "seatback_codriver":
 1010                return 1;
 1011        }
 1012 
 1013        return -1;
 1014    }
 1015 
 1017    {
 1018        return false;
 1019    }
 1020 
 1022    {
 1023        return false;
 1024    }
 1025    
 1027    {
 1028        if (nextSeat == 0 && GetAnimationPhase("SeatDriver") > 0.5)
 1029            return false;
 1030        
 1031        if (nextSeat == 1 && GetAnimationPhase("SeatCoDriver") > 0.5)
 1032            return false;
 1033        
 1034        switch (currentSeat)
 1035        {
 1036            case 0:
 1037                return nextSeat == 1;
 1038    
 1039            case 1:
 1040                return nextSeat == 0;
 1041    
 1042            case 2:
 1043                return nextSeat == 3;
 1044    
 1045            case 3:
 1046                return nextSeat == 2;
 1047        }
 1048        
 1049        return false;
 1050    }
 1051 
 1053    {
 1054        switch (pCurrentSeat)
 1055        {
 1056            case 0:
 1057                return pDoorsSelection == "DoorsDriver";
 1058    
 1059            case 1:
 1060                return pDoorsSelection == "DoorsCoDriver";
 1061    
 1062            case 2:
 1063                return pDoorsSelection == "DoorsDriver";
 1064    
 1065            case 3:
 1066                return pDoorsSelection == "DoorsCoDriver";
 1067        }
 1068        
 1069        return false;       
 1070    }
 1071    
 1073    {
 1074        switch (pDoorSelection)
 1075        {
 1076            case "DoorsDriver":
 1077                return 0;
 1078            case "DoorsCoDriver":
 1079                return 1;
 1080        }
 1081 
 1082        return -1;
 1083    }
 1084    
 1086    {
 1087        super.SetActions();
 1088 
 1090    }
 1091    
 1093    {
 1094        SpawnUniversalParts();
 1095        SpawnAdditionalItems();
 1096        FillUpCarFluids();
 1097 
 1098        GetInventory().CreateInInventory("HatchbackWheel");
 1099        GetInventory().CreateInInventory("HatchbackWheel");
 1100        GetInventory().CreateInInventory("HatchbackWheel" );
 1101        GetInventory().CreateInInventory("HatchbackWheel");
 1102 
 1103        GetInventory().CreateInInventory("HatchbackDoors_Driver");
 1104        GetInventory().CreateInInventory("HatchbackDoors_CoDriver");
 1105        GetInventory().CreateInInventory("HatchbackHood");
 1106        GetInventory().CreateInInventory("HatchbackTrunk");
 1107 
 1108        
 1109        GetInventory().CreateInInventory("HatchbackWheel");
 1110        GetInventory().CreateInInventory("HatchbackWheel");
 1111    }
 1112}
 1113 
 1115{
 1117    {
 1118        SpawnUniversalParts();
 1119        SpawnAdditionalItems();
 1120        FillUpCarFluids();
 1121 
 1122        GetInventory().CreateInInventory("HatchbackWheel");
 1123        GetInventory().CreateInInventory("HatchbackWheel");
 1124        GetInventory().CreateInInventory("HatchbackWheel");
 1125        GetInventory().CreateInInventory("HatchbackWheel");
 1126 
 1127        GetInventory().CreateInInventory("HatchbackDoors_Driver_White");
 1128        GetInventory().CreateInInventory("HatchbackDoors_CoDriver_White");
 1129        GetInventory().CreateInInventory("HatchbackHood_White");
 1130        GetInventory().CreateInInventory("HatchbackTrunk_White");
 1131 
 1132        
 1133        GetInventory().CreateInInventory("HatchbackWheel");
 1134        GetInventory().CreateInInventory("HatchbackWheel");
 1135    }
 1136}
 1137 
 1139{
 1141    {
 1142        SpawnUniversalParts();
 1143        SpawnAdditionalItems();
 1144        FillUpCarFluids();
 1145 
 1146        GetInventory().CreateInInventory("HatchbackWheel");
 1147        GetInventory().CreateInInventory("HatchbackWheel");
 1148        GetInventory().CreateInInventory("HatchbackWheel");
 1149        GetInventory().CreateInInventory("HatchbackWheel");
 1150    
 1151        GetInventory().CreateInInventory("HatchbackDoors_Driver_Blue");
 1152        GetInventory().CreateInInventory("HatchbackDoors_CoDriver_Blue");
 1153        GetInventory().CreateInInventory("HatchbackHood_Blue");
 1154        GetInventory().CreateInInventory("HatchbackTrunk_Blue");
 1155    
 1156        
 1157        GetInventory().CreateInInventory("HatchbackWheel");
 1158        GetInventory().CreateInInventory("HatchbackWheel");
 1159    }
 1160}
void AddAction(typename actionName)
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
ref UniversalTemperatureSourceSettings m_UTSSettings
ref UniversalTemperatureSource m_UTSource
override void SetActions()
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
override string GetAnimSourceFromSelection(string selection)
override int GetSeatAnimationType(int posIdx)
override string GetDoorConditionPointFromSelection(string selection)
override float OnSound(CarSoundCtrl ctrl, float oldValue)
override string GetDoorInvSlotNameFromSeatPos(int posIdx)
override void EOnPostSimulate(IEntity other, float timeSlice)
override void OnEngineStop()
override float GetTransportCameraDistance()
override bool CanReleaseAttachment(EntityAI attachment)
override bool CanDisplayCargo()
override void OnEngineStart()
override CarLightBase CreateFrontLight()
override int GetAnimInstance()
override bool CrewCanGetThrough(int posIdx)
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
bool CanManipulateSpareWheel(string slotSelectionName)
override bool IsVitalGlowPlug()
override CarRearLightBase CreateRearLight()
class OffroadHatchback extends CarScript OnDebugSpawn()
override int GetSeatIndexFromDoor(string pDoorSelection)
override bool IsVitalTruckBattery()
override string GetDoorSelectionNameFromSeatPos(int posIdx)
override int GetCarDoorsState(string slotType)
override int GetCrewIndex(string selection)
override bool CanDisplayAttachmentCategory(string category_name)
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
Super root of all classes in Enforce script.
override void OnDebugSpawn()
original Timer deletes m_params which is unwanted
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
bool Contains(string sample)
Returns true if sample is substring of string.
proto int ToLower()
Changes string to lowercase. Returns length.