Advertisement
julioCCs

BasicScript2.vb

Oct 21st, 2012
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.80 KB | None | 0 0
  1. 'http://www.facebook.com/GtaIVScripting
  2. 'https://www.youtube.com/user/GTAScripting
  3.  
  4. Imports System ' basic imports
  5. Imports GTA ' basic imports
  6. Imports System.Windows.Forms ' needed to have access to "keys" enumeration, for example
  7. Imports System.Drawing ' needed to handle colors referencing the color name, ex: myCar.color = System.Drawing.Color.Black
  8.  
  9. Public Class BasicScript2
  10.     Inherits Script
  11.    
  12.     Public Sub New()
  13.         Me.interval = 10       
  14.     End Sub
  15.    
  16.     private sub msg(sMsg as string, time as int32)
  17.         Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", sMsg, time, 1)
  18.     end sub
  19.    
  20.     Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
  21.         if (e.key = keys.d1) andalso exists(Game.GetWaypoint) then
  22.             dim myPed as ped
  23.             dim myVeh as vehicle
  24.            
  25.             myPed = World.CreatePed(player.character.position.around(5.0))
  26.             myVeh = world.createvehicle("MAVERICK", player.character.position.around(5.0))
  27.            
  28.             if not exists(myPed) orelse not exists(myVeh) then
  29.                 msg("Error", 2000)
  30.                 exit sub
  31.             end if
  32.            
  33.             myPed.task.EnterVehicle(myVeh, VehicleSeat.Driver)
  34.             player.character.task.EnterVehicle(myVeh, VehicleSeat.LeftRear)        
  35.            
  36.             while (not myPed.isInVehicle orelse not player.character.isInVehicle) andalso not game.iskeypressed(keys.space)
  37.                 wait(200)
  38.                
  39.                 msg("waiting...", 200)
  40.             end while
  41.            
  42.             myPed.task.DriveTo(Game.GetWaypoint.Position.toground, 200, true, true)
  43.             'myPed.task.CruiseWithVehicle(myVeh, 200, true) - dont worked with helicopter, only with car
  44.         end if
  45.     End Sub
  46.     Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
  47.     end sub
  48.    
  49.     Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
  50.     end sub
  51. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement