Advertisement
julioCCs

BasicScript6.vb

Oct 31st, 2012
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 3.13 KB | None | 0 0
  1. Imports System ' basic imports
  2. Imports GTA ' basic imports
  3. Imports System.Windows.Forms ' needed to have access to "keys" enumeration, for example
  4. Imports System.Drawing ' needed to handle colors referencing the color name, ex: myCar.color = System.Drawing.Color.Black
  5.  
  6. Public Class BasicScript
  7.     Inherits Script
  8.    
  9.     Public Sub New()
  10.         Me.interval = 10
  11.     End Sub
  12.    
  13.     private sub msg(sMsg as string, time as int32)
  14.         Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", sMsg, time, 1)
  15.     end sub
  16.    
  17.     Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
  18.         if (e.key = keys.d1) andalso exists(player.character.currentvehicle) then
  19.             for each v as vehicle in world.getvehicles(player.character.position, 6.0)
  20.                 if exists(v) andalso (v <> player.character.currentvehicle) then
  21.                     if not player.character.currentvehicle.model.isHelicopter then
  22.                         native.function.call("ATTACH_CAR_TO_CAR_PHYSICALLY", v, player.character.currentvehicle, false, 0, _
  23.                             0, (player.character.currentvehicle.model.getdimensions.y + 1) * -1, 0.2, _
  24.                             0, 0, 0, _
  25.                             0, 0)
  26.                        
  27.                         v.enginehealth = 0
  28.                     else
  29.                         native.function.call("ATTACH_CAR_TO_CAR_PHYSICALLY", v, player.character.currentvehicle, false, 0, _
  30.                             0, 0, -5.0, _
  31.                             1.0, 1.0, 2.0, _
  32.                             0, 0)
  33.                     end if
  34.                    
  35.                     exit for
  36.                 end if
  37.             next
  38.         end if
  39.        
  40.         if (e.key = keys.d2) andalso exists(player.character.currentvehicle) then
  41.             for each o as gta.object in world.getallobjects
  42.                 if exists(o) andalso (o.position.distanceto(player.character.currentvehicle.position) < 6) andalso not o.isattachedsomewhere then
  43.                     native.function.call("ATTACH_OBJECT_TO_CAR_PHYSICALLY", o, player.character.currentvehicle, false, 0, _
  44.                         0, (player.character.currentvehicle.model.getdimensions.y + 1) * -1, 0.2, _
  45.                         0, 0, 0, _
  46.                         0, 0)
  47.  
  48.                     exit for
  49.                 end if
  50.             next
  51.         end if
  52.        
  53.         if e.key = keys.numpad0 then world.createvehicle("MAVERICK", player.character.position.around(4))
  54.        
  55.         if e.key = keys.d3 then
  56.             dim oAux as gta.object = nothing
  57.             dim o as gta.object
  58.            
  59.             for c as int16 = 1 to 10
  60.                 o = world.createobject("cj_proc_brick", player.character.position.around(1 + c / 2))
  61.                
  62.                 native.function.call("SET_OBJECT_AS_STEALABLE", o, 1)
  63.                
  64.                 if exists(oAux) then
  65.                     native.function.call("ATTACH_OBJECT_TO_OBJECT_PHYSICALLY", o, oAux, false, 0, _
  66.                         0.2, 0, 0, _
  67.                         0.05, 0.05, 0.05, _
  68.                         0, 0)
  69.                 else
  70.                     Native.Function.Call("GIVE_PED_PICKUP_OBJECT", Player.Character, o)
  71.                 end if
  72.                        
  73.                 oAux = o
  74.             next
  75.         end if
  76.     End Sub
  77.     Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
  78.     end sub
  79.    
  80.     Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
  81.     end sub
  82.    
  83.     function rotateVec(vec as vector3, angle as double)
  84.         angle = angle * (3.1415 / 180)
  85.        
  86.         dim s as double = system.math.sin(angle)
  87.         dim c as double = system.math.cos(angle)
  88.        
  89.         vec.x = vec.x * c - vec.y * s
  90.         vec.y = vec.x * s + vec.y * c
  91.        
  92.         return vec
  93.     end function
  94. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement