Advertisement
julioCCs

Infinite road test

Jun 10th, 2013
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 3.18 KB | None | 0 0
  1. 'http://gtaxscripting.blogspot.com/
  2. 'http://www.facebook.com/GtaIVScripting
  3. 'https://www.youtube.com/user/GTAScripting
  4.  
  5. Dim testRot As Vector3
  6.  
  7.         If Player.Character.isGettingIntoAVehicle Then testRot = Game.CurrentCamera.Rotation
  8.  
  9.         If Game.isKeyPressed(Keys.ShiftKey) OrElse Exists(Player.Character.CurrentVehicle) Then
  10.             Dim bFound As Boolean = False
  11.             Dim tmpPos As Vector3
  12.  
  13.             If Exists(Player.Character.CurrentVehicle) Then
  14.                 tmpPos = Player.Character.Position + Vector3.WorldUp * -3.5 + Game.CurrentCamera.Direction * 7 '+ Vector3.WorldUp * Game.CurrentCamera.Rotation.X * 0.05
  15.             Else
  16.                 tmpPos = Player.Character.Position + Vector3.WorldUp * -4.5 + Game.CurrentCamera.Direction * 7 '+ Vector3.WorldUp * Game.CurrentCamera.Rotation.X * 0.05
  17.             End If
  18.  
  19.             Dim tmpDist As Double = 0
  20.             Dim tmpPosUp As Vector3
  21.  
  22.             For Each o As GTA.Object In World.GetAllObjects("bm_contnr_01a")
  23.                 If Exists(o) Then
  24.                     tmpDist = o.Position.DistanceTo(tmpPos)
  25.                     If tmpDist < 4 Then
  26.                         bFound = True
  27.                     ElseIf tmpDist > 50 Then
  28.                         o.Delete()
  29.                     Else
  30.                         tmpPosUp = o.Position + Vector3.WorldUp * 4
  31.                         Native.Function.Call("draw_corona", tmpPosUp.X, tmpPosUp.Y, tmpPosUp.Z, 20 * TRandom.NextDouble, 0, 0, 255, 255, 255)
  32.                     End If
  33.                 End If
  34.             Next
  35.  
  36.             If Not bFound Then
  37.                 Dim playerCar As Vehicle = Player.Character.CurrentVehicle
  38.                 Dim bInCar As Boolean = Exists(playerCar)
  39.                 Dim m As Model = New Model("bm_contnr_01a")
  40.                 Dim o2 As GTA.Object = World.CreateObject(m, tmpPos)
  41.                 o2.NoLongerNeeded()
  42.                 o2.FreezePosition = True
  43.  
  44.                 'Dim tmpRot As Vector3 = Helper.DirectionToRotation(Player.Character.Direction, 0)
  45.  
  46.                 If bInCar Then testRot.Z = playerCar.Rotation.Z
  47.  
  48.                 testRot.Y = 0
  49.  
  50.                 'tmpRot.X = Game.CurrentCamera.Rotation.X
  51.                 'tmpRot.Y = Game.CurrentCamera.Rotation.Y
  52.  
  53.                 testRot.X = Game.CurrentCamera.Rotation.X
  54.  
  55.                 'If testRot.X > 360 Then testRot.X = 0
  56.  
  57.                 If bInCar Then
  58.                     If testRot.X < 0 Then
  59.                         testRot.X *= 0.5
  60.                     Else
  61.                         testRot.X *= 1.5
  62.                     End If
  63.                 End If
  64.  
  65.                 o2.Rotation = testRot
  66.  
  67.                 o2 = World.CreateObject(m, o2.GetOffsetPosition(Vector3.RelativeRight * 3))
  68.                 o2.Rotation = testRot
  69.  
  70.                 o2 = World.CreateObject(m, o2.GetOffsetPosition(Vector3.RelativeLeft * 6))
  71.                 o2.Rotation = testRot
  72.  
  73.                 If bInCar AndAlso (testRot.X > 20) AndAlso (playerCar.Speed < 30) Then playerCar.ApplyForce(playerCar.Direction * testRot.X * 0.1)
  74.  
  75.                 If bInCar AndAlso Game.isGameKeyPressed(GameKey.Sprint) Then playerCar.ApplyForce(playerCar.Direction)
  76.             End If
  77.         End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement