Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)

Chainsaw.vb

By: julioCCs on Apr 15th, 2013  |  syntax: VB.NET  |  size: 22.38 KB  |  hits: 93  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Imports System
  2. Imports System.Drawing
  3. Imports System.Windows.Forms
  4. Imports GTA
  5. Imports System.IO
  6.  
  7. Public Class ChainSaw
  8.     Inherits Script
  9.  
  10.     Private chainSaw As GTA.Object = Nothing
  11.     Private chainSaw2 As GTA.Object = Nothing
  12.     Private bChainOn As Boolean = False
  13.  
  14.     Private RotAttacking As Vector3
  15.     Private PosAttacking As Vector3
  16.     Private RotWalking As Vector3
  17.     Private PosWalking As Vector3
  18.  
  19.     Private affectedVehicles As Vehicle()
  20.     Private timeSearchAffected As Double = 0
  21.  
  22.     Private bSetWalking As Boolean = True
  23.     Private bSetAttacking As Boolean = True
  24.  
  25.     Private soundWalking As System.Media.SoundPlayer = New System.Media.SoundPlayer
  26.     Private soundAttacking As System.Media.SoundPlayer = New System.Media.SoundPlayer
  27.  
  28.     Shared texBlood1 As Texture
  29.     Shared texBlood2 As Texture
  30.  
  31.     Shared tRandom As Random = New Random()
  32.  
  33.     Shared myInterval As Int16 = 10
  34.  
  35.     Private timeCheckPlayer As Int16 = 0
  36.  
  37.     Private hkActivate As Keys
  38.  
  39.     Private bHasChaina As Boolean = False
  40.  
  41.     Private bWasBikeMode As Boolean = False
  42.     Private bWasntBikeMode As Boolean = False
  43.  
  44.     Private lastPlayerPos As Vector3
  45.  
  46.     Private Function BikeMode() As Boolean
  47.         Return Exists(Player.Character.CurrentVehicle) AndAlso Player.Character.CurrentVehicle.Model.isBike
  48.     End Function
  49.  
  50.     Public Sub New()
  51.         Me.Interval = myInterval
  52.  
  53.         Wait(500)
  54.  
  55.         hkActivate = Helper.StringToKey(settingsGetValueString("hkActivate", "general", "D0"), Keys.D0)
  56.  
  57.         Dim sModel As String = settingsGetValueString("model_name", "general", "chainsaw")
  58.  
  59.         PosAttacking.X = Double.Parse(settingsGetValueString("x", "attack_pos", "-0.05"))
  60.         PosAttacking.Y = Double.Parse(settingsGetValueString("y", "attack_pos", "0.25"))
  61.         PosAttacking.Z = Double.Parse(settingsGetValueString("z", "attack_pos", "-0.3"))
  62.  
  63.         RotAttacking.X = Double.Parse(settingsGetValueString("x", "attack_rot", "-3.6"))
  64.         RotAttacking.Y = Double.Parse(settingsGetValueString("y", "attack_rot", "-0.6"))
  65.         RotAttacking.Z = Double.Parse(settingsGetValueString("z", "attack_rot", "-0.6"))
  66.  
  67.         PosWalking.X = Double.Parse(settingsGetValueString("x", "walking_pos", "0"))
  68.         PosWalking.Y = Double.Parse(settingsGetValueString("y", "walking_pos", "0.2"))
  69.         PosWalking.Z = Double.Parse(settingsGetValueString("z", "walking_pos", "0.35"))
  70.  
  71.         RotWalking.X = Double.Parse(settingsGetValueString("x", "walking_rot", "-1.2"))
  72.         RotWalking.Y = Double.Parse(settingsGetValueString("y", "walking_rot", "1.5"))
  73.         RotWalking.Z = Double.Parse(settingsGetValueString("z", "walking_rot", "0.9"))
  74.  
  75.         Settings.Save()
  76.  
  77.         For Each o As GTA.Object In World.GetAllObjects(sModel)
  78.             o.Delete()
  79.         Next
  80.  
  81.         While Not Exists(chainSaw)
  82.             chainSaw = World.CreateObject(sModel, Vector3.Zero)
  83.             Wait(50)
  84.         End While
  85.  
  86.         chainSaw.Visible = False
  87.         chainSaw.Collision = False
  88.         chainSaw.FreezePosition = True
  89.  
  90.         While Not Exists(chainSaw2)
  91.             chainSaw2 = World.CreateObject(sModel, Vector3.Zero)
  92.             Wait(50)
  93.         End While
  94.  
  95.         chainSaw2.Visible = False
  96.         chainSaw2.Collision = False
  97.         chainSaw2.FreezePosition = True
  98.  
  99.         soundWalking.SoundLocation = ".\scripts\ChainSaw Files\Idle.wav"
  100.         soundAttacking.SoundLocation = ".\scripts\ChainSaw Files\Attack.wav"
  101.  
  102.         texBlood1 = New Texture(File.ReadAllBytes(".\scripts\ChainSaw Files\Blood1.png"))
  103.         texBlood2 = New Texture(File.ReadAllBytes(".\scripts\ChainSaw Files\Blood2.png"))
  104.  
  105.         Native.Function.Call("SET_ANIM_GROUP_FOR_CHAR", Player.Character, "move_player")
  106.  
  107.         Game.Console.Print("Chainsaw script by JulioNIB")
  108.     End Sub
  109.  
  110.     Private Function settingsGetValueString(sOption As String, sCategory As String, sDefault As String) As String
  111.         If Settings.GetValueString(sOption, sCategory, "") = "" Then Settings.SetValue(sOption, sCategory, sDefault)
  112.  
  113.         Return Settings.GetValueString(sOption, sCategory, "")
  114.     End Function
  115.  
  116.     Private Class Blood
  117.         Public tex As Texture
  118.         Public x, y, w, h As Int16
  119.         Public timeWait As Double
  120.  
  121.         Public Sub New()
  122.             If tRandom.NextDouble <= 0.5 Then
  123.                 tex = texBlood1
  124.             Else
  125.                 tex = texBlood2
  126.             End If
  127.  
  128.             x = Game.Resolution.Width * tRandom.NextDouble + 10
  129.             y = Game.Resolution.Height * tRandom.NextDouble + 10
  130.  
  131.             w = 55 + tRandom.NextDouble
  132.             h = 55 + tRandom.NextDouble
  133.  
  134.             timeWait = tRandom.Next(100, 300)
  135.         End Sub
  136.  
  137.         Public Sub tick()
  138.             y += 1
  139.  
  140.             w -= tRandom.NextDouble * 0.7
  141.             h = w
  142.  
  143.             If timeWait > 0 Then timeWait -= myInterval
  144.         End Sub
  145.     End Class
  146.  
  147.     Private BloodList As New List(Of Blood)
  148.     Private tmpBlood As Blood
  149.  
  150.     Private Class Peds
  151.         Public p As Ped
  152.         Public bleedingTime As Double = 0
  153.         Public fleeing As Boolean = False
  154.  
  155.         Public Sub New(tped As Ped)
  156.             p = tped
  157.         End Sub
  158.  
  159.         Public Sub flee(attacker As Ped)
  160.             fleeing = True
  161.  
  162.             If (tRandom.NextDouble < 0.5) AndAlso Not p.CurrentVehicle Is Nothing AndAlso (p.CurrentVehicle.GetPedOnSeat(VehicleSeat.Driver) = p) Then
  163.                 p.Task.CruiseWithVehicle(p.CurrentVehicle, 80, False)
  164.             Else
  165.                 p.Task.FleeFromChar(attacker)
  166.             End If
  167.         End Sub
  168.     End Class
  169.  
  170.     Private PedsList As New List(Of Peds)
  171.     Private tmpPed As Peds = Nothing
  172.  
  173.     Private Sub msg(ByVal smsg As String, ByVal duracao As Int32)
  174.         Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", smsg, duracao, 1)
  175.     End Sub
  176.  
  177.     Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
  178.         If e.Key = hkActivate Then
  179.             If Player.Character.isRagdoll OrElse (Exists(Player.Character.CurrentVehicle) AndAlso Not Player.Character.CurrentVehicle.Model.isBike) Then
  180.                 bChainOn = False
  181.                 Exit Sub
  182.             End If
  183.  
  184.             bChainOn = Not bChainOn
  185.  
  186.             If bChainOn Then
  187.                 equipChain()
  188.             Else
  189.                 stopChain(False)
  190.             End If
  191.         End If
  192.  
  193.         If bChainOn AndAlso (e.Key = Keys.RButton) AndAlso Not Exists(Player.Character.CurrentVehicle) AndAlso _
  194.            Not Native.Function.Call(Of Boolean)("IS_CHAR_PLAYING_ANIM", Player.Character, "gun@ak47", "melee") Then
  195.             Player.Character.Animation.Play(New AnimationSet("gun@ak47"), "melee", 5, AnimationFlags.Unknown12 Or AnimationFlags.Unknown11 Or AnimationFlags.Unknown10 Or AnimationFlags.Unknown09)
  196.         End If
  197.     End Sub
  198.  
  199.     Private Sub equipChain()
  200.         bChainOn = True
  201.  
  202.         chainSaw.Collision = True
  203.         chainSaw.Visible = True
  204.         bSetAttacking = True
  205.         bSetWalking = True
  206.         timeCheckPlayer = 0
  207.  
  208.         If BikeMode() Then
  209.             chainSaw2.Collision = True
  210.             chainSaw2.Visible = True
  211.             chainSaw2.FreezePosition = False
  212.         Else
  213.             chainSaw2.Collision = False
  214.             chainSaw2.Visible = False
  215.             chainSaw2.FreezePosition = True
  216.         End If
  217.     End Sub
  218.  
  219.     Private Sub stopChain(bDropChain As Boolean)
  220.         bChainOn = False
  221.  
  222.         chainSaw.Detach()
  223.         chainSaw.Velocity = (Vector3.WorldDown)
  224.  
  225.         chainSaw2.Detach()
  226.         chainSaw2.Velocity = (Vector3.WorldDown)
  227.  
  228.         If Not bDropChain Then
  229.             chainSaw.Visible = False
  230.             chainSaw.Collision = False
  231.             chainSaw.FreezePosition = True
  232.  
  233.             chainSaw2.Visible = False
  234.             chainSaw2.Collision = False
  235.             chainSaw2.FreezePosition = True
  236.         End If
  237.  
  238.         Native.Function.Call("SET_ANIM_GROUP_FOR_CHAR", Player.Character, "move_player")
  239.  
  240.         bSetAttacking = True
  241.         bSetWalking = True
  242.  
  243.         soundAttacking.Stop()
  244.         soundWalking.Stop()
  245.     End Sub
  246.  
  247.     Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
  248.        
  249.     End Sub
  250.  
  251.     Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
  252.         If bChainOn AndAlso (timeCheckPlayer Mod 500 = 0) Then
  253.             If (Player.Character.Health <= 0) OrElse _
  254.                Native.Function.Call(Of Boolean)("IS_PLAYER_BEING_ARRESTED", Player) Then
  255.                 stopChain(True)
  256.  
  257.                 Exit Sub
  258.             ElseIf Exists(Player.Character.CurrentVehicle) AndAlso Not BikeMode() Then
  259.                 stopChain(False)
  260.  
  261.                 Exit Sub
  262.             End If
  263.         ElseIf Not bChainOn AndAlso (timeCheckPlayer Mod 4000 = 0) Then
  264.             chainSaw.Visible = False
  265.             chainSaw.Collision = False
  266.             chainSaw.FreezePosition = True
  267.  
  268.             chainSaw2.Visible = False
  269.             chainSaw2.Collision = False
  270.             chainSaw2.FreezePosition = True
  271.         End If
  272.  
  273.         timeCheckPlayer += myInterval
  274.  
  275.         If timeCheckPlayer > 5000 Then timeCheckPlayer = 0
  276.  
  277.         If bChainOn Then
  278.             Dim bBikeMode As Boolean = BikeMode()
  279.  
  280.             If bBikeMode AndAlso Not bWasBikeMode Then
  281.                 chainSaw2.Visible = True
  282.                 chainSaw2.Collision = True
  283.                 chainSaw2.FreezePosition = False
  284.  
  285.                 bSetWalking = True
  286.                 bSetAttacking = True
  287.             End If
  288.  
  289.             If Not bBikeMode AndAlso Not bWasntBikeMode Then
  290.                 chainSaw2.Visible = False
  291.                 chainSaw2.Collision = False
  292.                 chainSaw2.FreezePosition = True
  293.  
  294.                 bSetWalking = True
  295.                 bSetAttacking = True
  296.             End If
  297.  
  298.             bWasBikeMode = bBikeMode
  299.             bWasntBikeMode = Not bBikeMode
  300.  
  301.             Try
  302.                 Dim tmpRot As Vector3 = RotAttacking
  303.                 tmpRot.Y *= -1
  304.  
  305.                 If Not Game.isGameKeyPressed(GameKey.Sprint) AndAlso (Game.isGameKeyPressed(GameKey.MoveForward) OrElse Game.isGameKeyPressed(GameKey.MoveBackward)) Then
  306.                     If bSetAttacking Then
  307.                         bSetAttacking = False
  308.                         bSetWalking = True
  309.  
  310.                         If Not bBikeMode Then
  311.                             Native.Function.Call("SET_ANIM_GROUP_FOR_CHAR", Player.Character, "move_melee")
  312.                             chainSaw.AttachToPed(Player.Character, Bone.LeftHand, PosAttacking, RotAttacking)
  313.                         Else
  314.                             chainSaw.AttachToPed(Player.Character, Bone.LeftHand, Vector3.Zero, RotAttacking)
  315.                             chainSaw2.AttachToPed(Player.Character, Bone.RightHand, Vector3.Zero, tmpRot)
  316.                         End If
  317.  
  318.                         soundAttacking.PlayLooping()
  319.                     End If
  320.                 Else
  321.                     If bSetWalking Then
  322.                         bSetAttacking = True
  323.                         bSetWalking = False
  324.  
  325.                         If Not bBikeMode Then
  326.                             Native.Function.Call("SET_ANIM_GROUP_FOR_CHAR", Player.Character, "move_rifle")
  327.                             chainSaw.AttachToPed(Player.Character, Bone.LeftHand, PosWalking, RotWalking)
  328.                         Else
  329.                             chainSaw.AttachToPed(Player.Character, Bone.LeftHand, Vector3.Zero, RotAttacking)
  330.                             chainSaw2.AttachToPed(Player.Character, Bone.RightHand, Vector3.Zero, tmpRot)
  331.                         End If
  332.  
  333.                         soundWalking.PlayLooping()
  334.                     End If
  335.                 End If
  336.  
  337.                 If Not Exists(Player.Character.CurrentVehicle) AndAlso (lastPlayerPos = Player.Character.Position) Then
  338.                     Player.Character.Task.ClearAll()
  339.                 End If
  340.  
  341.                 lastPlayerPos = Player.Character.Position
  342.  
  343.                 Dim mySpeed As Double = Player.Character.Velocity.DistanceTo(Vector3.Zero)
  344.  
  345.                 If Exists(Player.Character.CurrentVehicle) Then mySpeed = Player.Character.CurrentVehicle.Speed
  346.  
  347.                 If timeSearchAffected <= 0 Then
  348.                     timeSearchAffected = 500
  349.  
  350.                     PedsList.Clear()
  351.  
  352.                     For Each p As Ped In World.GetPeds(Player.Character.Position, 20)
  353.                         If Exists(p) AndAlso (p <> Player.Character) AndAlso (p.Health > 0) Then
  354.                             tmpPed = New Peds(p)
  355.                             PedsList.Add(tmpPed)
  356.                         End If
  357.                     Next
  358.  
  359.                     affectedVehicles = World.GetVehicles(Player.Character.Position, 20)
  360.                 Else
  361.                     timeSearchAffected -= Interval
  362.  
  363.                     If mySpeed > 7.5 Then timeSearchAffected -= Interval
  364.                 End If
  365.  
  366.                 Dim tmpPos As Vector3
  367.                 Dim tmpPos2 As Vector3
  368.                 Dim tmpDim As Vector3
  369.                 Dim closetToHood As Boolean = False
  370.                 Dim closetToTrunk As Boolean = False
  371.                 Dim closetToHood2 As Boolean = False
  372.                 Dim closetToTrunk2 As Boolean = False
  373.                 Dim bCloseToPos2 As Boolean = False
  374.  
  375.                 If Not bBikeMode Then
  376.                     tmpPos = chainSaw.GetOffsetPosition(Vector3.RelativeRight)
  377.                     tmpPos2 = chainSaw.GetOffsetPosition(Vector3.RelativeRight * 0.5)
  378.                 Else
  379.                     tmpPos = chainSaw.GetOffsetPosition(Vector3.RelativeRight * 0.5)
  380.                     tmpPos2 = chainSaw2.GetOffsetPosition(Vector3.RelativeRight * 0.5)
  381.                 End If
  382.  
  383.                 'Native.Function.Call("draw_corona", tmpPos.X, tmpPos.Y, tmpPos.Z, 10.0, 0, 0, 255, 0, 0)
  384.                 'Native.Function.Call("draw_corona", tmpPos2.X, tmpPos2.Y, tmpPos2.Z, 10.0, 0, 0, 255, 255, 0)
  385.  
  386.                 For Each v As Vehicle In affectedVehicles
  387.                     If Exists(v) AndAlso (v <> Player.Character.CurrentVehicle) Then
  388.                         tmpDim = v.Model.GetDimensions
  389.  
  390.                         If Not bBikeMode Then tmpDim.X = tmpDim.X * 0.5
  391.  
  392.                         closetToHood = (v.GetOffsetPosition(Vector3.RelativeFront * tmpDim.Y * 0.3).DistanceTo(tmpPos) < tmpDim.X)
  393.                         closetToTrunk = (v.GetOffsetPosition(Vector3.RelativeBack * tmpDim.Y * 0.3).DistanceTo(tmpPos) < tmpDim.X)
  394.  
  395.                         If bBikeMode AndAlso Not closetToHood Then _
  396.                             closetToHood2 = (bBikeMode AndAlso (v.GetOffsetPosition(Vector3.RelativeFront * tmpDim.Y * 0.3).DistanceTo(tmpPos2) < tmpDim.X))
  397.                         If bBikeMode AndAlso Not closetToTrunk Then _
  398.                             closetToTrunk2 = (bBikeMode AndAlso (v.GetOffsetPosition(Vector3.RelativeBack * tmpDim.Y * 0.3).DistanceTo(tmpPos2) < tmpDim.X))
  399.  
  400.                         If Not closetToHood AndAlso Not closetToHood2 AndAlso Not closetToTrunk AndAlso Not closetToTrunk2 Then _
  401.                             bCloseToPos2 = (v.Position.DistanceTo(tmpPos2) < tmpDim.X)
  402.  
  403.                         If (v.Model.isBike AndAlso (v.Position.DistanceTo(tmpPos) < 1)) OrElse _
  404.                            (v.Position.DistanceTo(tmpPos) < tmpDim.X) OrElse closetToHood OrElse closetToTrunk OrElse _
  405.                            closetToHood2 OrElse closetToTrunk2 OrElse bCloseToPos2 Then
  406.  
  407.                             If bCloseToPos2 OrElse closetToHood2 OrElse closetToTrunk2 Then
  408.                                 Native.Function.Call("TRIGGER_PTFX_ON_OBJ", "imp_bullet_metal", chainSaw2,
  409.                                     0.8, 0, 0, 0, 0, 90.0, 1.5)
  410.                                 Native.Function.Call("PLAY_SOUND_FROM_position", -1, "random_main_metal_collisions", tmpPos2.X, tmpPos2.Y, tmpPos2.Z)
  411.                             Else
  412.                                 Native.Function.Call("TRIGGER_PTFX_ON_OBJ", "imp_bullet_metal", chainSaw,
  413.                                     0.8, 0, 0, 0, 0, 90.0, 1.5)
  414.                                 Native.Function.Call("PLAY_SOUND_FROM_position", -1, "random_main_metal_collisions", tmpPos.X, tmpPos.Y, tmpPos.Z)
  415.                             End If
  416.  
  417.                             v.ApplyForce(Vector3.WorldDown * 0.05)
  418.  
  419.                             If v.GetOffsetPosition(Vector3.RelativeLeft).DistanceTo(tmpPos) < tmpDim.X Then
  420.                                 Native.Function.Call("BREAK_CAR_DOOR", v, 0, False)
  421.                                 Native.Function.Call("BREAK_CAR_DOOR", v, 2, False)
  422.                             End If
  423.  
  424.                             If v.GetOffsetPosition(Vector3.RelativeRight).DistanceTo(tmpPos) < tmpDim.X Then
  425.                                 Native.Function.Call("BREAK_CAR_DOOR", v, 1, False)
  426.                                 Native.Function.Call("BREAK_CAR_DOOR", v, 3, False)
  427.                             End If
  428.  
  429.                             If closetToHood OrElse closetToHood2 Then
  430.                                 Native.Function.Call("BREAK_CAR_DOOR", v, 4, False)
  431.                             End If
  432.                             If closetToTrunk OrElse closetToTrunk2 Then
  433.                                 Native.Function.Call("BREAK_CAR_DOOR", v, 5, False)
  434.                             End If
  435.  
  436.                             For Each p As Peds In PedsList
  437.                                 If Exists(p.p) AndAlso (p.p.CurrentVehicle = v) AndAlso (p.p.Health > 0) Then
  438.                                     p.p.LeaveVehicle()
  439.  
  440.                                     If p.p.PedType = PedType.Cop Then
  441.                                         Native.Function.Call("ALTER_WANTED_LEVEL_no_drop", Player, 2)
  442.                                         Native.Function.Call("APPLY_WANTED_LEVEL_CHANGE_NOW", Player)
  443.                                     Else
  444.                                         p.p.Task.FleeFromChar(Player.Character)
  445.                                     End If
  446.                                 End If
  447.                             Next
  448.                         End If
  449.                     End If
  450.                 Next
  451.  
  452.                 Player.Character.Weapons.Unarmed.Select()
  453.  
  454.                 Dim bKiller As Boolean = False
  455.  
  456.                 For Each p As Peds In PedsList
  457.                     If Not Exists(p.p) Then
  458.                         PedsList.RemoveAt(PedsList.IndexOf(p))
  459.                         Exit For
  460.                     End If
  461.  
  462.                     'Native.Function.Call("draw_corona", p.p.Position.X, p.p.Position.Y, p.p.Position.Z, 10.0, 0, 0, 0, 255, 0)
  463.  
  464.                     If p.bleedingTime <= 0 Then
  465.                         If (p.p.Health > 0) AndAlso (((p.p.Position.DistanceTo(tmpPos) < 0.5) OrElse (p.p.Position.DistanceTo(tmpPos2) < 0.5)) OrElse _
  466.                            (bBikeMode AndAlso ((p.p.Position.DistanceTo(tmpPos) < 1.5) OrElse (p.p.Position.DistanceTo(tmpPos2) < 1.5)))) Then
  467.                             If Not p.p.isInVehicle Then
  468.                                 p.p.CancelAmbientSpeech()
  469.  
  470.                                 p.bleedingTime = 100
  471.  
  472.                                 If p.p.PedType = PedType.Cop Then
  473.                                     Native.Function.Call("ALTER_WANTED_LEVEL_no_drop", Player, 2)
  474.                                     Native.Function.Call("APPLY_WANTED_LEVEL_CHANGE_NOW", Player)
  475.                                 End If
  476.  
  477.                                 p.p.Task.ClearAll()
  478.                                 p.p.Task.FleeFromChar(Player.Character)
  479.  
  480.                                 Dim tmpBloodCount As Int16 = tRandom.Next(20, 50)
  481.  
  482.                                 For c As Int16 = 1 To tmpBloodCount
  483.                                     tmpBlood = New Blood
  484.                                     BloodList.Add(tmpBlood)
  485.  
  486.                                     If BloodList.Count > 100 Then Exit For
  487.                                 Next
  488.  
  489.                                 bKiller = True
  490.                             Else
  491.                                 p.p.LeaveVehicle()
  492.                             End If
  493.                         ElseIf bKiller Then
  494.                             If p.p.PedType = PedType.Cop Then
  495.                                 Native.Function.Call("ALTER_WANTED_LEVEL_no_drop", Player, 2)
  496.                                 Native.Function.Call("APPLY_WANTED_LEVEL_CHANGE_NOW", Player)
  497.                             ElseIf Not p.fleeing Then
  498.                                 p.flee(Player.Character)
  499.                             End If
  500.                         End If
  501.                     Else
  502.                         p.bleedingTime -= Interval
  503.  
  504.                         Native.Function.Call("TRIGGER_PTFX_ON_PED", "blood_wheel_squash", p.p,
  505.                             0, 0, 0, 0, 0, 0, 1.0)
  506.                         Native.Function.Call("PLAY_SOUND_FROM_position", -1, "special_someone_blood", p.p.Position.X, p.p.Position.Y, p.p.Position.Z)
  507.                         Native.Function.Call("HIGH_FALL_SCREAM", p.p)
  508.  
  509.                         If bBikeMode Then
  510.                             p.p.ApplyForce(Vector3.Normalize(Player.Character.CurrentVehicle.Velocity) * 0.05 + Vector3.WorldUp * 0.5)
  511.                         Else
  512.                             p.p.ApplyForce(Player.Character.Direction * 0.5 + Vector3.WorldDown * 0.5)
  513.                         End If
  514.  
  515.                         If p.bleedingTime <= 0 Then
  516.                             p.p.Die()
  517.                             PedsList.RemoveAt(PedsList.IndexOf(p))
  518.                             Exit For
  519.                         End If
  520.                     End If
  521.                 Next
  522.             Catch
  523.                 PedsList.Clear()
  524.             End Try
  525.         End If
  526.  
  527.         For Each b As Blood In BloodList
  528.             b.tick()
  529.  
  530.             If Not bChainOn Then
  531.                 b.tick()
  532.                 b.tick()
  533.             End If
  534.  
  535.             If b.w < 15 Then
  536.                 BloodList.RemoveAt(BloodList.IndexOf(b))
  537.                 Exit For
  538.             End If
  539.         Next
  540.     End Sub
  541.  
  542.     Private Sub console_CMD(ByVal sender As Object, ByVal e As ConsoleEventArgs) Handles MyBase.ConsoleCommand
  543.     End Sub
  544.  
  545.     Private Sub GraphicsEventHandler(ByVal sender As Object, ByVal e As GTA.GraphicsEventArgs) Handles MyBase.PerFrameDrawing
  546.         For Each b As Blood In BloodList
  547.             If b.timeWait <= 0 Then _
  548.                 e.Graphics.DrawSprite(b.tex, b.x, b.y, b.w, b.h, 0)
  549.         Next
  550.     End Sub
  551. End Class