Advertisement
julioCCs

BasicScript4.vb

Oct 26th, 2012
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 3.02 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 BasicScript
  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) then
  22.             dim vList as vehicle()
  23.             dim v as vehicle
  24.            
  25.             vList = world.GetVehicles(player.character.position, 10.0)
  26.            
  27.             for each v in vList
  28.                 if exists(v) then v.applyforce(vector3.worldup * 20)
  29.             next           
  30.         end if
  31.        
  32.         if (e.key = keys.d2) then
  33.             dim pList as ped()
  34.             dim p as ped
  35.            
  36.             pList = world.GetPeds(player.character.position, 10.0)
  37.            
  38.             for each p in pList
  39.                 if exists(p) andalso (p <> player.character) then
  40.                     p.isonfire = true
  41.                     p.isragdoll = true
  42.                 end if
  43.             next           
  44.         end if
  45.        
  46.         if (e.key = keys.d3) then
  47.             dim oList as gta.object()
  48.             dim o as gta.object
  49.            
  50.             oList = world.GetAllObjects
  51.            
  52.             for each o in oList
  53.                 if exists(o) then
  54.                     o.detach
  55.                     o.applyforce(vector3.worldup * 20)
  56.                 end if
  57.             next           
  58.         end if
  59.     End Sub
  60.     Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
  61.     end sub
  62.    
  63.     Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick 
  64.         if player.character.isInMeleeCombat then
  65.             for each p as ped in world.GetPeds(player.character.position, 10.0)
  66.                 if exists(p) andalso (p <> player.character) andalso native.function.call(of boolean)("HAS_CHAR_BEEN_DAMAGED_BY_CHAR", p, player.character) then
  67.                     p.isragdoll = true
  68.                     p.velocity = vector3.worldup * 5
  69.                    
  70.                     native.function.call("CLEAR_CHAR_LAST_DAMAGE_ENTITY", p)
  71.                 end if
  72.             next
  73.         end if
  74.        
  75.         if player.character.isShooting then
  76.             for each p as ped in world.GetPeds(player.character.position + player.character.direction * 50, 50.0)
  77.                 if exists(p) andalso (p <> player.character) andalso native.function.call(of boolean)("HAS_CHAR_BEEN_DAMAGED_BY_CHAR", p, player.character) then
  78.                     p.isragdoll = true
  79.                     p.velocity = vector3.worldup * 5
  80.                    
  81.                     native.function.call("CLEAR_CHAR_LAST_DAMAGE_ENTITY", p)
  82.                 end if
  83.             next
  84.            
  85.             for each v as vehicle in world.GetVehicles(player.character.position + player.character.direction * 50, 50.0)
  86.                 if exists(v) andalso native.function.call(of boolean)("HAS_CAR_BEEN_DAMAGED_BY_CHAR", v, player.character) then
  87.                     v.applyforce(vector3.worldup * 5)
  88.                    
  89.                     native.function.call("CLEAR_CAR_LAST_DAMAGE_ENTITY", v)
  90.                 end if
  91.             next
  92.            
  93.             player.character.health += 20
  94.         end if     
  95.     end sub
  96. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement