Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'http://gtaxscripting.blogspot.com/
- 'http://www.facebook.com/GtaIVScripting
- 'https://www.youtube.com/user/GTAScripting
- ' sorry people, i have no time now to comment and explain this mess :(
- ' this is not the best way to do the effects but works almost as expected
- ' this is my first script for GTA IV, totaly wierd
- ' by JulioNIB
- Imports System
- Imports System.Drawing
- Imports System.Windows.Forms
- Imports GTA
- Public Class TelekinesisPowers
- Inherits Script
- Private SOn As Boolean = True
- Private GTAIVVersion As Boolean = game.currentepisode = gameepisode.GTAIV
- private showKeyCode as boolean = false
- private vehFloatArray() as vehicle
- private vehFloatCont as int32 = 0
- private pedFloatArray() as ped
- private pedFloatCont as int32 = 0
- private oFakeCR as gta.object
- private vecOFakeCR as vector3
- private vehAlvoThrow as vehicle
- private pedAlvoThrow as ped
- private bClearArray as boolean = false
- private chkWarp as checkpoint
- private bPreviewWarpPos as boolean = false
- private bTelToWaypoint as boolean = true
- private bTelToWaypointInProgress as boolean = false
- private bAutoHeal as boolean = true
- private bFloatThingsFollowPl as boolean = true
- private bSafeWarpToVehicle as boolean = false
- Private hkThrowAuto, hkFloatThings, hkThrowFloatThings, hkWarpVehicle, hkWarpAnywhere, hkWarpWaypoint, keyNitro, keyHidraulics, _
- keySlowMotion, keyAim, keyHelp, keyNitroBoatBike, maxFloatPed, maxFloatVehicle As Int32
- private vecNitro as vector3
- private animSetJump_Std as animationset = new animationset("jump_std")
- private DistTargetVehicle, DistTargetPed, DistTargetObj, DistTargetHelicopter as double
- private bShowHelp as boolean = false
- Private HidraulicsForce As Double
- Private TargetedVehAutoIncDist As Double
- Private bAchouVeh As Boolean = True
- Public Sub New()
- Me.interval = 100
- chkWarp = new checkpoint
- chkWarp.visible = false
- chkWarp.color = system.drawing.color.FromArgb(100, system.drawing.color.red)
- chkWarp.position = player.character.position
- chkWarp.diameter = 2
- settings.load
- if Settings.GetValueKey("Skill_ThrowAuto", "Hotkeys", -1) = -1 then Settings.SetValue("Skill_ThrowAuto", "Hotkeys", Keys.D1)
- if Settings.GetValueKey("Skill_FloatThings", "Hotkeys", -1) = -1 then Settings.SetValue("Skill_FloatThings", "Hotkeys", Keys.D2)
- if Settings.GetValueKey("Skill_ThrowFloatingThings", "Hotkeys", -1) = -1 then Settings.SetValue("Skill_ThrowFloatingThings", "Hotkeys", Keys.D3)
- if Settings.GetValueKey("Skill_WarpToVehicle", "Hotkeys", -1) = -1 then Settings.SetValue("Skill_WarpToVehicle", "Hotkeys", Keys.D4)
- if Settings.GetValueKey("Skill_WarpToAnywhere", "Hotkeys", -1) = -1 then Settings.SetValue("Skill_WarpToAnywhere", "Hotkeys", Keys.D5)
- if Settings.GetValueKey("Skill_WarpToWaypoint", "Hotkeys", -1) = -1 then Settings.SetValue("Skill_WarpToWaypoint", "Hotkeys", Keys.D6)
- if Settings.GetValueKey("SlowMotion", "Hotkeys", -1) = -1 then Settings.SetValue("SlowMotion", "Hotkeys", Keys.LMenu)
- if Settings.GetValueKey("Aim", "Hotkeys", -1) = -1 then Settings.SetValue("Aim", "Hotkeys", Keys.RButton)
- if Settings.GetValueKey("Nitro", "Hotkeys", -1) = -1 then Settings.SetValue("Nitro", "Hotkeys", Keys.LShiftKey)
- if Settings.GetValueKey("Nitro_boat_bike", "Hotkeys", -1) = -1 then Settings.SetValue("Nitro_boat_bike", "Hotkeys", Keys.MButton)
- If Settings.GetValueKey("SuperHidraulics", "Hotkeys", -1) = -1 Then Settings.SetValue("SuperHidraulics", "Hotkeys", Keys.LControlKey)
- If Settings.GetValueKey("ShowHelp", "Hotkeys", -1) = -1 Then Settings.SetValue("ShowHelp", "Hotkeys", Keys.F1)
- if Settings.GetValueKey("Max_floating_peds", "General", -1) = -1 then Settings.SetValue("Max_floating_peds", "General", 20)
- if Settings.GetValueKey("Max_floating_vehicles", "General", -1) = -1 then Settings.SetValue("Max_floating_vehicles", "General", 20)
- if Settings.GetValueKey("AutoHeal", "General", -1) = -1 then Settings.SetValue("AutoHeal", "General", 1)
- if Settings.GetValueKey("FloatThings_follow_player", "General", -1) = -1 then Settings.SetValue("FloatThings_follow_player", "General", 1)
- if Settings.GetValueKey("Safe_Warp_to_Vehicle", "General", -1) = -1 then Settings.SetValue("Safe_Warp_to_Vehicle", "General", 0)
- if Settings.GetValueKey("getTargeted_Vehicle_around", "General", -1) = -1 then Settings.SetValue("getTargeted_Vehicle_around", "General", 1)
- if Settings.GetValueKey("getTargeted_Ped_around", "General", -1) = -1 then Settings.SetValue("getTargeted_Ped_around", "General", 1)
- if Settings.GetValueKey("getTargeted_Object_around", "General", -1) = -1 then Settings.SetValue("getTargeted_Object_around", "General", 1)
- if Settings.GetValueKey("getTargeted_Helicopter_around", "General", -1) = -1 then Settings.SetValue("getTargeted_Helicopter_around", "General", 3)
- if Settings.GetValueKey("Hidraulics_Force", "General", -1) = -1 then Settings.SetValue("Hidraulics_Force", "General", 7)
- settings.save
- hkThrowAuto = Settings.GetValueKey("Skill_ThrowAuto", "Hotkeys", Keys.D1)
- hkFloatThings = Settings.GetValueKey("Skill_FloatThings", "Hotkeys", Keys.D2)
- hkThrowFloatThings = Settings.GetValueKey("Skill_ThrowFloatingThings", "Hotkeys", Keys.D3)
- hkWarpVehicle = Settings.GetValueKey("Skill_WarpToVehicle", "Hotkeys", Keys.D4)
- hkWarpAnywhere = Settings.GetValueKey("Skill_WarpToAnywhere", "Hotkeys", Keys.D5)
- hkWarpWaypoint = Settings.GetValueKey("Skill_WarpToWaypoint", "Hotkeys", Keys.D6)
- keyNitro = Settings.GetValueKey("Nitro", "Hotkeys", Keys.LShiftKey)
- keyNitroBoatBike = Settings.GetValueKey("Nitro_boat_bike", "Hotkeys", Keys.MButton)
- keyHidraulics = Settings.GetValueKey("SuperHidraulics", "Hotkeys", Keys.LControlKey)
- keySlowMotion = Settings.GetValueKey("SlowMotion", "Hotkeys", Keys.LMenu)
- keyAim = Settings.GetValueKey("Aim", "Hotkeys", Keys.RButton)
- keyHelp = Settings.GetValueKey("ShowHelp", "Hotkeys", Keys.F1)
- maxFloatPed = Settings.GetValueKey("Max_floating_peds", "General", 20) - 1
- maxFloatVehicle = Settings.GetValueKey("Max_floating_vehicles", "General", 20) - 1
- bAutoHeal = Settings.GetValueKey("AutoHeal", "General", 1) = 1
- bFloatThingsFollowPl = Settings.GetValueKey("FloatThings_follow_player", "General", 1) = 1
- bSafeWarpToVehicle = Settings.GetValueKey("Safe_Warp_to_Vehicle", "General", 0) = 1
- DistTargetVehicle = Settings.GetValueKey("getTargeted_Vehicle_around", "General", 1)
- DistTargetPed = Settings.GetValueKey("getTargeted_Ped_around", "General", 1)
- DistTargetObj = Settings.GetValueKey("getTargeted_Object_around", "General", 1)
- DistTargetHelicopter = Settings.GetValueKey("getTargeted_Helicopter_around", "General", 3)
- HidraulicsForce = Settings.GetValueKey("Hidraulics_Force", "General", 7)
- redim pedFloatArray(maxFloatPed)
- redim vehFloatArray(maxFloatVehicle)
- End Sub
- private sub msg(smsg as string, duracao as int32)
- Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", smsg, duracao, 1)
- end sub
- private function random(min as int32, max as int32)
- dim rnd as random = new random(System.DateTime.Now.Millisecond)
- random = rnd.next(min, max)
- end function
- private sub console_CMD(ByVal sender As Object, ByVal e As ConsoleEventArgs) Handles MyBase.ConsoleCommand
- 'if e.command = "teclas" then
- 'showKeyCode = Not showKeyCode
- 'msg("Mostra teclas: " & Convert.ToString(showKeyCode), 2000)
- 'end if
- If e.Command = "TK" Then
- SOn = Not SOn
- If Not SOn Then
- msg("Telekinesis powers OFF", 3000)
- Else
- msg("Telekinesis powers ON", 3000)
- End If
- End If
- end sub
- private sub waitEx(time as int32)
- dim c as double = 0
- while c < time
- c += me.interval * 1.5
- wait(me.interval)
- Geral_tick(nothing, nothing)
- end while
- end sub
- Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
- If Not SOn Then Exit Sub
- If e.Key = 9 Then
- If bFloatThingsFollowPl Then
- bFloatThingsFollowPl = False
- msg("FloatThings dont follow player...", 3000)
- Settings.SetValue("FloatThings_follow_player", "General", 0)
- Else
- bFloatThingsFollowPl = True
- msg("FloatThings will follow player...", 3000)
- Settings.SetValue("FloatThings_follow_player", "General", 1)
- End If
- Settings.Save()
- End If
- If e.Key = hkWarpAnywhere And Game.isKeyPressed(keyAim) Then bPreviewWarpPos = True
- 'car jump
- If e.Key = keyHidraulics Then
- If Exists(Player.Character.CurrentVehicle) andalso not Player.Character.CurrentVehicle.model.isboat AndAlso _
- Player.Character.CurrentVehicle.isOnAllWheels Then
- msg("Hidraulics? Yeah", 3000)
- Native.Function.Call("Apply_Force_To_Car", Player.Character.CurrentVehicle, True, 0, 0, HidraulicsForce, 0, 0, 0, False, False, False, True)
- End If
- End If
- If e.Key = hkThrowAuto And Game.isKeyPressed(keyAim) Then
- If Not ThrowAutoPed() Then
- If Not ThrowAutoVeh() Then ThrowAutoHeli()
- End If
- End If
- If e.Key = hkFloatThings And Game.isKeyPressed(keyAim) Then FloatThings()
- If e.Key = hkThrowFloatThings And Game.isKeyPressed(keyAim) Then 'set targets to Float
- vehAlvoThrow = targetedVehicle(2.0F, 200.0F, DistTargetVehicle)
- If Exists(vehAlvoThrow) AndAlso (Not vehAlvoThrow.isOnScreen Or vehAlvoThrow.Metadata.float) Then vehAlvoThrow = Nothing
- pedAlvoThrow = targetedPed(2.0F, 100.0F, DistTargetPed, False, 0)
- If Exists(pedAlvoThrow) AndAlso (Not pedAlvoThrow.isOnScreen Or pedAlvoThrow.Metadata.float) Then pedAlvoThrow = Nothing
- End If
- If e.Key = hkWarpVehicle And Game.isKeyPressed(keyAim) Then myWarpToVehicle()
- If e.Key = keyHelp Then bShowHelp = Not bShowHelp
- 'show key codes
- If showKeyCode Then msg("key: " & Convert.ToInt32(e.KeyWithModifiers), 1000)
- End Sub
- Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
- If Not SOn Then Exit Sub
- If (e.Key = hkWarpAnywhere) And Game.isKeyPressed(keyAim) Then
- bPreviewWarpPos = False
- WarpToGround(1.0F, 1000.0F, 1.0F)
- End If
- If (e.Key = hkWarpWaypoint) And Not Game.isKeyPressed(keyAim) Then telToWayPoint()
- If Not Game.isKeyPressed(hkWarpAnywhere) Or Not (e.Key = keyAim) Then
- bPreviewWarpPos = False
- chkWarp.Visible = False
- End If
- If e.Key = hkThrowFloatThings Then
- If bClearArray Then
- bClearArray = False
- Try
- If Exists(vehAlvoThrow) Then
- vehAlvoThrow.NoLongerNeeded()
- vehAlvoThrow.Metadata.float = False
- vehAlvoThrow.Metadata.launched = False
- End If
- If Exists(pedAlvoThrow) Then
- pedAlvoThrow.NoLongerNeeded()
- pedAlvoThrow.Metadata.float = False
- pedAlvoThrow.Metadata.launched = False
- End If
- vehAlvoThrow = Nothing
- pedAlvoThrow = Nothing
- For i = 0 To maxFloatVehicle
- If Exists(vehFloatArray(i)) Then
- vehFloatArray(i).NoLongerNeeded()
- vehFloatArray(i).Metadata.float = False
- vehFloatArray(i).Metadata.launched = False
- vehFloatArray(i).FreezePosition = False
- vehFloatArray(i).ApplyForce(vehFloatArray(i).Position.RelativeTop)
- End If
- vehFloatArray(i) = Nothing
- Next i
- For i = 0 To maxFloatPed
- If Exists(pedFloatArray(i)) Then
- pedFloatArray(i).NoLongerNeeded()
- pedFloatArray(i).Metadata.float = False
- pedFloatArray(i).Metadata.launched = False
- pedFloatArray(i).FreezePosition = False
- pedFloatArray(i).ApplyForce(pedFloatArray(i).Position.RelativeTop)
- End If
- pedFloatArray(i) = Nothing
- Next i
- Catch
- End Try
- End If
- End If
- End Sub
- Private Sub telToWayPoint()
- If Not bTelToWaypoint Then
- bTelToWaypoint = True
- Exit Sub
- End If
- If bTelToWaypointInProgress Then
- bTelToWaypointInProgress = False
- Exit Sub
- End If
- Dim vec, vecTmp, vecDest As Vector3
- Dim ultValor
- Dim zMulti = 1
- If Exists(Game.GetWaypoint) Then
- vecDest = Game.GetWaypoint.Position
- vecDest.z += 2
- Player.Character.Invincible = True
- If Exists(Player.Character.CurrentVehicle) Then
- Player.Character.CurrentVehicle.CanBeDamaged = False
- Player.Character.WillFlyThroughWindscreen = False
- End If
- vecTmp = Player.Character.Position + ((vecDest - Player.Character.Position) / 2)
- vecTmp.Z = Player.Character.Position.Z + vecDest.DistanceTo(Player.Character.Position) / 5
- vec = Player.Character.Position
- vec.Z += 5
- If Not Exists(Player.Character.CurrentVehicle) Then
- ultValor = 100000
- Player.Character.forceragdoll(2000, true)
- While True
- Wait(20)
- If (zMulti = 1) And (Player.Character.Position.DistanceTo(vecTmp) > ultValor) Then Exit While
- If Game.isKeyPressed(hkWarpWaypoint) Then
- bTelToWaypointInProgress = True
- zMulti = 20
- Else
- zMulti = 1
- End If
- vec = (vecTmp - Player.Character.Position) / 2
- vec.Z *= zMulti
- If Exists(Player.Character.CurrentVehicle) Then
- Native.Function.Call("Apply_Force_To_Car", Player.Character.CurrentVehicle, True, vec.X, vec.Y, vec.Z, 0, 0, 0, False, False, False, True)
- Else
- While vec.DistanceTo(vec.Zero) > 450
- vec /= 1.2
- End While
- While vec.DistanceTo(vec.Zero) < 400
- vec *= 1.2
- End While
- Player.Character.Velocity = vec
- Native.Function.Call("Apply_Force_To_Ped", Player.Character, True, 0, 0, 1f, 0, 0, 1f, False, False, False, True)
- End If
- ultValor = Player.Character.Position.DistanceTo(vecTmp)
- msg("Hold tight... you will fly", 3000)
- End While
- End If
- ultValor = 100000
- Player.Character.forceragdoll(2000, true)
- While True
- Wait(20)
- If (zMulti = 1) And (Player.Character.Position.DistanceTo(vecDest) > ultValor) Then Exit While
- If Game.isKeyPressed(hkWarpWaypoint) Then
- bTelToWaypointInProgress = True
- zMulti = -20
- Else
- zMulti = 1
- End If
- vec = (vecDest - Player.Character.Position) / 2
- vec.Z *= zMulti
- If Exists(Player.Character.CurrentVehicle) Then
- Native.Function.Call("Apply_Force_To_Car", Player.Character.CurrentVehicle, True, vec.X, vec.Y, vec.Z, 0.0F, 0.0F, 5.0F, False, False, False, True)
- Else
- While vec.DistanceTo(vec.Zero) > 350
- vec /= 1.2
- End While
- While vec.DistanceTo(vec.Zero) < 200
- vec *= 1.2
- End While
- Player.Character.Velocity = vec
- End If
- If Exists(Player.Character.CurrentVehicle) AndAlso (Player.Character.Position.DistanceTo(World.GetGroundPosition(Player.Character.Position)) < 5) Then
- For Each vAux As Vehicle In World.GetVehicles(Player.Character.Position, 10.0F)
- If Exists(vAux) AndAlso (Not vAux.Metadata.flying) AndAlso (vAux <> Player.Character.CurrentVehicle) Then
- vAux.Metadata.flying = True
- vec = (vAux.Position - (Player.Character.CurrentVehicle.Position + Game.CurrentCamera.Direction)) * 3
- vAux.PetrolTankHealth = -1
- Native.Function.Call("Apply_Force_To_Car", vAux, True, vec.X, vec.Y, 5.0F, 5.0F, 5.0F, 0, False, False, False, True)
- End If
- Next
- msg("Hold tight...", 3000)
- else
- msg("Hold more tight... you will fall", 3000)
- End If
- ultValor = Player.Character.Position.DistanceTo(vecDest)
- End While
- If Exists(Player.Character.CurrentVehicle) Then
- Player.Character.CurrentVehicle.FreezePosition = True
- Player.Character.CurrentVehicle.FreezePosition = False
- Native.Function.Call("Apply_Force_To_Car", Player.Character.CurrentVehicle, True, 2.0F, 2.0F, 3.0F, 0, 0, 0, False, False, False, True)
- Player.Character.CurrentVehicle.CanBeDamaged = False
- Else
- Player.Character.WillFlyThroughWindscreen = True
- Player.Character.FreezePosition = True
- Player.Character.FreezePosition = False
- Native.Function.Call("Apply_Force_To_Ped", Player.Character, True, 2.0F, 2.0F, 3.0F, 0, 0, 0, False, False, False, True)
- Player.Character.isRagdoll = False
- End If
- Player.Character.Invincible = False
- If Not Exists(Game.GetWaypoint) Then
- msg("Here we are", 3000)
- Else
- msg("D'OH. There is something in the way...", 3000)
- End If
- Else
- msg("Set the waypoint...", 3000)
- End If
- End Sub
- private sub FloatThings
- dim distV As Double = DistTargetVehicle
- dim distP as double = DistTargetPed
- dim vAux as vehicle
- dim pAux as ped
- dim vecAux as vector3
- While Game.isKeyPressed(hkFloatThings) Andalso Game.isKeyPressed(keyAim)
- pAux = targetedPed(1F, 100.0F, distP, False, 0)
- If Exists(pAux) AndAlso (Not pAux.Metadata.float) Then
- If pedFloatCont < maxFloatPed Then
- pedFloatCont += 1
- Else
- pedFloatCont = 0
- End If
- vecAux = pAux.Position
- vecAux.z += 7
- pAux.Metadata.pos = vecAux
- pAux.Metadata.float = True
- pAux.DropCurrentWeapon()
- pAux.Weapons.RemoveAll()
- if exists(pedFloatArray(pedFloatCont)) then pedFloatArray(pedFloatCont).metadata.float = false
- pedFloatArray(pedFloatCont) = pAux
- msg("Float my dear", 3000)
- Else
- vAux = targetedVehicle(1F, 200.0F, distV)
- If Exists(vAux) AndAlso (Not vAux.Metadata.float) Then
- If vehFloatCont < maxFloatVehicle Then
- vehFloatCont += 1
- Else
- vehFloatCont = 0
- End If
- vecAux = vAux.Position
- vecAux.z += 15
- vAux.Metadata.pos = vecAux
- vAux.Metadata.float = True
- vAux.canbedamaged = false
- vAux.metadata.FloatzPos = 100
- if exists(vehFloatArray(vehFloatCont)) then vehFloatArray(vehFloatCont).metadata.float = false
- vehFloatArray(vehFloatCont) = vAux
- For Each pAux In World.GetPeds(vAux.Position, 3.0F)
- If pAux <> Player.Character Then pAux.Task.LeaveVehicleImmediately(vAux)
- Next
- msg("Float my dear", 3000)
- End If
- End If
- If Game.isKeyPressed(hkFloatThings) And Game.isKeyPressed(keyAim) Then
- WaitEx(500)
- distV = 3
- distP = 3
- end if
- End While
- End sub
- private sub ThrowThings
- dim vecAux as vector3
- for each vehAux as vehicle in vehFloatArray
- if exists(vehAux) andalso not vehAux.metadata.launched then
- if exists(vehAlvoThrow) then
- vecAux = (vehAlvoThrow.position - vehAux.position) * 15
- vehAux.PetrolTankHealth = -1
- vehAux.canbedamaged = true
- if vehAux.position.distanceto(vehAlvoThrow.position) < 10 then
- vehAux.metadata.launched = true
- end if
- msg("Throwing to targeted vehicle", 3000)
- elseif exists(pedAlvoThrow) then
- vecAux = (pedAlvoThrow.position - vehAux.position) * 15
- vehAux.PetrolTankHealth = -1
- vehAux.canbedamaged = true
- if vehAux.position.distanceto(pedAlvoThrow.position) < 10 then
- pedAlvoThrow.freezeposition = true
- pedAlvoThrow.FreezePosition = False
- pedAlvoThrow.ApplyForce(pedAlvoThrow.Position.RelativeTop)
- pedAlvoThrow.isragdoll = true
- vehAux.metadata.launched = true
- end if
- msg("Throwing to targeted ped", 3000)
- else
- msg("Set the target...", 3000)
- exit sub
- end if
- bClearArray = true
- if not vehAux.metadata.prelaunched then
- vehAux.metadata.prelaunched = true
- vehAux.freezeposition = true
- vehAux.freezeposition = false
- end if
- vehAux.metadata.float = false
- vehAux.freezeposition = false
- Native.Function.Call("Apply_Force_To_Car", vehAux, True, vecAux.x, vecAux.y, vecAux.z - 3, 0, 5f, 0, False, False, False, True)
- end if
- next
- for each pedAux as ped in pedFloatArray
- if exists(pedAux) andalso not pedAux.metadata.launched then
- if exists(vehAlvoThrow) then
- vecAux = (vehAlvoThrow.position - pedAux.position) * 15
- if pedAux.position.distanceto(vehAlvoThrow.position) < 3 then pedAux.metadata.launched = true
- msg("Throwing to targeted vehicle", 3000)
- elseif exists(pedAlvoThrow) then
- vecAux = (pedAlvoThrow.position - pedAux.position) * 15
- if pedAux.position.distanceto(pedAlvoThrow.position) < 2 then
- pedAlvoThrow.freezeposition = true
- pedAlvoThrow.FreezePosition = False
- pedAlvoThrow.ApplyForce(pedAlvoThrow.Position.RelativeBottom)
- pedAlvoThrow.isragdoll = true
- pedAux.metadata.launched = true
- end if
- msg("Throwing to targeted ped", 3000)
- else
- msg("Set the target...", 3000)
- exit sub
- end if
- bClearArray = true
- if not pedAux.metadata.prelaunched then
- pedAux.metadata.prelaunched = true
- pedAux.freezeposition = true
- pedAux.FreezePosition = False
- pedAux.ApplyForce(pedAux.Position.RelativeTop)
- end if
- pedAux.metadata.float = false
- pedAux.forceragdoll(1000, true)
- pedAux.freezeposition = false
- Native.Function.Call("Apply_Force_To_Ped", pedAux, True, vecAux.x, vecAux.y, vecAux.z - 2, 0, 0, 0, False, False, False, True)
- end if
- next
- end sub
- private sub myWarpToVehicle
- dim vAux as vehicle
- dim pAux, pAux2 as ped
- dim vecAux as vector3
- try
- vAux = targetedVehicle(1.0, 200.0F, DistTargetVehicle)
- if exists(vAux) then
- player.character.invincible = true
- vAux.PassengersLeaveVehicle(true)
- msg("''myWarp'' to vehicle", 3000)
- dim timeOut = 0
- if exists(player.character.currentvehicle) then
- native.function.call("SET_PED_FORCE_FLY_THROUGH_WINDSCREEN", player.character)
- while exists(player.character.currentvehicle) andalso (timeOut < 5000)
- timeOut += 300
- waitEx(100)
- end while
- Native.Function.Call("Apply_Force_To_Ped", player.character, True, 0, 0, 7f, 0, 0f, 0, False, False, False, True)
- wait(500)
- player.character.freezeposition = true
- player.character.freezeposition = false
- else
- player.character.animation.play(animSetJump_Std, "jump_on_spot", 10.0, AnimationFlags.Unknown01)
- if GTAIVVersion then
- waitEx(800)
- else
- waitEx(200)
- Native.Function.Call("Apply_Force_To_Ped", player.character, True, 0, 0, 7f, 0, 0, 0, False, False, False, True)
- waitEx(200)
- end if
- end if
- timeOut = 0
- while exists(vAux) andalso ((player.character.position.distanceto(vAux.position) > 5) and (timeOut < 10000))
- player.character.isragdoll = true
- if exists(vAux) then
- vecAux = (vAux.position - player.character.position + (vAux.velocity / 2)) * 3
- if vecAux.distanceto(vecAux.zero) < 5 then
- vecAux *= 1.5
- else
- while vecAux.distanceto(vecAux.zero) > 250
- vecAux /= 1.2
- end while
- end if
- player.character.velocity = vecAux
- if vAux.position.distanceto(player.character.position) < 30 then
- pAux = vAux.GetPedOnSeat(VehicleSeat.Driver)
- if exists(pAux) then
- native.function.call("SET_PED_FORCE_FLY_THROUGH_WINDSCREEN", paux)
- waitEx(500)
- if exists(pAux) then pAux.die
- pAux = vAux.GetPedOnSeat(VehicleSeat.Driver)
- if exists(pAux) then
- vecAux = vAux.position
- vecAux.z += 5
- pAux2 = world.createped(pAux.model, vecAux)
- pAUx.delete
- wait(200)
- if exists(pAux2) then
- pAux2.forceragdoll(3000, false)
- pAux2.applyforce(pAux2.position - vAux.position)
- pAux2.die
- end if
- end if
- end if
- end if
- end if
- wait(50)
- timeOut += 200
- end while
- player.character.isragdoll = false
- player.character.invincible = false
- if exists(vAux) then
- pAux = vAux.GetPedOnSeat(VehicleSeat.Driver)
- if exists(pAux) then pAux.delete
- if bSafeWarpToVehicle then
- player.character.freezeposition = true
- player.character.freezeposition = false
- player.character.isragdoll = false
- wait(50)
- player.character.task.ClearAllImmediately
- wait(50)
- player.character.task.WarpIntoVehicle(vAux, VehicleSeat.Driver)
- else
- player.character.WarpIntoVehicle(vAux, VehicleSeat.Driver)
- end if
- if exists(vAux) then
- for each pAux in world.getpeds(vAux.position, 3f)
- if exists(pAux) andalso (pAux <> player.character) then
- pAux.task.LeaveVehicleImmediately(vAux)
- if pAux.pedtype <> pedtype.cop then pAux.task.fleefromchar(player.character)
- end if
- next
- end if
- if not player.character.isinvehicle and not bSafeWarpToVehicle then
- msg("D'OH!!! Fail", 3000)
- vAux.PassengersLeaveVehicle(true)
- end if
- else
- msg("Too late to warp, it's gone", 3000)
- end if
- end if
- catch exc As Exception
- msg("D'OH, an error occurred...", 3000)
- end try
- end sub
- private function ThrowAutoPed
- dim fx, fy, fz as double
- dim veh as vehicle = nothing
- dim bPedInVeh as boolean = false
- dim a as ped = nothing
- dim vecAux as vector3
- a = targetedPed(1f, 100f, DistTargetPed, false, 0)
- if not exists(a) orelse not a.isalive then return false
- msg("Your ride", 2000)
- For Each veh In World.GetVehicles(a.Position, 20.0)
- If Exists(veh) AndAlso Not veh.Metadata.used AndAlso Not veh.Model.isHelicopter AndAlso _
- (veh <> a.CurrentVehicle) AndAlso veh.isOnScreen Then
- Exit For
- Else
- veh = Nothing
- End If
- Next
- if not exists(veh) then
- For Each veh In World.GetVehicles(a.Position, 50.0)
- If Exists(veh) AndAlso Not veh.Metadata.used AndAlso Not veh.Model.isHelicopter AndAlso _
- (veh <> a.CurrentVehicle) AndAlso veh.isOnScreen Then
- Exit For
- Else
- veh = Nothing
- End If
- Next
- end if
- if not exists(veh) andalso exists(a) then
- dim oAux as gta.object
- vecAux = a.position
- vecAux.z += 30
- oAux = world.createobject(&HFBCD74AB, vecAux)
- wait(200)
- if exists(oAux) andalso exists(a) then
- oAux.applyforce((a.position - oAux.position) + a.velocity)
- while exists(a) andalso exists(oAux)
- if oAux.position.distanceto(oAux.position.toground) <= 2 then
- world.addexplosion(oAux.position)
- a.die
- exit while
- end if
- world.startfire(oAux.position)
- wait(5)
- end while
- world.ExtinguishFire(oAux.position, 100)
- end if
- exit function
- end if
- If Exists(veh) Then
- If veh = Player.Character.CurrentVehicle Then
- veh.CanBeDamaged = False
- Else
- veh.Metadata.used = True
- End If
- If Exists(a) AndAlso a.isInVehicle Then
- bPedInVeh = True
- If random(1, 5) < 3 Then
- a.LeaveVehicle()
- Else
- a.Die()
- End If
- End If
- World.AddExplosion(veh.Position, ExplosionType.Molotov, 0.001, True, False, 0)
- Wait(100)
- If veh <> Player.Character.CurrentVehicle Then veh.PetrolTankHealth = -1
- veh.FreezePosition = False
- Native.Function.Call("Apply_Force_To_Car", veh, True, 0, 0, 10.0F, 0, 0, 0, False, False, False, True)
- waitEx(500)
- If Exists(veh) Then Native.Function.Call("Apply_Force_To_Car", veh, True, 0, 0, 0, 0, 5.0F, 0, False, False, False, True)
- waitEx(500)
- If Exists(veh) Then Native.Function.Call("Apply_Force_To_Car", veh, True, 0, 0, 2.0F, 0, 0, 0, False, False, False, True)
- waitEx(500)
- If Exists(veh) Then
- If bPedInVeh OrElse Not Exists(a) Then
- If Exists(veh) Then
- veh.CanBeDamaged = False
- Native.Function.Call("BREAK_CAR_DOOR", veh, 0, False)
- Native.Function.Call("BREAK_CAR_DOOR", veh, 1, False)
- Native.Function.Call("BREAK_CAR_DOOR", veh, 2, False)
- Native.Function.Call("BREAK_CAR_DOOR", veh, 3, False)
- Native.Function.Call("BREAK_CAR_DOOR", veh, 4, False)
- Native.Function.Call("BREAK_CAR_DOOR", veh, 5, False)
- Dim expAux As Double = veh.Position.DistanceTo(Player.Character.Position)
- expAux = ((100 - ((expAux * 100) / 60)) / 550)
- If Exists(a) Then
- If bPedInVeh Then a.isOnFire = True
- End If
- World.AddExplosion(veh.Position, ExplosionType.Rocket, 1, True, False, expAux)
- Native.Function.Call("Apply_Force_To_Car", veh, True, Convert.ToDouble(random(1, 2)), Convert.ToDouble(random(1, 2)), _
- Convert.ToDouble(random(30, 60)), Convert.ToDouble(random(5, 10)), Convert.ToDouble(random(5, 10)), Convert.ToDouble(random(5, 10)), False, False, False, True)
- Wait(100)
- If veh <> Player.Character.CurrentVehicle Then veh.PetrolTankHealth = -1
- waitEx(400)
- End If
- If Exists(veh) And (veh <> Player.Character.CurrentVehicle) Then veh.CanBeDamaged = True
- Else
- If Exists(a) Then
- fx = (veh.Position.X - a.Position.X) * -15
- fy = (veh.Position.Y - a.Position.Y) * -15
- fz = (veh.Position.Z - a.Position.Z) * -13
- If Exists(veh) Then
- veh.Health = -1
- veh.EngineHealth = -1
- If veh <> Player.Character.CurrentVehicle Then veh.PetrolTankHealth = -1
- Native.Function.Call("Apply_Force_To_Car", veh, True, fx, fy, fz, 0, 0.0F, 0.0F, False, False, False, True)
- Else
- msg("Too far...", 1000)
- End If
- Else
- msg("Too far...", 1000)
- End If
- End If
- End If
- Else
- msg("Too far...", 1000)
- End If
- If Exists(veh) Then
- If veh = Player.Character.CurrentVehicle Then
- veh.EngineHealth = 1000
- veh.PetrolTankHealth = 1000
- End If
- veh.CanBeDamaged = True
- End If
- Return True
- End Function
- private function ThrowAutoVeh
- dim veh as vehicle = nothing
- veh = targetedVehicle(2f, 200f, DistTargetVehicle)
- if exists(veh) andalso ((veh = player.character.currentvehicle) orelse veh.model.ishelicopter) then veh = nothing
- if not exists(veh) then return false
- msg("Rise and burn", 2000)
- world.addexplosion(veh.position, explosiontype.molotov, 0.001, true, false, 0)
- wait(100)
- veh.PetrolTankHealth = -1
- veh.freezeposition = false
- Native.Function.Call("Apply_Force_To_Car", veh, True, 0, 0, 10f, 0, 0, 0, False, False, False, True)
- waitEx(500)
- if exists(veh) then Native.Function.Call("Apply_Force_To_Car", veh, True, 0, 0, 0, 0, 5f, 0, False, False, False, True)
- waitEx(500)
- if exists(veh) then Native.Function.Call("Apply_Force_To_Car", veh, True, 0, 0, 2f, 0, 0, 0, False, False, False, True)
- waitEx(500)
- if exists(veh) then
- veh.CanBeDamaged = false
- Native.Function.Call("BREAK_CAR_DOOR", veh, 0, false)
- Native.Function.Call("BREAK_CAR_DOOR", veh, 1, false)
- Native.Function.Call("BREAK_CAR_DOOR", veh, 2, false)
- Native.Function.Call("BREAK_CAR_DOOR", veh, 3, false)
- Native.Function.Call("BREAK_CAR_DOOR", veh, 4, false)
- Native.Function.Call("BREAK_CAR_DOOR", veh, 5, false)
- dim expAux as double = veh.position.distanceto(player.character.position)
- expAux = ((100 -((expAux * 100) / 60)) / 550)
- world.addexplosion(veh.position, explosiontype.rocket, 1, true, false, expAux)
- Native.Function.Call("Apply_Force_To_Car", veh, True, convert.todouble(random(1, 2)), convert.todouble(random(1, 2)), convert.todouble(random(30, 60)), convert.todouble(random(5, 10)), convert.todouble(random(5, 10)), convert.todouble(random(5, 10)), False, False, False, True)
- wait(100)
- veh.PetrolTankHealth = -1
- waitEx(400)
- if exists(veh) then veh.CanBeDamaged = true
- else
- msg("Too far...", 1000)
- end if
- return true
- end function
- private function ThrowAutoHeli
- dim veh as vehicle = nothing
- dim a as ped = nothing
- dim vecAux, force as vector3
- dim vHeli as vehicle = nothing
- dim AtackCont as int32 = 5
- if not exists(vHeli) then vHeli = targetedVehicle(2f, 300f, DistTargetHelicopter)
- if exists(vHeli) andalso ((vHeli = player.character.currentvehicle) orelse not vHeli.model.ishelicopter) then vHeli = nothing
- if not exists(vHeli) then return false
- for each veh in world.getvehicles(player.character.position, 60f)
- if exists(veh) andalso (veh <> vHeli) andalso veh.isalive andalso (veh <> player.character.currentvehicle) andalso not veh.metadata.isHeliKiller then
- exit for
- else
- veh = nothing
- end if
- next
- if not exists(veh) then
- vecAux = player.character.direction
- vecAux.x = vecAux.x * -5 + player.character.position.x
- vecAux.y = vecAux.y * -5 + player.character.position.y
- vecAux.z = vecAux.z + player.character.position.z
- veh = world.createvehicle(vecAux)
- end if
- if exists(veh) then
- veh.metadata.isHeliKiller = true
- msg("Heli down?", 2000)
- veh.health = -1
- veh.enginehealth = -1
- veh.PetrolTankHealth = -1
- a = world.getclosestped(veh.position, 1f)
- if exists(a) then a.die
- veh.freezeposition = false
- Native.Function.Call("Apply_Force_To_Car", veh, True, 0, 0, 20f, 0, 0.0F, 0.0F, False, False, False, True)
- waitEx(1000)
- if exists(veh) then world.addexplosion(veh.position, explosiontype.default, 0.01, true, false, 0)
- if exists(vHeli) then AtackCont = vheli.position.distanceto(player.character.position)
- msg("They have a Helicopter, i have telekinesis", 3000)
- while atackCont > 0
- if exists(vHeli) then
- force = vHeli.position - veh.position
- force.x = force.x * 230
- force.y = force.y * 230
- force.z = force.z * 230
- Native.Function.Call("Apply_Force_To_Car", veh, True, force.x, force.y, force.z, 0, 0.0F, 0.0F, False, False, False, True)
- atackCont -= 10
- wait(50)
- else
- exit while
- end if
- end while
- end if
- return true
- end function
- private function targetedObj(distMin as double, distMax as double, dist as double, optional ignoreTaged as boolean = true)
- dim vecPl, direction as vector3
- dim objAlvo as gta.object = nothing
- dim o as gta.object()
- dim distAux, distDif as double
- o = world.getallobjects
- direction = game.currentcamera.direction / 2
- if exists(player.character.currentvehicle) andalso (player.character.currentvehicle.model.ishelicopter orelse _
- (player.character.currentvehicle.position.distanceto(player.character.currentvehicle.position.toground) > 3)) then
- direction.z += 0.12
- dist += 2
- else
- if exists(player.character.currentvehicle) andalso not player.character.currentvehicle.model.isbike then direction.z += 0.02
- end if
- if exists(player.character.currentvehicle) then
- vecPl = game.currentcamera.position + (direction * 7)
- else
- vecPl = game.currentcamera.position + (direction)
- end if
- distDif = vecpl.distanceto(vecPl + direction)
- distAux = distDif
- while distAux <= distMax
- vecPl += direction
- distAux += distDif
- for each objAlvo in o
- if exists(objAlvo) andalso (objAlvo.position.distanceto(vecPl) <= dist) andalso (objAlvo.position.distanceto(player.character.position) >= distMin) andalso _
- (objAlvo.position.distanceto(player.character.position) <= distMax) andalso (objAlvo.position.distanceto(player.character.position) >= distMin) andalso _
- (not ignoreTaged orelse (ignoreTaged andalso not objAlvo.metadata.ignored))then
- exit while
- else
- objAlvo = nothing
- end if
- next
- objAlvo = nothing
- end while
- return objAlvo
- end function
- private function targetedVehicle(distMin as double, distMax as double, dist as double, optional ignoreTaged as boolean = true)
- dim vecPl, direction as vector3
- dim vehAlvo as vehicle = nothing
- Dim distAux, distDif As Double
- If bAchouVeh Then
- TargetedVehAutoIncDist = distMax
- Else
- If TargetedVehAutoIncDist < 500 Then TargetedVehAutoIncDist += 50
- distMax = TargetedVehAutoIncDist
- End If
- direction = game.currentcamera.direction / 2
- if exists(player.character.currentvehicle) andalso (player.character.currentvehicle.model.ishelicopter orelse _
- (player.character.currentvehicle.position.distanceto(player.character.currentvehicle.position.toground) > 3)) then
- direction.z += 0.12
- dist += 2
- else
- if exists(player.character.currentvehicle) andalso not player.character.currentvehicle.model.isbike then direction.z += 0.02
- end if
- if exists(player.character.currentvehicle) then
- vecPl = game.currentcamera.position + (direction * 7)
- else
- vecPl = game.currentcamera.position + (direction)
- end if
- distDif = vecpl.distanceto(vecPl + direction)
- distAux = distDif
- while distAux <= distMax
- vecPl += direction
- distAux += distDif
- for each vehAlvo in world.getvehicles(vecPl, dist)
- If Exists(vehAlvo) AndAlso (vehAlvo <> Player.Character.CurrentVehicle) AndAlso _
- ((Not ignoreTaged) OrElse (ignoreTaged AndAlso Not vehAlvo.Metadata.ignore)) AndAlso _
- (vehAlvo.Position.DistanceTo(Player.Character.Position) >= distMin) Then
- Exit While
- Else
- vehAlvo = Nothing
- End If
- next
- end while
- bAchouVeh = Exists(vehAlvo)
- return vehAlvo
- end function
- private function targetedPed(distMin as double, distMax as double, dist as double, inCarToo as boolean, mode as int32, _
- optional aliveOnly as boolean = true, optional ignoreTaged as boolean = true)
- dim pedAlvo as ped = nothing
- dim vecPl, direction as vector3
- dim distAux, distDif as double
- direction = game.currentcamera.direction / 2
- if exists(player.character.currentvehicle) andalso (player.character.currentvehicle.model.ishelicopter orelse _
- (player.character.currentvehicle.position.distanceto(player.character.currentvehicle.position.toground) > 3)) then
- direction.z += 0.12
- dist += 2
- else
- if exists(player.character.currentvehicle) andalso not player.character.currentvehicle.model.isbike then direction.z += 0.02
- end if
- if exists(player.character.currentvehicle) then
- vecPl = game.currentcamera.position + (direction * 7)
- else
- vecPl = game.currentcamera.position + (direction)
- end if
- distDif = vecpl.distanceto(vecPl + direction)
- distAux = distDif
- while distAux <= distMax
- vecPl += direction
- distAux += distDif
- for each pedAlvo in world.getpeds(vecPl, dist)
- if exists(pedAlvo) andalso (pedAlvo <> player.character) andalso (inCarToo orelse not pedAlvo.isinvehicle) andalso _
- (pedAlvo.position.distanceto(player.character.position) >= distMin) andalso _
- ((mode = 0) orelse (player.istargetting(pedAlvo))) andalso (not aliveOnly orelse (aliveOnly andalso pedAlvo.isalive)) andalso _
- (not ignoreTaged orelse (ignoreTaged andalso not pedAlvo.metadata.ignore)) then
- exit while
- else
- pedAlvo = nothing
- end if
- next
- end while
- return pedAlvo
- end function
- private function WarpToGround(distMin as double, distMax as double, dist as double)
- dim vecPl, vecAux, direction, vecThrowVeh as vector3
- dim timeOut, ultDist as int32
- bTelToWaypoint = false
- direction = game.currentcamera.direction / 2
- if exists(player.character.currentvehicle) andalso (player.character.currentvehicle.model.ishelicopter orelse _
- (player.character.currentvehicle.position.distanceto(player.character.currentvehicle.position.toground) > 3)) then
- direction.z += 0.12
- dist += 2
- else
- if exists(player.character.currentvehicle) andalso not player.character.currentvehicle.model.isbike then direction.z += 0.02
- end if
- if exists(player.character.currentvehicle) then
- vecPl = game.currentcamera.position + (direction * 7)
- else
- vecPl = game.currentcamera.position + (direction)
- end if
- vecPl = game.currentcamera.position + direction
- while vecPl.distanceto(player.character.position) < distMax
- vecPl += direction
- if (vecPl.distanceto(world.getgroundposition(vecPl, GroundType.highest)) < 1) andalso (vecPl.distanceto(player.character.position) > 10) andalso (world.getgroundz(vecPl) > 1) then
- if bPreviewWarpPos then
- chkWarp.position = vecPl
- chkWarp.visible = true
- if vecPl.distanceto(player.character.position) > 200 then
- chkWarp.diameter = 4
- else
- chkWarp.diameter = 2
- end if
- else
- if not exists(player.character.currentvehicle) then
- direction *= 2
- else
- direction *= 4
- end if
- vecPl.x += direction.x
- vecPl.y += direction.y
- vecPl.z += 2
- timeOut = 0
- player.character.invincible = true
- player.character.freezeposition = false
- if exists(player.character.currentvehicle) then player.character.currentvehicle.freezeposition = false
- if exists(player.character.currentvehicle) then player.character.currentvehicle.canBeDamaged = false
- msg("''myWarp'' to anywhere", 5000)
- vecAux.x = 0
- vecAux.y = 0
- vecAux.z = 10
- if player.character.isinvehicle then
- player.character.currentvehicle.velocity = vecAux
- waitEx(1000)
- else
- if not player.character.isragdoll then
- player.character.animation.play(animSetJump_Std, "jump_on_spot", 10.0, AnimationFlags.Unknown01)
- if GTAIVVersion then
- waitEx(800)
- else
- waitEx(200)
- Native.Function.Call("Apply_Force_To_Ped", player.character, True, 0, 0, 7f, 0, 0, 0, False, False, False, True)
- waitEx(200)
- end if
- end if
- player.character.velocity = vecAux
- end if
- player.character.forceragdoll(10000, true)
- ultDist = 10000
- while (player.character.position.distanceto(vecPl) >= 1) andalso (timeOut < 10000)
- if ultDist < player.character.position.distanceto(vecPl) then
- exit while
- else
- ultDist = player.character.position.distanceto(vecPl)
- end if
- if player.character.isinvehicle then
- player.character.currentvehicle.applyforce(vecPl - player.character.position)
- else
- vecAux = (vecPl - player.character.position) * 5
- if vecAux.distanceto(vecAux.zero) < 5 then
- vecAux *= 1.5
- else
- while vecAux.distanceto(vecAux.zero) > 250
- vecAux /= 1.2
- end while
- end if
- player.character.velocity = vecAux
- end if
- timeOut += 120
- player.character.isragdoll = true
- wait(100)
- end while
- if exists(player.character.currentvehicle) then
- if player.character.currentvehicle.position.distanceto2d(vecPl + direction) >= 5 then
- player.character.currentvehicle.position = vecpl
- else
- player.character.currentvehicle.freezeposition = true
- player.character.currentvehicle.freezeposition = false
- player.character.currentvehicle.applyforce(player.character.currentvehicle.position.RelativeBottom)
- end if
- else
- if player.character.position.distanceto(vecPl) >= 2 then
- player.character.position = vecpl
- else
- player.character.velocity = player.character.velocity.zero
- end if
- end if
- chkWarp.visible = false
- player.character.isragdoll = false
- player.character.invincible = false
- if exists(player.character.currentvehicle) then player.character.currentvehicle.canBeDamaged = true
- end if
- return true
- else
- chkWarp.visible = false
- end if
- end while
- return false
- end function
- private sub targetedFloor
- if game.iskeypressed(keyAim) andalso exists(player.character.currentvehicle) andalso _
- (player.character.currentvehicle.model.ishelicopter orelse _
- player.character.currentvehicle.position.distanceto(player.character.currentvehicle.position.toground) > 3) then
- dim vecPl, direction as vector3
- direction = game.currentcamera.direction / 2
- direction.z += 0.12
- vecPl = game.currentcamera.position + direction
- while vecPl.distanceto(player.character.position) < 250
- vecPl += direction
- if (vecPl.distanceto(world.getgroundposition(vecPl, GroundType.lowest)) < 1) orelse _
- (vecPl.distanceto(world.getgroundposition(vecPl, GroundType.highest)) < 1) then
- vecPl.z -= 1
- chkWarp.position = vecPl
- chkWarp.visible = true
- exit while
- end if
- end while
- end if
- end sub
- Private Sub Geral_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
- If Not SOn Then Exit Sub
- Dim vecAux, vecGround As Vector3
- targetedFloor()
- If Game.isKeyPressed(keySlowMotion) Then
- Game.TimeScale = 0.3
- msg("Hey, slow down...", 500)
- Else
- Game.TimeScale = 1.0
- End If
- 'WarpToGround "tick"
- If bPreviewWarpPos Then WarpToGround(1.0F, 1000.0F, 1.0F)
- 'ThrowThings "tick"
- Try
- If Game.isKeyPressed(hkThrowFloatThings) And Game.isKeyPressed(keyAim) Then ThrowThings()
- Catch
- End Try
- 'float peds
- For Each pAux As Ped In pedFloatArray
- If Exists(pAux) AndAlso pAux.Metadata.float Then
- If bFloatThingsFollowPl Then
- vecAux = ((Player.Character.Position - pAux.Position) / pAux.Position.DistanceTo(Player.Character.Position)) * 1.5
- vecGround = Player.Character.Position.ToGround
- vecGround.X = pAux.Position.ToGround.X
- vecGround.Y = pAux.Position.ToGround.Y
- If (pAux.Position.DistanceTo(vecGround) < 10) Then
- vecAux.Z += 3
- ElseIf (pAux.Position.DistanceTo(vecGround) < 15) Then
- vecAux.Z += 1.2
- Else
- If vecAux.Z < 0 Then
- vecAux.Z = 1.1
- ElseIf pAux.Position.Z < Player.Character.Position.Z Then
- vecAux.Z = 1.2
- End If
- End If
- Else
- vecAux = (pAux.Metadata.pos - pAux.Position) / 2
- End If
- pAux.isRagdoll = True
- If Not pAux.Metadata.ragDoll Then
- pAux.Metadata.ragDoll = True
- Else
- If Not pAux.isRagdoll And pAux.isAlive Then pAux.Die()
- End If
- If bFloatThingsFollowPl Then
- If (pAux.Position.DistanceTo2D(Player.Character.Position) > 30) AndAlso Not pAux.Metadata.freezewhenclose Then pAux.Metadata.freezewhenclose = True
- If pAux.Metadata.freezewhenclose AndAlso (pAux.Position.DistanceTo2D(Player.Character.Position) < 10) Then
- pAux.Metadata.freezewhenclose = False
- pAux.FreezePosition = True
- pAux.FreezePosition = False
- pAux.ApplyForce(pAux.Position.RelativeTop)
- End If
- Native.Function.Call("Apply_Force_To_Ped", pAux, True, vecAux.X / 2, vecAux.Y / 2, vecAux.Z, 0, 0, 0, False, False, False, True)
- If ((pAux.Position.Z - Player.Character.Position.Z) > 3) AndAlso (pAux.Position.DistanceTo(vecGround) > 20) Then
- pAux.ApplyForce((Player.Character.Position - pAux.Position) / 100)
- End If
- Else
- If vecAux.Z < 0 Then
- vecAux.Z = 1
- ElseIf vecAux.Z > 2 Then
- vecAux.Z = 1.5
- End If
- Native.Function.Call("Apply_Force_To_Ped", pAux, True, 0, 0, vecAux.Z, 0, 0, 0, False, False, False, True)
- End If
- End If
- Next
- 'float vehicles
- For Each vAux In vehFloatArray
- If Exists(vAux) AndAlso vAux.Metadata.float Then
- If bFloatThingsFollowPl Then
- vecAux = Player.Character.Position
- vecAux.Z += 5
- vecAux = (vecAux - vAux.Position) / 20
- If Exists(Player.Character.CurrentVehicle) AndAlso Player.Character.CurrentVehicle.Model.isHelicopter Then
- vecGround = Player.Character.Position
- Else
- vecGround = Player.Character.Position.ToGround
- End If
- vecGround.Z += 15
- vecGround.X = vAux.Position.ToGround.X
- vecGround.Y = vAux.Position.ToGround.Y
- If (vAux.Position.Z - Player.Character.Position.Z < 4) AndAlso (vAux.Position.Z - Player.Character.Position.Z > -3) Then
- vAux.FreezePosition = True
- vAux.FreezePosition = False
- vAux.ApplyForce(vAux.Position.RelativeTop)
- vecAux.Z = 5
- ElseIf vAux.Position.Z < vecGround.Z Then
- vecAux.Z = 2
- ElseIf vecAux.Z < 0 Then
- vecAux.Z = 1
- End If
- If (vAux.Position.DistanceTo2D(Player.Character.Position) > 20) AndAlso Not vAux.Metadata.freezewhenclose Then vAux.Metadata.freezewhenclose = True
- If vAux.Metadata.freezewhenclose AndAlso (vAux.Position.DistanceTo2D(Player.Character.Position) < 10) Then
- vAux.Metadata.freezewhenclose = False
- vAux.ApplyForceRelative(vAux.Direction * -15)
- End If
- Native.Function.Call("Apply_Force_To_Car", vAux, True, vecAux.X, vecAux.Y, vecAux.Z, 0.1, 0, 0, False, False, False, True)
- vecAux = Player.Character.Position
- vecAux.Z += 5
- If ((vAux.Position.Z - vecAux.Z) > 3) AndAlso (vAux.Position.DistanceTo(vecGround) > 30) Then
- vAux.ApplyForce((Player.Character.Position - vAux.Position) / 100)
- End If
- Else
- vecAux = (vAux.Metadata.pos - vAux.Position) / 6
- If vecAux.Z < 0 Then vecAux.Z = 0
- Native.Function.Call("Apply_Force_To_Car", vAux, True, 0, 0, vecAux.Z, 0.1, 0, 0, False, False, False, True)
- End If
- If vAux.Metadata.pos.z < 40 Then
- vecAux = vAux.Metadata.pos
- vecAux.Z += 0.1
- vAux.Metadata.pos = vecAux
- End If
- End If
- Next
- 'teleport to waypoint aux, when hold the button
- If Game.isKeyPressed(hkWarpWaypoint) And Exists(Game.GetWaypoint) And Not Game.isKeyPressed(keyAim) Then
- If Exists(Player.Character.CurrentVehicle) Then
- Native.Function.Call("Apply_Force_To_Car", Player.Character.CurrentVehicle, True, 0, 0, 15.0F, 0, 0, 0, False, False, False, True)
- Else
- Player.Character.isRagdoll = True
- Player.Character.Invincible = True
- Player.Character.ApplyForce(Game.CurrentCamera.Direction * 10)
- If Not Player.Character.Metadata.freeze Then Player.Character.Metadata.freeze = True
- End If
- Else
- If Player.Character.Metadata.freeze Then
- Player.Character.Metadata.freeze = False
- Player.Character.FreezePosition = True
- Player.Character.FreezePosition = False
- End If
- End If
- HealthAndArmorRegeneration()
- Nitro()
- End Sub
- Private Sub HealthAndArmorRegeneration()
- If bAutoHeal Then
- If Player.Character.Health < 100 Then Player.Character.Health += 1.0
- If Player.Character.Armor < 100 Then Player.Character.Armor += 1.0
- End If
- End Sub
- Private Sub Nitro()
- Try
- If Player.Character.isInVehicle AndAlso (Game.isKeyPressed(keyNitro) orelse game.iskeypressed(keyNitroBoatBike)) AndAlso Not Game.isKeyPressed(keyAim) AndAlso Player.Character.CurrentVehicle.isOnAllWheels Then
- if (Player.Character.CurrentVehicle.model.isbike orelse Player.Character.CurrentVehicle.model.isboat) then
- if not game.iskeypressed(keyNitroBoatBike) then exit sub
- if not Player.Character.CurrentVehicle.model.isbike then
- Native.Function.Call("Apply_Force_To_car", Player.Character.CurrentVehicle, True, _
- Player.Character.CurrentVehicle.Velocity.X / 6, Player.Character.CurrentVehicle.Velocity.Y / 6, 0, 0, 0, -1.0, False, False, False, True)
- else
- Native.Function.Call("Apply_Force_To_car", Player.Character.CurrentVehicle, True, _
- Player.Character.CurrentVehicle.Velocity.X / 6, Player.Character.CurrentVehicle.Velocity.Y / 6, 0, 0, 0, 0, False, False, False, True)
- end if
- else
- Native.Function.Call("Apply_Force_To_car", Player.Character.CurrentVehicle, True, _
- Player.Character.CurrentVehicle.Velocity.X / 6, Player.Character.CurrentVehicle.Velocity.Y / 6, 0, 0, 0, -0.2, False, False, False, True)
- end if
- msg("Supernatural Nitro? Yeah", 250)
- End If
- Catch
- End Try
- End Sub
- Private Sub Draw(ByVal sender As Object, ByVal g As GTA.GraphicsEventArgs) Handles MyBase.PerFrameDrawing
- If Not SOn Then Exit Sub
- If bShowHelp Then
- g.Graphics.DrawText("Hold Aim key and press the skill key...", 10, 10)
- g.Graphics.DrawText(" Skill Key 1: Throw targeted ped/vehicle automatically", 10, 40)
- g.Graphics.DrawText(" Skill Key 2: Put ped/vehicle to float", 10, 65)
- g.Graphics.DrawText(" Skill Key 3: Throw floating things into a target", 10, 90)
- g.Graphics.DrawText(" Skill Key 4: Warp into targeted vehicle", 10, 115)
- g.Graphics.DrawText(" Skill Key 5: Hold to see the target, release to warp to targeted floor/ceil/whatever", 10, 140)
- g.Graphics.DrawText(" *Skill Key 6: Warp to waypoint, this don't need the Aim key pressed", 10, 165)
- g.Graphics.DrawText("To switch the float mode press Tab", 10, 200)
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement