Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'https://www.youtube.com/user/GTAScripting
- 'http://gtaxscripting.blogspot.com/
- 'http://www.facebook.com/GtaIVScripting
- 'https://twitter.com/julionib
- Imports System
- Imports GTA
- Imports System.Drawing
- Imports System.Windows.Forms
- Public Class ScriptDevelopment
- Inherits Script
- Private vehTargets As Vehicle()
- Private timeWaitSearchTargets As Double = 0
- Private targetAux As GTA.Object = Nothing
- Private targetAuxRoll As Double = 0
- Private actualTarget As Vehicle = Nothing
- Public Sub New()
- Me.Interval = 10
- Wait(500)
- targetAux = World.CreateObject("cj_dart_1", Vector3.Zero)
- targetAux.FreezePosition = True
- targetAux.Collision = False
- targetAux.Visible = False
- End Sub
- Shadows Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
- End Sub
- Shadows Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
- End Sub
- Private Sub general_tick(ByVal sender As Object, ByVal ev As EventArgs) Handles MyBase.Tick
- If timeWaitSearchTargets <= 0 Then
- timeWaitSearchTargets = 300
- vehTargets = World.GetAllVehicles
- Else
- timeWaitSearchTargets -= Me.Interval
- End If
- actualTarget = Nothing
- If Game.isGameKeyPressed(GameKey.Aim) AndAlso Exists(vehTargets) Then
- Dim tmpDist As Double
- Dim tmpPosCompare As Vector3
- For Each v As Vehicle In vehTargets
- If Exists(v) AndAlso (v <> Player.Character.CurrentVehicle) Then
- tmpDist = v.Position.DistanceTo(Game.CurrentCamera.Position)
- tmpPosCompare = Game.CurrentCamera.Position + Game.CurrentCamera.Direction * tmpDist
- If v.Position.DistanceTo(tmpPosCompare) < 1.5 Then
- actualTarget = v
- Exit For
- End If
- End If
- Next
- End If
- If Exists(actualTarget) Then
- Dim tmpTargetPos As Vector3
- Dim tmpDistCoef As Double
- Dim tmpDiameter As Double = 1.5
- Dim tmpRotation As Vector3
- targetAuxRoll += 5
- If targetAuxRoll > 360 Then targetAuxRoll = 0
- 'targetAux.Position = Game.CurrentCamera.Position
- targetAux.Position = Player.Character.Position
- tmpRotation = Game.CurrentCamera.Rotation
- tmpRotation.Y = targetAuxRoll
- targetAux.Rotation = tmpRotation
- tmpDistCoef = actualTarget.Position.DistanceTo(targetAux.Position) / 100
- tmpTargetPos = actualTarget.Position + (targetAux.Position - targetAux.GetOffsetPosition(Vector3.RelativeTop * tmpDiameter))
- Native.Function.Call("DRAW_CHECKPOINT", tmpTargetPos.X, tmpTargetPos.Y, tmpTargetPos.Z, 1 * tmpDistCoef, 255, 0, 0)
- tmpTargetPos = actualTarget.Position + (targetAux.Position - targetAux.GetOffsetPosition(Vector3.RelativeBottom * tmpDiameter))
- Native.Function.Call("DRAW_CHECKPOINT", tmpTargetPos.X, tmpTargetPos.Y, tmpTargetPos.Z, 1 * tmpDistCoef, 255, 0, 0)
- tmpTargetPos = actualTarget.Position + (targetAux.Position - targetAux.GetOffsetPosition(Vector3.RelativeRight * tmpDiameter))
- Native.Function.Call("DRAW_CHECKPOINT", tmpTargetPos.X, tmpTargetPos.Y, tmpTargetPos.Z, 1 * tmpDistCoef, 255, 0, 0)
- tmpTargetPos = actualTarget.Position + (targetAux.Position - targetAux.GetOffsetPosition(Vector3.RelativeLeft * tmpDiameter))
- Native.Function.Call("DRAW_CHECKPOINT", tmpTargetPos.X, tmpTargetPos.Y, tmpTargetPos.Z, 1 * tmpDistCoef, 255, 0, 0)
- actualTarget.ApplyForce(Vector3.WorldUp * 0.5)
- End If
- End Sub
- Private Sub console_CMD(ByVal sender As Object, ByVal e As ConsoleEventArgs) Handles MyBase.ConsoleCommand
- End Sub
- Private Sub GraphicsEventHandler(ByVal sender As Object, ByVal e As GTA.GraphicsEventArgs) Handles MyBase.PerFrameDrawing
- End Sub
- Private Sub msg(ByVal sMsg As String, ByVal time As Int32)
- Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", sMsg, time, 1)
- End Sub
- Private Function intervalFix() As Double
- Return Me.Interval * (Game.FPS / 25)
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement