Advertisement
julioCCs

DelorianEffectFirstTry.vb

Oct 28th, 2012
4,017
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 4.80 KB | None | 0 0
  1. 'http://gtaxscripting.blogspot.com/
  2. 'http://www.facebook.com/GtaIVScripting
  3. 'https://www.youtube.com/user/GTAScripting
  4.  
  5. Imports System ' basic imports
  6. Imports GTA ' basic imports
  7. Imports System.Windows.Forms ' needed to have access to "keys" enumeration, for example
  8. Imports System.Drawing ' needed to handle colors referencing the color name, ex: myCar.color = System.Drawing.Color.Black
  9.  
  10. Public Class DelorianEffectFirstTry
  11.     Inherits Script
  12.    
  13.     private timeCont as int16 = 0
  14.     private myFX1, myFX2, myFX3, myFX4 as int32
  15.     private bPlaySound as boolean = true
  16.    
  17.     Public Sub New()
  18.         Me.interval = 10
  19.     End Sub
  20.    
  21.     private sub msg(sMsg as string, time as int32)
  22.         Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", sMsg, time, 1)
  23.     end sub
  24.    
  25.     Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
  26.     End Sub
  27.     Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp    
  28.     end sub
  29.    
  30.     'ambient_flies_sparked
  31.     'ambient_electrical_sparks
  32.     'break_electrical
  33.     'break_sparks
  34.     'dest_lightbulb_on
  35.     'exp_vehicle_air
  36.     Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
  37.         if exists(player.character.currentvehicle) then        
  38.             if player.character.currentvehicle.speed > 30 then
  39.                 dim pos as vector3 = player.character.currentvehicle.position
  40.                    
  41.                 player.character.currentvehicle.visible = false
  42.                 player.character.visible = false
  43.                 player.character.currentvehicle.applyforce(player.character.currentvehicle.velocity * -1)
  44.                
  45.                 for c as int16 = 5 to 30                   
  46.                     world.startfire((pos + player.character.direction * c).around(1).toground)
  47.                     world.startfire((pos + player.character.direction * c).around(1).toground)
  48.                 next
  49.                
  50.                 dim myCam as camera = new camera
  51.                 myCam.position = game.defaultcamera.position
  52.                 myCam.rotation = game.defaultcamera.rotation
  53.                 myCam.fov = game.defaultcamera.fov
  54.                 myCam.activate
  55.                
  56.                 native.function.call("START_PTFX", "dest_lightbulb_on", pos.x, pos.y, pos.z + 1, 0, 0, 0, 3.0)
  57.                 native.function.call("START_PTFX", "break_electrical", pos.x, pos.y, pos.z + 1, 0, 0, 0, 3.0)
  58.                
  59.                 wait(2000)
  60.                 myCam.deactivate
  61.                
  62.                 World.CurrentDayTime = new System.TimeSpan(World.CurrentDayTime.hours - 10, World.CurrentDayTime.minutes, World.CurrentDayTime.seconds)
  63.                
  64.                 player.character.currentvehicle.applyforce(player.character.currentvehicle.direction * 20)
  65.                
  66.                 for c as int16 = 1 to 5
  67.                     native.function.call("STOP_PTFX", myFX1)
  68.                     native.function.call("STOP_PTFX", myFX2)
  69.                    
  70.                     myFX1 = native.function.call(of int32)("START_PTFX_ON_VEH", "ambient_flies_sparked", player.character.currentvehicle, 0.8, 2.4, 0, -90.0, 90.0, 90.0, 1.0 * (player.character.currentvehicle.speed / 25))
  71.                     myFX2 = native.function.call(of int32)("START_PTFX_ON_VEH", "ambient_flies_sparked", player.character.currentvehicle, -0.8, 2.4, 0, -90.0, 90.0, 90.0, 1.0 * (player.character.currentvehicle.speed / 25))
  72.                     wait(100)
  73.                 next
  74.                
  75.                 native.function.call("STOP_PTFX", myFX1)
  76.                 native.function.call("STOP_PTFX", myFX2)
  77.                
  78.                 player.character.currentvehicle.visible = true
  79.                 player.character.visible = true
  80.             elseif player.character.currentvehicle.speed > 25 then
  81.                 if timeCont mod 50 = 0 then
  82.                     native.function.call("STOP_PTFX", myFX1)
  83.                     native.function.call("STOP_PTFX", myFX2)
  84.                     native.function.call("STOP_PTFX", myFX3)
  85.                     native.function.call("STOP_PTFX", myFX4)
  86.                    
  87.                     myFX1 = native.function.call(of int32)("START_PTFX_ON_VEH", "ambient_flies_sparked", player.character.currentvehicle, 0.8, 2.4, 0, -90.0, 90.0, 90.0, 1.0 * (player.character.currentvehicle.speed / 25))
  88.                     myFX2 = native.function.call(of int32)("START_PTFX_ON_VEH", "ambient_flies_sparked", player.character.currentvehicle, -0.8, 2.4, 0, -90.0, 90.0, 90.0, 1.0 * (player.character.currentvehicle.speed / 25))
  89.                     myFX3 = native.function.call(of int32)("START_PTFX_ON_VEH", "ambient_flies_sparked", player.character.currentvehicle, 0.8, 1.0, 0.35, -90.0, 90.0, 90.0, 1.0 * (player.character.currentvehicle.speed / 25))
  90.                     myFX4 = native.function.call(of int32)("START_PTFX_ON_VEH", "ambient_flies_sparked", player.character.currentvehicle, -0.8, 1.0, 0.35, -90.0, 90.0, 90.0, 1.0 * (player.character.currentvehicle.speed / 25))
  91.                
  92.                     if bPlaySound then
  93.                         bPlaySound = false
  94.                         playsound(".\Scripts\Delorian.wav")
  95.                     end if
  96.                 end if
  97.             else
  98.                 bPlaySound = true
  99.             end if
  100.         end if
  101.        
  102.         timeCont += me.interval
  103.        
  104.         if timeCont > 1000 then timeCont = 0
  105.     end sub
  106.    
  107.     Private Sub PlaySound(ByVal sFile)
  108.         Try
  109.             Dim Sound As New System.Media.SoundPlayer()
  110.  
  111.             Sound.SoundLocation = sFile
  112.             Sound.Load()
  113.             Sound.Play()
  114.         Catch
  115.         End Try
  116.     End Sub
  117. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement