Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'http://gtaxscripting.blogspot.com/
- 'http://www.facebook.com/GtaIVScripting
- 'https://www.youtube.com/user/GTAScripting
- Dim testRot As Vector3
- If Player.Character.isGettingIntoAVehicle Then testRot = Game.CurrentCamera.Rotation
- If Game.isKeyPressed(Keys.ShiftKey) OrElse Exists(Player.Character.CurrentVehicle) Then
- Dim bFound As Boolean = False
- Dim tmpPos As Vector3
- If Exists(Player.Character.CurrentVehicle) Then
- tmpPos = Player.Character.Position + Vector3.WorldUp * -3.5 + Game.CurrentCamera.Direction * 7 '+ Vector3.WorldUp * Game.CurrentCamera.Rotation.X * 0.05
- Else
- tmpPos = Player.Character.Position + Vector3.WorldUp * -4.5 + Game.CurrentCamera.Direction * 7 '+ Vector3.WorldUp * Game.CurrentCamera.Rotation.X * 0.05
- End If
- Dim tmpDist As Double = 0
- Dim tmpPosUp As Vector3
- For Each o As GTA.Object In World.GetAllObjects("bm_contnr_01a")
- If Exists(o) Then
- tmpDist = o.Position.DistanceTo(tmpPos)
- If tmpDist < 4 Then
- bFound = True
- ElseIf tmpDist > 50 Then
- o.Delete()
- Else
- tmpPosUp = o.Position + Vector3.WorldUp * 4
- Native.Function.Call("draw_corona", tmpPosUp.X, tmpPosUp.Y, tmpPosUp.Z, 20 * TRandom.NextDouble, 0, 0, 255, 255, 255)
- End If
- End If
- Next
- If Not bFound Then
- Dim playerCar As Vehicle = Player.Character.CurrentVehicle
- Dim bInCar As Boolean = Exists(playerCar)
- Dim m As Model = New Model("bm_contnr_01a")
- Dim o2 As GTA.Object = World.CreateObject(m, tmpPos)
- o2.NoLongerNeeded()
- o2.FreezePosition = True
- 'Dim tmpRot As Vector3 = Helper.DirectionToRotation(Player.Character.Direction, 0)
- If bInCar Then testRot.Z = playerCar.Rotation.Z
- testRot.Y = 0
- 'tmpRot.X = Game.CurrentCamera.Rotation.X
- 'tmpRot.Y = Game.CurrentCamera.Rotation.Y
- testRot.X = Game.CurrentCamera.Rotation.X
- 'If testRot.X > 360 Then testRot.X = 0
- If bInCar Then
- If testRot.X < 0 Then
- testRot.X *= 0.5
- Else
- testRot.X *= 1.5
- End If
- End If
- o2.Rotation = testRot
- o2 = World.CreateObject(m, o2.GetOffsetPosition(Vector3.RelativeRight * 3))
- o2.Rotation = testRot
- o2 = World.CreateObject(m, o2.GetOffsetPosition(Vector3.RelativeLeft * 6))
- o2.Rotation = testRot
- If bInCar AndAlso (testRot.X > 20) AndAlso (playerCar.Speed < 30) Then playerCar.ApplyForce(playerCar.Direction * testRot.X * 0.1)
- If bInCar AndAlso Game.isGameKeyPressed(GameKey.Sprint) Then playerCar.ApplyForce(playerCar.Direction)
- End If
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement