Exemplo n.º 1
0
        void PanicAlarmControlsKB()
        {
            var bonePos = _vehicle.Bones["door_dside_f"].Position;
            var pos     = Game.Player.Character.GetPositionOffset(bonePos);

            if (pos.Length() > 1.5)
            {
                return;
            }
            if (Game.IsControlJustPressed(0, ElsConfiguration.KBBindings.Snd_SrnPnic))
            {
                pressedTime = Game.GameTime;
            }
            if (Game.IsControlPressed(0, ElsConfiguration.KBBindings.Snd_SrnPnic))
            {
                if (pressedTime != -1 && Game.GameTime - pressedTime >= 499)
                {
                    pressedTime = -1;
                    var state = !_tones.panicAlarm._state;
#if !REMOTETEST
                    PanicAlarmLogic(state);
#endif
                    RemoteEventManager.SendEvent(RemoteEventManager.Commands.PanicAlarm, _vehicle, state, Game.Player.ServerId);
                }
            }
            if (Game.IsControlJustReleased(0, ElsConfiguration.KBBindings.Snd_SrnPnic))
            {
                pressedTime = -1;
            }
        }
Exemplo n.º 2
0
        internal void RotateLadder()
        {
            VerticalAngle = API.GetVehicleDoorAngleRatio(lights._vehicle.Handle, LadderVerticalIndex);
            int currId = Game.PlayerPed.CurrentVehicle.GetElsId();
            int vehId  = lights._vehicle.GetElsId();

            if (Game.IsControlPressed(0, Control.PhoneUp) && Game.PlayerPed.IsSittingInELSVehicle() && currId == vehId)
            {
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveLadderLeft, lights._vehicle, true, Game.Player.ServerId);
                HorizontalAngle = HorizontalAngle + 0.029999999f;
            }
            if (Game.IsControlPressed(0, Control.PhoneDown) && Game.PlayerPed.IsSittingInELSVehicle() && currId == vehId)
            {
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveLadderRight, lights._vehicle, true, Game.Player.ServerId);
                HorizontalAngle = HorizontalAngle - 0.019999999f;
            }
            if (API.IsVehicleDoorFullyOpen(lights._vehicle.Handle, LadderHorizontalIndex) || VerticalAngle <= 0.80000001f)
            {
                API.SetVehicleDoorControl(lights._vehicle.Handle, LadderHorizontalIndex, _speed, VerticalAngle);
            }
            if (HorizontalAngle > .25 || HorizontalAngle < -.25)
            {
                LadderRotated = true;
            }
        }
Exemplo n.º 3
0
        public void RunControlTick()
        {
            if (Game.IsControlPressed(0, Control.PhoneLeft) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetElsId() == lights._vehicle.GetElsId())
            {
                anglehorizontal++;

                //RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightLeft, lights._vehicle, true, Game.Player.ServerId);
            }
            if (Game.IsControlPressed(0, Control.PhoneRight) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetElsId() == lights._vehicle.GetElsId())
            {
                anglehorizontal--;
                //RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightRight, lights._vehicle, true, Game.Player.ServerId);
            }
            if (Game.IsControlPressed(0, Control.PhoneUp) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetElsId() == lights._vehicle.GetElsId())
            {
                angleVertical++;
                //RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightUp, lights._vehicle, true, Game.Player.ServerId);
            }
            if (Game.IsControlPressed(0, Control.PhoneDown) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetElsId() == lights._vehicle.GetElsId())
            {
                angleVertical--;
                //RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightDown, lights._vehicle, true, Game.Player.ServerId);
            }
            if (Game.GameTime >= update + 1000)
            {
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlight, lights._vehicle, true, Game.Player.ServerId);
                update = Game.GameTime;
            }
        }
Exemplo n.º 4
0
 void DualSirenControlsKB()
 {
     if (Controls.ToggleDualSiren.IsJustReleased())
     {
         DualSirenLogic(true, true);
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.DualSiren, _elsVehicle, true);
     }
 }
Exemplo n.º 5
0
 void MainSirenToggleControlsKB()
 {
     if (Controls.ToggleSiren.IsJustReleased())
     {
         MainSirenToggleLogic(true, true);
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.MainSiren, _elsVehicle, true);
     }
 }
Exemplo n.º 6
0
        internal static void RunAsync(Vehicle veh)
        {
            Game.DisableControlThisFrame(0, ElsConfiguration.KeyBindings.ToggleLIND);
            Game.DisableControlThisFrame(0, ElsConfiguration.KeyBindings.ToggleRIND);
            Game.DisableControlThisFrame(0, ElsConfiguration.KeyBindings.ToggleHAZ);

            if (Game.IsDisabledControlJustPressed(0, ElsConfiguration.KeyBindings.ToggleLIND) && Game.CurrentInputMode == InputMode.MouseAndKeyboard)
            {
                if (CurrentIndicatorState(veh) == IndicatorState.Left)
                {
                    Utils.DebugWriteLine("Toggle Off");
                    ToggleInicatorState(veh, IndicatorState.Off);
                    ActivateIndicatorTimer = false;
                    ElsUiPanel.PlayUiSound(false);
                    RemoteEventManager.SendEvent(RemoteEventManager.Commands.ToggleInd, veh, true, Game.Player.ServerId);
                    return;
                }
                Utils.DebugWriteLine("Toggle Left");
                ToggleInicatorState(veh, IndicatorState.Left);
                ElsUiPanel.PlayUiSound(true);
                ActivateIndicatorTimer = true;
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.ToggleInd, veh, true, Game.Player.ServerId);
            }
            else if (Game.IsDisabledControlJustPressed(0, ElsConfiguration.KeyBindings.ToggleRIND) && Game.CurrentInputMode == InputMode.MouseAndKeyboard)
            {
                if (CurrentIndicatorState(veh) == IndicatorState.Right)
                {
                    Utils.DebugWriteLine("Toggle Off");
                    ToggleInicatorState(veh, IndicatorState.Off);
                    ActivateIndicatorTimer = false;
                    ElsUiPanel.PlayUiSound(false);
                    RemoteEventManager.SendEvent(RemoteEventManager.Commands.ToggleInd, veh, true, Game.Player.ServerId);
                    return;
                }
                Utils.DebugWriteLine("Toggle Right");
                ToggleInicatorState(veh, IndicatorState.Right);
                ActivateIndicatorTimer = true;
                ElsUiPanel.PlayUiSound(true);
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.ToggleInd, veh, true, Game.Player.ServerId);
            }
            else if (Game.IsDisabledControlJustPressed(0, ElsConfiguration.KeyBindings.ToggleHAZ) && Game.CurrentInputMode == InputMode.MouseAndKeyboard)
            {
                if (CurrentIndicatorState(veh) == IndicatorState.Hazard)
                {
                    Utils.DebugWriteLine("Toggle Off");
                    ToggleInicatorState(veh, IndicatorState.Off);
                    ActivateIndicatorTimer = false;
                    ElsUiPanel.PlayUiSound(false);
                    RemoteEventManager.SendEvent(RemoteEventManager.Commands.ToggleInd, veh, true, Game.Player.ServerId);
                    return;
                }
                Utils.DebugWriteLine("Toggle Hazard");
                ToggleInicatorState(veh, IndicatorState.Hazard);
                ActivateIndicatorTimer = true;
                ElsUiPanel.PlayUiSound(true);
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.ToggleInd, veh, true, Game.Player.ServerId);
            }
        }
Exemplo n.º 7
0
 internal void ToggleTdlKB()
 {
     Game.DisableControlThisFrame(0, ElsConfiguration.KBBindings.ToggleTdl);
     if ((Game.IsDisabledControlJustPressed(0, ElsConfiguration.KBBindings.ToggleTdl) && !Game.IsControlPressed(0, Control.CharacterWheel)) && Game.CurrentInputMode == InputMode.MouseAndKeyboard || (Global.AllowController && Game.IsControlJustPressed(2, ElsConfiguration.GPBindings.ToggleTdl) && Game.CurrentInputMode == InputMode.GamePad))
     {
         ToggleTdl();
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.ToggleTDL, _vehicle, true, Game.Player.ServerId);
     }
 }
Exemplo n.º 8
0
 internal void ToggleWrnLKB()
 {
     Game.DisableControlThisFrame(0, ElsConfiguration.KeyBindings.ToggleWrnL);
     if (Game.IsDisabledControlJustPressed(0, ElsConfiguration.KeyBindings.ToggleWrnL))
     {
         ToggleWrnLights();
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.ToggleWrnL, _vehicle, true, Game.Player.ServerId);
     }
 }
Exemplo n.º 9
0
 internal void ToggleCrsKB()
 {
     Game.DisableControlThisFrame(0, ElsConfiguration.KeyBindings.ToggleCrsL);
     if (Game.IsDisabledControlJustPressed(0, ElsConfiguration.KeyBindings.ToggleCrsL) && !Game.IsControlPressed(0, Control.CharacterWheel) && Game.CurrentInputMode == InputMode.MouseAndKeyboard)
     {
         ToggleCrs();
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.ToggleCrsL, _vehicle, true, Game.Player.ServerId);
     }
 }
Exemplo n.º 10
0
        void MainSirenToggleControlsKB()
        {
            if ((Game.IsControlJustReleased(0, ElsConfiguration.KeyBindings.Toggle_SIRN) && Game.CurrentInputMode == InputMode.MouseAndKeyboard) || (Global.AllowController && Game.IsControlJustPressed(2, Control.HUDSpecial) && Game.CurrentInputMode == InputMode.GamePad))
            {
#if !REMOTETEST
                MainSirenToggleLogic(true, true);
#endif
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.MainSiren, _vehicle, true, Game.Player.ServerId);
            }
        }
Exemplo n.º 11
0
        void ManualTone4ControlsKB()
        {
            if (Game.IsControlJustReleased(0, ElsConfiguration.KBBindings.Snd_SrnTon4))
            {
#if !REMOTETEST
                SirenTone4Logic(true, true);
#endif
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.ManualTone4, _vehicle, true, Game.Player.ServerId);
            }
        }
Exemplo n.º 12
0
        void ManualTone3ControlsKB()
        {
            if (Game.IsControlJustReleased(0, configuration.ControlConfiguration.KeyBindings.Snd_SrnTon3))
            {
#if !REMOTETEST
                ManualTone3Logic(true, true);
#endif
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.ManualTone3, _vehicle, true, Game.Player.ServerId);
            }
        }
Exemplo n.º 13
0
        void MainSirenToggleControlsKB()
        {
            if (Game.IsControlJustReleased(0, configuration.ControlConfiguration.KeyBindings.Toggle_SIRN))
            {
#if !REMOTETEST
                MainSirenToggleLogic(true, true);
#endif
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.MainSiren, _vehicle, true, Game.Player.ServerId);
            }
        }
Exemplo n.º 14
0
        void ManualTone3ControlsKB()
        {
            if ((Game.IsControlJustReleased(0, ElsConfiguration.KBBindings.Snd_SrnTon3) && Game.CurrentInputMode == InputMode.MouseAndKeyboard) || (Global.AllowController && Game.IsControlJustPressed(2, ElsConfiguration.GPBindings.Snd_SrnTon3) && Game.CurrentInputMode == InputMode.GamePad))
            {
#if !REMOTETEST
                SirenTone3Logic(true, true);
#endif
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.ManualTone3, _vehicle, true, Game.Player.ServerId);
            }
        }
Exemplo n.º 15
0
        void DualSirenControlsKB()
        {
            if (Game.IsControlJustReleased(0, ElsConfiguration.KBBindings.Toggle_DSRN))
            {
#if !REMOTETEST
                DualSirenLogic(true, true);
#endif
                System.Collections.Generic.Dictionary <String, object> dic = new System.Collections.Generic.Dictionary <string, object>();
                // Manager.VehicleManager.SyncRequestReply(_vehicle.Plate());
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.DualSiren, _vehicle, true, Game.Player.ServerId);
            }
        }
Exemplo n.º 16
0
 internal void ToggleSclKB()
 {
     Game.DisableControlThisFrame(0, ElsConfiguration.KeyBindings.ToggleTdl);
     if (Game.IsDisabledControlJustPressed(0, ElsConfiguration.KeyBindings.ToggleTdl) && Game.IsControlPressed(0, Control.CharacterWheel))
     {
         if (_extras.SCL != null)
         {
             ToggleScl();
         }
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.ToggleSCL, _vehicle, true, Game.Player.ServerId);
     }
 }
Exemplo n.º 17
0
        public void RunTick()
        {
            var vehicle = lights.ElsVehicle.Vehicle;

            if (vehicle == null)
            {
                return;
            }

            if (lights.ElsVehicle.ControlTimer.Expired && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.NetworkId == lights.ElsVehicle.NetworkId)
            {
                if (Game.IsControlPressed(0, Control.PhoneLeft))
                {
                    RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightLeft, lights.ElsVehicle, true);
                    anglehorizontal++;
                }
                if (Game.IsControlPressed(0, Control.PhoneRight))
                {
                    RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightRight, lights.ElsVehicle, true);
                    anglehorizontal--;
                }
                if (Game.IsControlPressed(0, Control.PhoneUp))
                {
                    RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightUp, lights.ElsVehicle, true);
                    angleVertical++;
                }
                if (Game.IsControlPressed(0, Control.PhoneDown))
                {
                    RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightDown, lights.ElsVehicle, true);
                    angleVertical--;
                }
            }

            //var spotoffset = Game.Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(-0.9f, 1.15f, 0.5f));

            var off = vehicle.GetPositionOffset(vehicle.Bones[$"window_lf"].Position);

            var spotoffset = vehicle.GetOffsetPosition(off + new Vector3(-.25f, 1f, 0.1f));

            //Vector3 myPos = Game.PlayerPed.CurrentVehicle.Bones[$"extra_{_id}"].Position;
            float hx = (float)(spotoffset.X + 5 * Math.Cos(((double)anglehorizontal + vehicle.Rotation.Z) * Math.PI / 180.0));
            float hy = (float)(spotoffset.Y + 5 * Math.Sin(((double)anglehorizontal + vehicle.Rotation.Z) * Math.PI / 180.0));
            float vz = (float)(spotoffset.Z + 5 * Math.Sin(angleVertical * Math.PI / 180.0));

            Vector3 destinationCoords = (new Vector3(hx, hy, vz));

            dirVector = destinationCoords - spotoffset;
            dirVector.Normalize();
            //Function.Call(Hash.DRAW_SPOT_LIGHT, spotoffset.X, spotoffset.Y, spotoffset.Z, dirVector.X, dirVector.Y, dirVector.Z, 255, 255, 255, 100.0f, 1f, 0.0f, 13.0f, 1f,100f);
            API.DrawSpotLightWithShadow(spotoffset.X, spotoffset.Y, spotoffset.Z, dirVector.X, dirVector.Y, dirVector.Z, 255, 255, 255, Global.TkdnRng, Global.TkdnInt, 1f, 18f, 1f, 0);
        }
Exemplo n.º 18
0
 void ManualSoundControlsKB()
 {
     Controls.SoundManual.Disable();
     if (Controls.SoundManual.IsDisabledJustPressed())
     {
         ManualSoundLogic(true, true);
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.ManualSound, _elsVehicle, true);
     }
     if (Controls.SoundManual.IsDisabledJustReleased())
     {
         ManualSoundLogic(false, true);
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.ManualSound, _elsVehicle, false);
     }
 }
Exemplo n.º 19
0
 internal void ChgSecPattKB()
 {
     Game.DisableControlThisFrame(0, ElsConfiguration.KeyBindings.ChgPattSecL);
     if (Game.IsDisabledControlJustPressed(0, ElsConfiguration.KeyBindings.ChgPattSecL) && !Game.IsControlPressed(0, Control.CharacterWheel))
     {
         ChgSecPatt(false);
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.ChangeSecPatt, _vehicle, true, Game.Player.ServerId);
     }
     else if (Game.IsDisabledControlJustPressed(0, ElsConfiguration.KeyBindings.ChgPattSecL) && Game.IsControlPressed(0, Control.CharacterWheel))
     {
         ChgSecPatt(true);
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.ChangeSecPatt, _vehicle, true, Game.Player.ServerId);
     }
 }
Exemplo n.º 20
0
 internal void ChgWrnPattKB()
 {
     Game.DisableControlThisFrame(0, ElsConfiguration.KeyBindings.ChgPattWrnL);
     if (Game.IsDisabledControlJustPressed(0, ElsConfiguration.KeyBindings.ChgPattWrnL) && !Game.IsControlPressed(0, Control.CharacterWheel) && Game.CurrentInputMode == InputMode.MouseAndKeyboard)
     {
         ChgWrnPatt(false);
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.ChgPattWrnL, _vehicle, true, Game.Player.ServerId);
     }
     else if (Game.IsDisabledControlJustPressed(0, ElsConfiguration.KeyBindings.ChgPattWrnL) && Game.IsControlPressed(0, Control.CharacterWheel) && Game.CurrentInputMode == InputMode.MouseAndKeyboard)
     {
         ChgWrnPatt(true);
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.ChgPattWrnL, _vehicle, true, Game.Player.ServerId);
     }
 }
Exemplo n.º 21
0
 internal void ToggleLightStageKB()
 {
     Game.DisableControlThisFrame(0, ElsConfiguration.KeyBindings.ToggleLstg);
     if ((Game.IsDisabledControlJustPressed(0, ElsConfiguration.KeyBindings.ToggleLstg) && !Game.IsControlPressed(0, Control.CharacterWheel)) && Game.CurrentInputMode == InputMode.MouseAndKeyboard || (Global.AllowController && Game.IsControlJustPressed(2, Control.Detonate) && Game.CurrentInputMode == InputMode.GamePad))
     {
         Utils.DebugWriteLine("Toggle Light stage");
         ToggleLightStage();
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.ToggleLstg, _vehicle, true, Game.Player.ServerId);
     }
     else if (Game.IsDisabledControlJustPressed(0, ElsConfiguration.KeyBindings.ToggleLstg) && Game.IsControlPressed(0, Control.CharacterWheel) && Game.CurrentInputMode == InputMode.MouseAndKeyboard)
     {
         Utils.DebugWriteLine("Toggle Light stage Inverse");
         ToggleLightStageInverse();
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.ToggleLstg, _vehicle, true, Game.Player.ServerId);
     }
 }
Exemplo n.º 22
0
        void ManualSoundControlsKB()
        {
            if (Game.IsControlJustPressed(0, configuration.ControlConfiguration.KeyBindings.Sound_Manul))
            {
#if !REMOTETEST
                ManualSoundLogic(true, true);
#endif
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.ManualSound, _vehicle, true, Game.Player.ServerId);
            }
            if (Game.IsControlJustReleased(0, configuration.ControlConfiguration.KeyBindings.Sound_Manul))
            {
#if !REMOTETEST
                ManualSoundLogic(false, true);
#endif
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.ManualSound, _vehicle, false, Game.Player.ServerId);
            }
        }
Exemplo n.º 23
0
        public void RunTick()
        {
            Vehicle veh = new Vehicle(API.NetworkGetEntityFromNetworkId(_veh));

            Utils.DebugWriteLine($"Spotlight veh handle of {veh.Handle}");
            if (Game.IsControlPressed(0, Control.PhoneLeft) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetNetworkId() == veh.GetNetworkId())
            {
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightLeft, veh, true, Game.Player.ServerId);
                anglehorizontal++;
            }
            if (Game.IsControlPressed(0, Control.PhoneRight) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetNetworkId() == veh.GetNetworkId())
            {
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightRight, veh, true, Game.Player.ServerId);
                anglehorizontal--;
            }
            if (Game.IsControlPressed(0, Control.PhoneUp) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetNetworkId() == veh.GetNetworkId())
            {
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightUp, veh, true, Game.Player.ServerId);
                angleVertical++;
            }
            if (Game.IsControlPressed(0, Control.PhoneDown) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetNetworkId() == veh.GetNetworkId())
            {
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveSpotlightDown, veh, true, Game.Player.ServerId);
                angleVertical--;
            }

            //var spotoffset = Game.Player.Character.CurrentVehicle.GetOffsetPosition(new Vector3(-0.9f, 1.15f, 0.5f));

            var off        = veh.GetPositionOffset(veh.Bones[$"extra_{_id}"].Position);
            var spotoffset = veh.GetOffsetPosition(off + new Vector3(0, 0.05f, 0));

            //Vector3 myPos = Game.PlayerPed.CurrentVehicle.Bones[$"extra_{_id}"].Position;
            float hx = (float)((double)spotoffset.X + 5 * Math.Cos(((double)anglehorizontal + veh.Rotation.Z) * Math.PI / 180.0));
            float hy = (float)((double)spotoffset.Y + 5 * Math.Sin(((double)anglehorizontal + veh.Rotation.Z) * Math.PI / 180.0));
            float vz = (float)((double)spotoffset.Z + 5 * Math.Sin((double)angleVertical * Math.PI / 180.0));

            Vector3 destinationCoords = (new Vector3(hx, hy, vz));

            dirVector = destinationCoords - spotoffset;
            dirVector.Normalize();
            //Function.Call(Hash.DRAW_SPOT_LIGHT, spotoffset.X, spotoffset.Y, spotoffset.Z, dirVector.X, dirVector.Y, dirVector.Z, 255, 255, 255, 100.0f, 1f, 0.0f, 13.0f, 1f,100f);
            API.DrawSpotLightWithShadow(spotoffset.X, spotoffset.Y, spotoffset.Z, dirVector.X, dirVector.Y, dirVector.Z, 255, 255, 255, Global.TkdnRng, Global.TkdnInt, 1f, 13f, 1f, 0);
        }
Exemplo n.º 24
0
        void AirHornControlsKB()
        {
            if ((Game.IsControlJustPressed(0, configuration.ControlConfiguration.KeyBindings.Sound_Ahorn) &&
                 Game.CurrentInputMode == InputMode.MouseAndKeyboard) ||
                (Game.IsControlJustPressed(2, Control.ScriptPadDown) && Game.CurrentInputMode == InputMode.GamePad))
            {
#if !REMOTETEST
                AirHornLogic(true, true);
#endif
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.AirHorn, _vehicle, true, Game.Player.ServerId);
            }
            if ((Game.IsControlJustReleased(0, configuration.ControlConfiguration.KeyBindings.Sound_Ahorn) &&
                 Game.CurrentInputMode == InputMode.MouseAndKeyboard) ||
                (Game.IsControlJustReleased(2, Control.ScriptPadDown) && Game.CurrentInputMode == InputMode.GamePad))
            {
#if !REMOTETEST
                AirHornLogic(false, true);
#endif
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.AirHorn, _vehicle, false, Game.Player.ServerId);
            }
        }
Exemplo n.º 25
0
 internal void RaiseLowerLadder()
 {
     VerticalAngle = API.GetVehicleDoorAngleRatio(lights._vehicle.Handle, LadderVerticalIndex);
     if (Game.IsControlPressed(0, Control.PhoneUp) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetNetworkId() == lights._vehicle.GetNetworkId())
     {
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveLadderUp, lights._vehicle, true, Game.Player.ServerId);
         VerticalAngle = VerticalAngle + 0.029999999f;
     }
     if (Game.IsControlPressed(0, Control.PhoneDown) && Game.PlayerPed.IsSittingInELSVehicle() && Game.PlayerPed.CurrentVehicle.GetNetworkId() == lights._vehicle.GetNetworkId())
     {
         RemoteEventManager.SendEvent(RemoteEventManager.Commands.MoveLadderDown, lights._vehicle, true, Game.Player.ServerId);
         VerticalAngle = VerticalAngle - 0.029999999f;
     }
     if (API.IsVehicleDoorFullyOpen(lights._vehicle.Handle, LadderVerticalIndex) || VerticalAngle <= 0.80000001f)
     {
         API.SetVehicleDoorControl(lights._vehicle.Handle, LadderVerticalIndex, _speed, VerticalAngle);
     }
     if (VerticalAngle > .25)
     {
         LadderRaised = true;
     }
 }
Exemplo n.º 26
0
        void AirHornControlsKB()
        {
            if ((Game.IsControlJustPressed(0, ElsConfiguration.KBBindings.Sound_Ahorn) &&
                 Game.CurrentInputMode == InputMode.MouseAndKeyboard) ||
                (Game.IsControlJustPressed(2, ElsConfiguration.GPBindings.Sound_Ahorn) && Game.CurrentInputMode == InputMode.GamePad && Global.AllowController))
            {
#if !REMOTETEST
                AirHornLogic(true, true);
#endif
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.AirHorn, _vehicle, true, Game.Player.ServerId);
            }
            if ((Game.IsControlJustReleased(0, ElsConfiguration.KBBindings.Sound_Ahorn) &&
                 Game.CurrentInputMode == InputMode.MouseAndKeyboard) ||
                (Game.IsControlJustReleased(2, Control.SpecialAbility) && Game.CurrentInputMode == InputMode.GamePad && Global.AllowController))
            {
#if !REMOTETEST
                int[] patts = { _patternController.CurrentPrmPattern, _patternController.CurrentSecPattern, _patternController.CurrentWrnPattern };
                AirHornLogic(false, true);
#endif
                RemoteEventManager.SendEvent(RemoteEventManager.Commands.AirHorn, _vehicle, false, Game.Player.ServerId);
            }
        }
Exemplo n.º 27
0
 void AirHornControlsKB()
 {
     if (!_tones.horn.State)
     {
         if (Controls.SoundAirHorn.IsJustPressed())
         {
             if (!_elsVehicle.ControlTimer.Expired)
             {
                 return;
             }
             AirHornLogic(true, true);
             RemoteEventManager.SendEvent(RemoteEventManager.Commands.AirHorn, _elsVehicle, true);
         }
     }
     else
     {
         if (Controls.SoundAirHorn.IsJustReleased())
         {
             AirHornLogic(false, true);
             RemoteEventManager.SendEvent(RemoteEventManager.Commands.AirHorn, _elsVehicle, false);
         }
     }
 }
Exemplo n.º 28
0
 private void SendMessage()
 {
     RemoteEventManager.SendEvent(RemoteEventManager.MessageTypes.SirenUpdate, (Vehicle)_entity, _type.ToString(), _state);
 }