DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnAction()

override bool Car::OnAction ( int action_id,
Man player,
ParamsReadContext ctx )
inlineprotected

См. определение в файле CarScript.c строка 636

637 {
638 if (super.OnAction(action_id, player, ctx))
639 return true;
640
641 if (!g_Game.IsServer())
642 {
643 return false;
644 }
645
646 switch (action_id)
647 {
648 case EActions.CAR_HORN_START_SHORT:
649 SetCarHornState(ECarHornState.SHORT);
650 return true;
651 case EActions.CAR_HORN_START_LONG:
652 SetCarHornState(ECarHornState.LONG);
653 return true;
654 case EActions.CAR_HORN_STOP:
655 SetCarHornState(ECarHornState.OFF);
656 return true;
657
658 case EActions.CAR_FUEL_FULL:
659 Fill(CarFluid.FUEL, GetFluidCapacity(CarFluid.FUEL));
660 return true;
661 case EActions.CAR_FUEL_EMPTY:
662 LeakAll(CarFluid.FUEL);
663 return true;
664 case EActions.CAR_FUEL_INCREASE:
665 Fill(CarFluid.FUEL, GetFluidCapacity(CarFluid.FUEL) * 0.1);
666 return true;
667 case EActions.CAR_FUEL_DECREASE:
668 Leak(CarFluid.FUEL, GetFluidCapacity(CarFluid.FUEL) * 0.1);
669 return true;
670
671 case EActions.CAR_COOLANT_FULL:
672 Fill(CarFluid.COOLANT, GetFluidCapacity(CarFluid.COOLANT));
673 return true;
674 case EActions.CAR_COOLANT_EMPTY:
675 LeakAll(CarFluid.COOLANT);
676 return true;
677 case EActions.CAR_COOLANT_INCREASE:
678 Fill(CarFluid.COOLANT, GetFluidCapacity(CarFluid.COOLANT) * 0.1);
679 return true;
680 case EActions.CAR_COOLANT_DECREASE:
681 Leak(CarFluid.COOLANT, GetFluidCapacity(CarFluid.COOLANT) * 0.1);
682 return true;
683 }
684
685#ifdef DIAG_DEVELOPER
686 typename e = ECarDebugMode;
687
688 int i;
689
690 int cnt = e.GetVariableCount();
691 int val;
692
693 for (i = 0; i < cnt; i++)
694 {
695 if (!e.GetVariableValue(null, i, val))
696 continue;
697
698 if ((val + EActions.PLAYER_BOT_INTERNAL_START) == action_id)
699 {
700 m_eDebugMode = val;
701 dBodyActive(this, ActiveState.ACTIVE);
702 }
703 }
704#endif
705
706 return false;
707 }
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
Определения Car.c:19
DayZGame g_Game
Определения DayZGame.c:3942
EActions
Определения EActions.c:2
void SetCarHornState(int pState)
Определения CarScript.c:3068
ActiveState
Определения ActiveState.c:10
proto native void dBodyActive(notnull IEntity ent, ActiveState activeState)

Перекрестные ссылки dBodyActive(), g_Game и SetCarHornState().