Advertisement
julioCCs

Tut_1_Interacting.vb

Mar 2nd, 2013
1,022
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.38 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
  6. Imports GTA
  7. Imports System.Drawing
  8. Imports System.Windows.Forms
  9.  
  10. Public Class myBasicScript
  11.     Inherits Script
  12.  
  13.     Public Sub New()
  14.         Me.Interval = 10
  15.     End Sub
  16.  
  17.     Shadows Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
  18.         If e.Key = Keys.NumPad9 Then
  19.             Dim peds As Ped()
  20.             Dim tmpPed As Ped
  21.  
  22.             peds = World.GetPeds(Player.Character.Position, 30)
  23.  
  24.             For Each tmpPed In peds
  25.                 If Exists(tmpPed) AndAlso (tmpPed <> Player.Character) AndAlso Not Exists(tmpPed.CurrentVehicle) Then
  26.                     tmpPed.PreventRagdoll = False
  27.                     tmpPed.ForceRagdoll(2000, True)
  28.                 End If
  29.             Next
  30.  
  31.             For Each tmpPed In peds
  32.                 If Exists(tmpPed) AndAlso (tmpPed <> Player.Character) AndAlso Not Exists(tmpPed.CurrentVehicle) Then
  33.                     tmpPed.ApplyForce(Vector3.Normalize(tmpPed.Position - Player.Character.Position) * 15 + Vector3.WorldUp * 2, Vector3.WorldNorth)
  34.                 End If
  35.             Next
  36.  
  37.  
  38.             For Each v As Vehicle In World.GetVehicles(Player.Character.Position, 30)
  39.                 If Exists(v) Then
  40.                     v.ApplyForce(Vector3.Normalize(v.Position - Player.Character.Position) * 15 + Vector3.WorldUp * 10, Vector3.WorldNorth * 5)
  41.                 End If
  42.             Next
  43.  
  44.             For Each o As GTA.Object In World.GetAllObjects
  45.                 If Exists(o) Then
  46.                     o.Detach()
  47.                     o.ApplyForce(Vector3.Normalize(o.Position - Player.Character.Position) * 15 + Vector3.WorldUp * 10, Vector3.WorldNorth * 5)
  48.                 End If
  49.             Next
  50.         End If
  51.     End Sub
  52.  
  53.     Shadows Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
  54.     End Sub
  55.  
  56.     Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
  57.     End Sub
  58.  
  59.     Private Sub console_CMD(ByVal sender As Object, ByVal e As ConsoleEventArgs) Handles MyBase.ConsoleCommand
  60.     End Sub
  61.  
  62.     Private Sub msg(ByVal sMsg As String, ByVal time As Int32)
  63.         Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", sMsg, time, 1)
  64.     End Sub
  65. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement