Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Windows.Forms;
- using GTA;
- using GTA.Native;
- using GTA.Math;
- using Font = GTA.Font;
- using System.Linq;
- public class AutoTurnSignals : Script
- {public AutoTurnSignals()
- {Tick += OnTick;}
- public void OnTick(object o, EventArgs e)
- {unsafe
- {int direction = 0;
- float poop = 0;
- float distance = 0;
- if (Game.Player.Character.CurrentVehicle != null)
- {if (Game.IsWaypointActive)
- {var blip = World.GetActiveBlips().FirstOrDefault(b => b.Type == 4 && b.Sprite == BlipSprite.Waypoint);
- Function.Call(Hash.GENERATE_DIRECTIONS_TO_COORD, blip.Position.X, blip.Position.Y, blip.Position.Z, 0, &direction, &poop, &distance);
- //UI.ShowSubtitle(direction.ToString());
- if ((direction == 3 || direction == 6) && (distance < 50))
- {Game.Player.Character.CurrentVehicle.LeftIndicatorLightOn = true;
- Game.Player.Character.CurrentVehicle.RightIndicatorLightOn = false;}
- if ((direction == 4 || direction == 7) && (distance < 50))
- {Game.Player.Character.CurrentVehicle.LeftIndicatorLightOn = false;
- Game.Player.Character.CurrentVehicle.RightIndicatorLightOn = true;}
- if ((direction != 3 && direction != 4 && direction != 6 && direction != 7) || (distance > 50))
- {Game.Player.Character.CurrentVehicle.LeftIndicatorLightOn = false;
- Game.Player.Character.CurrentVehicle.RightIndicatorLightOn = false;}}
- else
- {Game.Player.Character.CurrentVehicle.LeftIndicatorLightOn = false;
- Game.Player.Character.CurrentVehicle.RightIndicatorLightOn = false;}}}}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement