Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System
- Imports System.Collections.Generic
- Imports System.Drawing
- Imports System.IO
- Imports System.Windows.Forms
- Imports System.Diagnostics
- Imports GTA
- Imports GTA.Math
- Imports GTA.Native
- Imports GTA.UI
- Imports WeaponComponent = GTA.Native.WeaponComponent
- Imports Microsoft.VisualBasic
- '###################################################################################
- '###################################################################################
- '########### ============================================
- '########### Army At SixStars Dispatch Mod - Visual Basic by Nj5050 & JulioNib
- '########### ============================================
- '########### Modify this script at your own risk. Putting in random
- '########### values could make your game do undesirable things. ###########
- '###################################################################################
- '###################################################################################
- Public Class ArmyAtSixDispatch
- Inherits Script
- Public Sub New()
- AddHandler MyBase.KeyDown, AddressOf Me.mainKeyDown
- AddHandler MyBase.Tick, AddressOf Me.mainTick
- Me.myRandomSource = New Random(DateAndTime.Now.Millisecond)
- Me.bSixStars = False
- Me.crimes = 0
- Me.damagedPeds = New List(Of Integer)()
- Me.copsGroup = Nothing
- Me.relationshipGroup = Nothing
- Me.bLoadAnimatedGif = False
- Me.animatedGifFiles_1 = New List(Of String)()
- Me.animatedGifFiles_currentImages = New List(Of String)()
- Me.latestCopCarHeading = 0.0
- Me.latestCopCarSpeed = 0.0
- Me.createdVehicles = New List(Of Integer)()
- Me.createdEntities = New List(Of Entity)()
- MyBase.Interval = 10
- End Sub
- Public Sub MainKeyDown(sender As Object, e As KeyEventArgs)
- If e.KeyCode = Keys.Subtract Then
- ResetScriptState()
- End If
- End Sub
- Public Sub MainTick(sender As Object, e As EventArgs)
- Me.wantedTick()
- End Sub
- Private Sub WantedTick()
- 'for testing, jump into wanted
- 'Me.crimes = 150
- 'Me.bSixStars = True
- Dim flag As Boolean = Game.Player.WantedLevel = 5
- If flag Then
- Dim flag2 As Boolean = Not Me.bSixStars
- If flag2 Then
- Dim isShooting As Boolean = Game.Player.Character.IsShooting
- If isShooting Then
- Dim ptr As Integer = Me.crimes
- Me.crimes = ptr + 1
- End If
- Dim isJacking As Boolean = Game.Player.Character.IsJacking
- If isJacking Then
- Dim ptr As Integer = Me.crimes
- Me.crimes = ptr + 5
- End If
- Dim flag3 As Boolean = DateAndTime.Now.Subtract(Me.timerCheckKilledPeds).TotalMilliseconds > 1000.0
- If flag3 Then
- Me.timerCheckKilledPeds = DateAndTime.Now
- For Each ped As Ped In World.GetNearbyPeds(Game.Player.Character.Position, 100F)
- Try
- Dim flag4 As Boolean = Entity.Exists(ped) AndAlso Not Me.damagedPeds.Contains(ped.Handle) AndAlso ped.HasBeenDamagedBy(Game.Player.Character)
- If flag4 Then
- Me.damagedPeds.Add(ped.Handle)
- Dim ptr As Integer = Me.crimes
- Me.crimes = ptr + 10
- End If
- Catch ex As Exception
- End Try
- Next
- End If
- Dim flag5 As Boolean = Me.crimes > 500
- If flag5 Then
- Me.bSixStars = True
- Me.bShowWNews = True ' Set bShowWNews to True when the player reaches a six-star wanted level
- Me.timerShowWNews = DateAndTime.Now ' Set the timer to Now when the player reaches a six-star wanted level
- ' Display US President UI notification message here
- UI.Notify("~w~This is the US President speaking. There's report of a high-level threat in Los Santos. All available ~g~Local, Federal & Military Agencies, ~w~have been mobilized to respond. Please remain calm and stay indoors until further notice.", false)
- End If
- End If
- Else
- Me.crimes = 0
- Me.bSixStars = False
- End If
- Dim flag6 As Boolean = Me.bSixStars
- If flag6 Then
- If Me.bShowWNews AndAlso (DateTime.Now.Subtract(Me.timerShowWNews).TotalMilliseconds < 13000) Then ' Display the News GIF animation playback image for 13 seconds
- ' Call the method that draws the GIF image
- Me.drawWezelNews()
- Else
- Me.bShowWNews = False ' Reset bShowWNews to False after the News GIF animation playback image has been displayed for 13 seconds
- End If
- ' Draw the star GIF image only when bSixStars is True
- If Me.bSixStars Then
- Dim pos As Point = New Point(1145, 10)
- Dim size As Size = New Size(21, 20)
- UI.DrawTexture(".\scripts\army v2\star.gif", 0, 10, 100, pos, size)
- End If
- If DateAndTime.Now.Subtract(Me.timerShowWNews).TotalMilliseconds >= 13000 Then
- Me.bShowWNews = False ' Reset bShowWNews to False after 13 seconds
- End If
- End If
- Dim flag7 As Boolean = DateAndTime.Now.Subtract(Me.timerDispatch).TotalMilliseconds > 8000.0
- If flag7 AndAlso bSixStars Then 'Adds a second check for bSixStars here
- Me.timerDispatch = DateAndTime.Now
- 'first, let's make all recenlty created entities as no longer needed, so game can delete them
- Dim num As Integer = Me.createdEntities.Count - 1
- For c As Integer = num To 0 Step -1
- Dim flag8 As Boolean = Entity.Exists(Me.createdEntities(c))
- If flag8 Then
- Dim flag9 As Boolean = World.GetDistance(Me.createdEntities(c).Position, Game.Player.Character.Position) > 200F
- If flag9 Then
- Me.createdEntities(c).MarkAsNoLongerNeeded()
- End If
- Else
- Me.createdEntities.RemoveAt(c)
- End If
- Next
- 'only creates if there is less than 50 entities created and existing
- Dim Flag10 As Boolean = Me.createdEntities.Count < 50
- If Flag10 Then
- Dim IsInWater As Boolean = Game.Player.Character.IsInWater
- Dim Flag11 As Boolean = IsInWater
- If Flag11 Then
- Me.Coastguard_heliselect()
- End If
- Dim IsInBoat As Boolean = Game.Player.Character.IsInBoat
- Dim Flag12 As Boolean = IsInBoat
- If Flag12 Then
- Me.Coastguard_heliselect()
- End If
- Dim IsInBoat2 As Boolean = Game.Player.Character.IsInBoat
- Dim Flag13 As Boolean = IsInBoat
- If Flag13 Then
- Me.NavySealselect()
- End If
- Dim IsInWater2 As Boolean = Game.Player.Character.IsInWater
- Dim Flag14 As Boolean = IsInWater
- If Flag14 Then
- Me.NavySealselect()
- End If
- Dim IsSwimming As Boolean = Game.Player.Character.IsSwimming
- Dim Flag15 As Boolean = IsSwimming
- If Flag15 Then
- Me.Coastguard_heliselect()
- End If
- Dim IsInSub As Boolean = Game.Player.Character.IsInSub
- Dim Flag16 As Boolean = IsInSub
- If Flag16 Then
- Me.Coastguard_heliselect()
- End If
- Dim IsSwimmingUnderWater As Boolean = Game.Player.Character.IsSwimmingUnderWater
- Dim Flag17 As Boolean = IsSwimmingUnderWater
- If Flag17 Then
- Me.Coastguard_heliselect()
- End If
- Dim IsInSub3 As Boolean = Game.Player.Character.IsInSub
- Dim Flag18 As Boolean = IsInSub
- If Flag18 Then
- Me.Navy_Subselect()
- UI.Notify("~b~US Navy Sub Units Have Been Dispatched Throughout The Seas Of SA, In Pursuit Of ~r~Wanted Suspect.", False)
- End If
- Dim IsSwimmingUnderWater2 As Boolean = Game.Player.Character.IsSwimmingUnderWater
- Dim Flag19 As Boolean = IsSwimmingUnderWater
- If Flag19 Then
- Me.NavySealselect()
- End If
- Dim IsOnFoot As Boolean = Game.Player.Character.IsOnFoot
- Dim Flag20 As Boolean = IsOnFoot
- If Flag20 Then
- Me.NationalGuard_carselect()
- End If
- Dim IsShooting As Boolean = Game.Player.Character.IsShooting
- Dim Flag21 As Boolean = IsShooting
- If Flag21 Then
- Me.NationalGuard_carselect()
- End If
- Dim IsRunning As Boolean = Game.Player.Character.IsRunning
- Dim Flag22 As Boolean = IsRunning
- If Flag22 Then
- Me.NationalGuard_carselect()
- End If
- Dim IsInCombat As Boolean = Game.Player.Character.IsInCombat
- Dim Flag23 As Boolean = IsInCombat
- If Flag23 Then
- Me.NationalGuard_carselect()
- End If
- Dim IsSprinting As Boolean = Game.Player.Character.IsSprinting
- Dim Flag24 As Boolean = IsSprinting
- If Flag24 Then
- Me.Fib_Tacticalselect()
- End If
- Dim IsInMeleeCombat As Boolean = Game.Player.Character.IsInMeleeCombat
- Dim Flag25 As Boolean = IsInMeleeCombat
- If Flag25 Then
- Me.Fib_Tacticalselect()
- End If
- 'only creates if there is less than 16 entities created and existing
- Dim Flag26 As Boolean = Me.createdEntities.Count < 16
- If Flag26 Then
- Dim IsInAir As Boolean = Game.Player.Character.IsInAir
- Dim Flag27 As Boolean = IsInAir
- If Flag27 Then
- Me.Airforce_heliselect()
- End If
- 'only creates if there is less than 50 entities created and existing
- Dim Flag28 As Boolean = Me.createdEntities.Count < 50
- If Flag28 Then
- Dim Flag29 As Boolean = Game.Player.Character.IsInVehicle()
- If Flag29 Then
- Dim IsHelicopter As Boolean = Game.Player.Character.CurrentVehicle.Model.IsHelicopter OrElse Game.Player.Character.CurrentVehicle.Model.IsPlane OrElse Game.Player.Character.CurrentVehicle.Model.IsTrain OrElse Game.Player.Character.CurrentVehicle.Model.IsCargobob
- If IsHelicopter Then
- Me.Airforce_heliselect()
- End If
- Dim IsBoat As Boolean = Game.Player.Character.CurrentVehicle.Model.IsBoat
- If IsBoat Then
- Me.Coastguard_heliselect()
- End If
- Dim IsBike As Boolean = Game.Player.Character.CurrentVehicle.Model.IsBike OrElse Game.Player.Character.CurrentVehicle.Model.IsCar OrElse Game.Player.Character.CurrentVehicle.Model.IsTrain
- If IsBike Then
- Me.Cia_bikeselect()
- End If
- Dim Istank As Boolean = Game.Player.Character.CurrentVehicle.Model.IsCar
- If Istank Then
- Me.Army_Tankselect()
- End If
- Dim IsCar As Boolean = Game.Player.Character.CurrentVehicle.Model.IsCar OrElse Game.Player.Character.Model.IsQuadbike OrElse Game.Player.Character.CurrentVehicle.Model.IsBike
- If IsCar Then
- Me.NationalGuard_carselect()
- End If
- Dim IsCar2 As Boolean = Game.Player.Character.CurrentVehicle.Model.IsCar OrElse Game.Player.Character.CurrentVehicle.Model.IsBike OrElse Game.Player.Character.CurrentVehicle.Model.IsTrain
- If IsCar2 Then
- Me.Fib_Tacticalselect()
- End If
- Dim IsBoat2 As Boolean = Game.Player.Character.CurrentVehicle.Model.IsBoat
- If IsBoat2 Then
- Me.NavySealselect()
- End If
- Else
- Dim Flag30 As Boolean = Not Game.Player.Character.IsInWater AndAlso Not Game.Player.Character.IsInAir
- Dim Flag31 As Boolean = Flag30
- If Flag31 Then
- Me.NationalGuard_carselect()
- Else
- Me.Airforce_heliselect()
- End If
- End If
- End If
- End If
- End If
- End If
- End Sub
- Private Sub DrawWezelNews()
- Dim flag As Boolean = Me.bLoadAnimatedGif
- If flag Then
- Me.bLoadAnimatedGif = False
- Me.animatedGifFiles_1.Clear()
- For Each item As String In Directory.GetFiles(".\scripts\army v2\gif\anim1")
- Me.animatedGifFiles_1.Add(item)
- Next
- End If
- Dim flag2 As Boolean = Me.animatedGifFiles_1.Count > 0
- If flag2 Then
- Dim flag3 As Boolean = DateAndTime.Now.Subtract(Me.animatedGig_timerNextImage).TotalMilliseconds > 20.0
- If flag3 Then
- Me.animatedGig_timerNextImage = DateAndTime.Now
- Dim flag4 As Boolean = Me.animatedGifFiles_currentImages.Count = 0
- If flag4 Then
- Me.animatedGifFiles_currentImages.AddRange(Me.animatedGifFiles_1)
- End If
- UI.DrawTexture(Me.animatedGifFiles_currentImages(0), 0, 0, 100, New Point(0, 0), New Size(249, 139))
- Me.animatedGifFiles_currentImages.RemoveAt(0)
- End If
- End If
- End Sub
- Private Sub AddVehModelToList(ByRef pList As List(Of String), pModel As String)
- Dim flag As Boolean = [Function].[Call](Of Boolean)(Hash._0x35B9E0803292B641, New InputArgument() { New Model(pModel).Hash })
- If flag Then
- pList.Add(pModel)
- End If
- End Sub
- Private Sub NationalGuard_carselect()
- Dim list As List(Of String) = New List(Of String)()
- Me.addVehModelToList(list, "crusader") '1
- Me.addVehModelToList(list, "technical3") '2
- Me.addVehModelToList(list, "halftrack") '3
- Me.addVehModelToList(list, "barrage") '4
- Me.addVehModelToList(list, "barracks") '5
- Me.addVehModelToList(list, "minitank") '6
- Me.addVehModelToList(list, "barracks3") '7
- Me.addVehModelToList(list, "insurgent") '8
- Me.addVehModelToList(list, "scarab2") '9
- Me.addVehModelToList(list, "insurgent3") '10
- Dim flag As Boolean = list.Count = 0
- If Not flag Then
- Dim source As String = list(Me.myRandomSource.[Next](0, list.Count))
- Dim vehicle As Vehicle = World.CreateVehicle(source, Me.getSpawnPos(90.0F) + Vector3.WorldUp * 2F)
- Script.Wait(5)
- Dim flag2 As Boolean = Entity.Exists(vehicle)
- If flag2 Then
- Me.createdVehicles.Add(vehicle.Handle)
- Me.createdEntities.Add(vehicle)
- Dim flag3 As Boolean = Not Me.checkDist(vehicle)
- If flag3 Then
- vehicle.PlaceOnGround()
- Dim list2 As List(Of VehicleSeat) = New List(Of VehicleSeat)()
- list2.Add(VehicleSeat.Driver) '1
- list2.Add(VehicleSeat.Passenger) '2
- list2.Add(VehicleSeat.RightRear) '3
- list2.Add(VehicleSeat.LeftRear) '4
- list2.Add(VehicleSeat.ExtraSeat5) '5
- list2.Add(VehicleSeat.ExtraSeat6) '6
- list2.Add(VehicleSeat.ExtraSeat7) '7
- list2.Add(VehicleSeat.ExtraSeat7) '8
- Dim list3 As List(Of WeaponHash) = New List(Of WeaponHash)()
- list3.Add(Me.weapselect()) '1
- list3.Add(Me.weapselect()) '2
- list3.Add(Me.weapselect()) '3
- list3.Add(Me.weapselect()) '4
- list3.Add(Me.weapselect()) '5
- list3.Add(Me.weapselect()) '6
- list3.Add(Me.weapselect()) '7
- list3.Add(Me.weapselect()) '8
- Dim list4 As List(Of WeaponComponent) = New List(Of WeaponComponent)()
- list4.Add(Me.weapcomponselect()) '1
- list4.Add(Me.weapcomponselect()) '2
- list4.Add(Me.weapcomponselect()) '3
- list4.Add(Me.weapcomponselect()) '4
- list4.Add(Me.weapcomponselect()) '5
- list4.Add(Me.weapcomponselect()) '6
- list4.Add(Me.weapcomponselect()) '7
- list4.Add(Me.weapcomponselect()) '8
- Try
- For Each vehicleSeat As VehicleSeat In list2
- Dim ped As Ped = vehicle.CreatePedOnSeat(vehicleSeat, Me.pedselect())
- Script.Wait(5)
- Dim flag4 As Boolean = Entity.Exists(ped)
- If flag4 Then
- Me.createdEntities.Add(ped)
- Me.setAsCop(ped)
- Dim flag5 As Boolean = list3.Count = 0
- If flag5 Then
- list3.Add(Me.weapselect())
- list4.Add(Me.weapcomponselect())
- End If
- 'give actual weapon and then remove it from the weapons list, this way we will equip each soldier with one weapon from the list
- ped.Weapons.Give(list3(0), 999, True, True)
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.AdvancedRifle, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.CarbineRifle, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.BullpupRifle, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.SpecialCarbine, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.SMG, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.AssaultSMG, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.HeavyShotgun, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.AssaultShotgun, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.MarksmanRifle, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.Pistol, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.CombatPistol, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.CombatPDW, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.Pistol50, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.HeavyPistol, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.Revolver, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.GrenadeLauncher, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.PumpShotgun, WeaponComponent.AtArFlsh })
- list3.RemoveAt(0)
- 'set the shooting task for each soldier
- Dim flag6 As Boolean = vehicleSeat = VehicleSeat.Driver
- If flag6 Then
- ped.Task.ShootAt(Game.Player.Character, 99999, CType(3607063905UI, FiringPattern))
- ped.AlwaysKeepTask = True
- ped.DrivingStyle = DrivingStyle.Normal
- Else
- ped.Task.ShootAt(Game.Player.Character, 99999, CType(3607063905UI, FiringPattern))
- End If
- 'set that they may be deleted by the game
- ped.MarkAsNoLongerNeeded()
- End If
- Next
- Finally
- Dim enumerator As List(Of VehicleSeat).Enumerator
- CType(enumerator, IDisposable).Dispose()
- vehicle.MarkAsNoLongerNeeded()
- End Try
- Dim flag7 As Boolean = Entity.Exists(Game.Player.Character.CurrentVehicle)
- If flag7 Then
- vehicle.Heading = CSng(Me.latestCopCarHeading)
- vehicle.Speed = CSng(Me.latestCopCarSpeed)
- End If
- End If
- End If
- End If
- End Sub
- Private Sub Fib_tacticalselect()
- Dim list As List(Of String) = New List(Of String)()
- Me.addVehModelToList(list, "Barracks")
- Dim flag As Boolean = list.Count = 0
- If Not flag Then
- Dim source As String = list(Me.myRandomSource.[Next](0, list.Count))
- Dim vehicle As Vehicle = World.CreateVehicle(source, Me.getSpawnPos(90.0F) + Vector3.WorldUp * 2F)
- Script.Wait(5)
- Dim flag2 As Boolean = Entity.Exists(vehicle)
- If flag2 Then
- Me.createdVehicles.Add(vehicle.Handle)
- Me.createdEntities.Add(vehicle)
- Dim flag3 As Boolean = Not Me.checkDist(vehicle)
- If flag3 Then
- vehicle.PlaceOnGround()
- Dim list2 As List(Of VehicleSeat) = New List(Of VehicleSeat)()
- list2.Add(VehicleSeat.Driver) '1
- list2.Add(VehicleSeat.Passenger) '2
- list2.Add(VehicleSeat.RightRear) '3
- list2.Add(VehicleSeat.LeftRear) '4
- list2.Add(VehicleSeat.ExtraSeat5) '5
- list2.Add(VehicleSeat.ExtraSeat6) '6
- Dim list3 As List(Of WeaponHash) = New List(Of WeaponHash)()
- list3.Add(Me.weapselect()) '1
- list3.Add(Me.weapselect()) '2
- list3.Add(Me.weapselect()) '3
- list3.Add(Me.weapselect()) '4
- list3.Add(Me.weapselect()) '5
- list3.Add(Me.weapselect()) '6
- Try
- For Each vehicleSeat As VehicleSeat In list2
- Dim ped As Ped = vehicle.CreatePedOnSeat(vehicleSeat, "u_m_y_juggernaut_01")
- Script.Wait(5)
- Dim flag4 As Boolean = Entity.Exists(ped)
- If flag4 Then
- Me.createdEntities.Add(ped)
- Me.setAsCop(ped)
- Dim flag5 As Boolean = list3.Count = 0
- If flag5 Then
- list3.Add(Me.weapselect())
- End If
- 'give actual weapon and then remove it from the weapons list, this way we will equip each soldier with one weapon from the list
- ped.Weapons.Give(list3(0), 999, True, True)
- list3.RemoveAt(0)
- 'set the shooting task for each soldier
- Dim flag6 As Boolean = vehicleSeat = VehicleSeat.Driver
- If flag6 Then
- ped.Task.ShootAt(Game.Player.Character, 99999, CType(3607063905UI, FiringPattern))
- ped.AlwaysKeepTask = True
- ped.DrivingStyle = DrivingStyle.Normal
- ped.RelationshipGroup = isCop(ped)
- Else
- ped.Task.ShootAt(Game.Player.Character, 99999)
- End If
- 'set that they may be deleted by the game
- ped.MarkAsNoLongerNeeded()
- End If
- Next
- Finally
- Dim enumerator As List(Of VehicleSeat).Enumerator
- CType(enumerator, IDisposable).Dispose()
- vehicle.MarkAsNoLongerNeeded()
- End Try
- Dim flag7 As Boolean = Entity.Exists(Game.Player.Character.CurrentVehicle)
- If flag7 Then
- vehicle.Heading = CSng(Me.latestCopCarHeading)
- vehicle.Speed = CSng(Me.latestCopCarSpeed)
- End If
- End If
- End If
- End If
- End Sub
- Private Sub Army_tankselect()
- Dim list As List(Of String) = New List(Of String)()
- Me.addVehModelToList(list, "khanjali")
- Me.addVehModelToList(list, "APC")
- Me.addVehModelToList(list, "rhino")
- Dim flag As Boolean = list.Count = 0
- If Not flag Then
- Dim source As String = list(Me.myRandomSource.[Next](0, list.Count))
- Dim vehicle As Vehicle = World.CreateVehicle(source, Me.getSpawnPos(180.0F) + Vector3.WorldUp * 2F)
- Script.Wait(5)
- Dim flag2 As Boolean = Entity.Exists(vehicle)
- If flag2 Then
- Me.createdVehicles.Add(vehicle.Handle)
- Me.createdEntities.Add(vehicle)
- Dim flag3 As Boolean = Not Me.checkDist(vehicle)
- If flag3 Then
- Dim list2 As List(Of VehicleSeat) = New List(Of VehicleSeat)()
- list2.Add(VehicleSeat.Driver)
- list2.Add(VehicleSeat.Passenger)
- Dim list3 As List(Of WeaponHash) = New List(Of WeaponHash)()
- list3.Add(Me.weapselect())
- list3.Add(Me.weapselect())
- Try
- For Each vehicleSeat As VehicleSeat In list2
- Dim ped As Ped = vehicle.CreatePedOnSeat(vehicleSeat, Me.pedselect())
- Script.Wait(5)
- Dim flag4 As Boolean = Entity.Exists(ped)
- If flag4 Then
- Me.createdEntities.Add(ped)
- Me.setAsCop(ped)
- 'check if there still weapons in the list, use default case its empty
- Dim flag5 As Boolean = list3.Count = 0
- If flag5 Then
- list3.Add(Me.weapselect())
- End If
- 'give actual weapon and then remove it from the weapons list, this way we will equip each soldier with one weapon from the list
- ped.Weapons.Give(list3(0), 999, True, True)
- list3.RemoveAt(0)
- 'set the shooting task for each soldier
- Dim flag6 As Boolean = vehicleSeat = VehicleSeat.Driver
- If flag6 Then
- ped.Task.ShootAt(Game.Player.Character, 99999, CType(3607063905UI, FiringPattern))
- ped.AlwaysKeepTask = True
- ped.DrivingStyle = DrivingStyle.Normal
- Else
- ped.Task.ShootAt(Game.Player.Character, 99999)
- End If
- 'set that they may be deleted by the game
- ped.MarkAsNoLongerNeeded()
- End If
- Next
- Finally
- Dim enumerator As List(Of VehicleSeat).Enumerator
- CType(enumerator, IDisposable).Dispose()
- vehicle.MarkAsNoLongerNeeded()
- End Try
- Dim flag7 As Boolean = Entity.Exists(Game.Player.Character.CurrentVehicle)
- If flag7 Then
- vehicle.Heading = Game.Player.Character.CurrentVehicle.Heading
- vehicle.Speed = Game.Player.Character.CurrentVehicle.Speed
- End If
- End If
- End If
- End If
- End Sub
- Private Sub Cia_bikeselect()
- Dim list As List(Of String) = New List(Of String)()
- Me.addVehModelToList(list, "vader")
- Me.addVehModelToList(list, "hakuchou")
- Dim flag As Boolean = list.Count = 0
- If Not flag Then
- Dim source As String = list(Me.myRandomSource.[Next](0, list.Count))
- Dim vehicle As Vehicle = World.CreateVehicle(source, Me.getSpawnPos(90.0F) + Vector3.WorldUp * 2F)
- Script.Wait(5)
- Dim flag2 As Boolean = Entity.Exists(vehicle)
- If flag2 Then
- Me.createdVehicles.Add(vehicle.Handle)
- Me.createdEntities.Add(vehicle)
- Dim flag3 As Boolean = Not Me.checkDist(vehicle)
- If flag3 Then
- Dim list2 As List(Of VehicleSeat) = New List(Of VehicleSeat)()
- list2.Add(VehicleSeat.Driver)
- Dim list3 As List(Of WeaponHash) = New List(Of WeaponHash)()
- list3.Add(Me.weapselect())
- Dim list4 As List(Of WeaponComponent) = New List(Of WeaponComponent)()
- list4.Add(Me.weapcomponselect()) '1
- Try
- For Each vehicleSeat As VehicleSeat In list2
- Dim ped As Ped = vehicle.CreatePedOnSeat(vehicleSeat, "s_m_m_highsec_01")
- Script.Wait(5)
- Dim flag4 As Boolean = Entity.Exists(ped)
- If flag4 Then
- Me.createdEntities.Add(ped)
- Me.setAsCop(ped)
- Dim flag5 As Boolean = list3.Count = 0
- If flag5 Then
- list3.Add(Me.weapselect())
- list4.Add(Me.weapcomponselect())
- End If
- 'give actual weapon and then remove it from the weapons list, this way we will equip each soldier with one weapon from the list
- ped.Weapons.Give(list3(0), 999, True, True)
- 'peds on bikes needs a pistol to shoot, or sub machine guns
- ped.Weapons.Give(WeaponHash.Pistol, 999, True, True)
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.AdvancedRifle, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.CarbineRifle, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.BullpupRifle, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.SpecialCarbine, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.SMG, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.AssaultSMG, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.HeavyShotgun, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.AssaultShotgun, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.MarksmanRifle, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.Pistol, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.CombatPistol, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.CombatPDW, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.Pistol50, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.HeavyPistol, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.Revolver, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.GrenadeLauncher, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.PumpShotgun, WeaponComponent.AtArFlsh })
- list3.RemoveAt(0)
- 'set the shooting task for each soldier
- Dim flag6 As Boolean = vehicleSeat = VehicleSeat.Driver
- If flag6 Then
- ped.Task.ShootAt(Game.Player.Character, 99999, CType(3607063905UI, FiringPattern))
- ped.AlwaysKeepTask = True
- ped.DrivingStyle = DrivingStyle.Rushed
- ped.RelationshipGroup = isCop(ped)
- Else
- ped.Task.ShootAt(Game.Player.Character, 99999)
- End If
- 'set that they may be deleted by the game
- ped.MarkAsNoLongerNeeded()
- End If
- Next
- Finally
- Dim enumerator As List(Of VehicleSeat).Enumerator
- CType(enumerator, IDisposable).Dispose()
- vehicle.MarkAsNoLongerNeeded()
- End Try
- Dim flag7 As Boolean = Entity.Exists(Game.Player.Character.CurrentVehicle)
- If flag7 Then
- vehicle.Heading = Game.Player.Character.CurrentVehicle.Heading
- vehicle.Speed = Game.Player.Character.CurrentVehicle.Speed
- End If
- End If
- End If
- End If
- End Sub
- Private Sub Navy_Subselect()
- Dim list As List(Of String) = New List(Of String)()
- Me.addVehModelToList(list, "Kosatka")
- Dim flag As Boolean = list.Count = 0
- If Not flag Then
- Dim source As String = list(Me.myRandomSource.[Next](0, list.Count))
- Dim vector As Vector3 = Me.getSpawnPosInWater(300.0F) + Vector3.WorldDown * 10F
- Dim flag2 As Boolean = vector = Nothing
- If Not flag2 Then
- Dim vehicle As Vehicle = World.CreateVehicle(source, vector)
- Script.Wait(5)
- Dim flag3 As Boolean = Entity.Exists(vehicle)
- If flag3 Then
- Me.createdVehicles.Add(vehicle.Handle)
- Me.createdEntities.Add(vehicle)
- Dim flag4 As Boolean = Not Me.checkDist(vehicle)
- If flag4 Then
- Dim list2 As List(Of VehicleSeat) = New List(Of VehicleSeat)()
- list2.Add(VehicleSeat.Driver) '1
- list2.Add(VehicleSeat.Passenger) '2
- list2.Add(VehicleSeat.RightRear) '3
- list2.Add(VehicleSeat.LeftRear) '4
- list2.Add(VehicleSeat.ExtraSeat5) '5
- list2.Add(VehicleSeat.ExtraSeat6) '6
- Dim list3 As List(Of WeaponHash) = New List(Of WeaponHash)()
- list3.Add(Me.weapselect()) '1
- list3.Add(Me.weapselect()) '2
- list3.Add(Me.weapselect()) '3
- list3.Add(Me.weapselect()) '4
- list3.Add(Me.weapselect()) '5
- list3.Add(Me.weapselect()) '6
- Try
- For Each vehicleSeat As VehicleSeat In list2
- Dim ped As Ped = vehicle.CreatePedOnSeat(vehicleSeat, "s_m_m_Marine_01")
- Script.Wait(5)
- Dim flag5 As Boolean = Entity.Exists(ped)
- If flag5 Then
- Me.createdEntities.Add(ped)
- Me.setAsCop(ped)
- Dim flag6 As Boolean = list3.Count = 0
- 'check if there still weapons in the list, use default case its empty
- If flag6 Then
- list3.Add(Me.weapselect())
- End If
- 'give actual weapon and then remove it from the weapons list, this way we will equip each soldier with one weapon from the list
- ped.Weapons.Give(list3(0), 999, True, True)
- list3.RemoveAt(0)
- Dim flag7 As Boolean = vehicleSeat = VehicleSeat.Driver
- If flag7 Then
- 'set the shooting task for each soldier
- ped.Task.ShootAt(Game.Player.Character, 99999, CType(3607063905UI, FiringPattern))
- ped.AlwaysKeepTask = True
- ped.DrivingStyle = DrivingStyle.Rushed
- Else
- ped.Task.ShootAt(Game.Player.Character, 99999, CType(3607063905UI, FiringPattern))
- End If
- 'set that they may be deleted by the game
- ped.MarkAsNoLongerNeeded()
- End If
- Next
- Finally
- Dim enumerator As List(Of VehicleSeat).Enumerator
- CType(enumerator, IDisposable).Dispose()
- vehicle.MarkAsNoLongerNeeded()
- End Try
- Dim flag8 As Boolean = Entity.Exists(Game.Player.Character.CurrentVehicle)
- If flag8 Then
- vehicle.Heading = Game.Player.Character.CurrentVehicle.Heading
- vehicle.Speed = Game.Player.Character.CurrentVehicle.Speed
- End If
- End If
- End If
- End If
- End If
- End Sub
- Private Sub NavySealselect()
- Dim list As List(Of String) = New List(Of String)()
- Me.addVehModelToList(list, "dinghy5")
- Me.addVehModelToList(list, "dinghy2")
- Dim flag As Boolean = list.Count = 0
- If Not flag Then
- Dim source As String = list(Me.myRandomSource.[Next](0, list.Count))
- Dim spawnPosInWater As Vector3 = Me.getSpawnPosInWater(140.0F)
- Dim flag2 As Boolean = spawnPosInWater = Nothing
- If Not flag2 Then
- Dim vehicle As Vehicle = World.CreateVehicle(source, spawnPosInWater)
- Script.Wait(5)
- Dim flag3 As Boolean = Entity.Exists(vehicle)
- If flag3 Then
- Me.createdVehicles.Add(vehicle.Handle)
- Me.createdEntities.Add(vehicle)
- Dim flag4 As Boolean = Not Me.checkDist(vehicle)
- If flag4 Then
- Dim list2 As List(Of VehicleSeat) = New List(Of VehicleSeat)()
- list2.Add(VehicleSeat.Driver) '1
- list2.Add(VehicleSeat.Passenger) '2
- list2.Add(VehicleSeat.RightRear) '3
- list2.Add(VehicleSeat.LeftRear) '4
- list2.Add(VehicleSeat.ExtraSeat1) '5
- Dim list3 As List(Of WeaponHash) = New List(Of WeaponHash)()
- list3.Add(Me.weapselect()) '1
- list3.Add(Me.weapselect()) '2
- list3.Add(Me.weapselect()) '3
- list3.Add(Me.weapselect()) '4
- list3.Add(Me.weapselect()) '5
- Dim list4 As List(Of WeaponComponent) = New List(Of WeaponComponent)()
- list4.Add(Me.weapcomponselect()) '1
- list4.Add(Me.weapcomponselect()) '2
- list4.Add(Me.weapcomponselect()) '3
- list4.Add(Me.weapcomponselect()) '4
- list4.Add(Me.weapcomponselect()) '5
- Try
- For Each vehicleSeat As VehicleSeat In list2
- Dim ped As Ped = vehicle.CreatePedOnSeat(vehicleSeat, Me.pedselect())
- Script.Wait(5)
- Dim flag5 As Boolean = Entity.Exists(ped)
- If flag5 Then
- Me.createdEntities.Add(ped)
- Me.setAsCop(ped)
- 'check if there still weapons in the list, use default case its empty
- Dim flag6 As Boolean = list3.Count = 0
- If flag6 Then
- list3.Add(Me.weapselect())
- list4.Add(Me.weapcomponselect())
- End If
- 'give actual weapon and then remove it from the weapons list, this way we will equip each soldier with one weapon from the list
- ped.Weapons.Give(list3(0), 999, True, True)
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.AdvancedRifle, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.CarbineRifle, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.BullpupRifle, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.SpecialCarbine, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.SMG, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.AssaultSMG, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.HeavyShotgun, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.AssaultShotgun, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.MarksmanRifle, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.Pistol, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.CombatPistol, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.CombatPDW, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.Pistol50, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.HeavyPistol, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.Revolver, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.GrenadeLauncher, WeaponComponent.AtArFlsh })
- [Function].[Call](Hash.GIVE_WEAPON_COMPONENT_TO_PED, New InputArgument() { ped, WeaponHash.PumpShotgun, WeaponComponent.AtArFlsh })
- list3.RemoveAt(0)
- 'set the shooting task for each soldier
- Dim flag7 As Boolean = vehicleSeat = VehicleSeat.Driver
- If flag7 Then
- ped.Task.ShootAt(Game.Player.Character, 99999, CType(3607063905UI, FiringPattern))
- ped.DrivingStyle = DrivingStyle.Rushed
- ped.AlwaysKeepTask = True
- Else
- ped.Task.ShootAt(Game.Player.Character, 99999)
- End If
- 'set that they may be deleted by the game
- ped.MarkAsNoLongerNeeded()
- End If
- Next
- Finally
- Dim enumerator As List(Of VehicleSeat).Enumerator
- CType(enumerator, IDisposable).Dispose()
- vehicle.MarkAsNoLongerNeeded()
- End Try
- Dim flag8 As Boolean = Entity.Exists(Game.Player.Character.CurrentVehicle)
- If flag8 Then
- vehicle.Heading = Game.Player.Character.CurrentVehicle.Heading
- vehicle.Speed = Game.Player.Character.CurrentVehicle.Speed
- End If
- End If
- End If
- End If
- End If
- End Sub
- Private Sub Coastguard_heliselect()
- Dim list As List(Of String) = New List(Of String)()
- Me.addVehModelToList(list, "annihilator2")
- Dim flag As Boolean = list.Count = 0
- If Not flag Then
- Dim source As String = list(Me.myRandomSource.[Next](0, list.Count))
- Dim vehicle As Vehicle = World.CreateVehicle(source, Me.getHeliSpawnPos(180.0F))
- Script.Wait(5)
- Dim flag2 As Boolean = Entity.Exists(vehicle)
- If flag2 Then
- Me.createdVehicles.Add(vehicle.Handle)
- Me.createdEntities.Add(vehicle)
- [Function].[Call](Hash._0xA178472EBB8AE60D, New InputArgument() { vehicle })
- Dim flag3 As Boolean = Not Me.checkDist(vehicle)
- If flag3 Then
- Dim list2 As List(Of VehicleSeat) = New List(Of VehicleSeat)()
- list2.Add(VehicleSeat.Driver) '1
- list2.Add(VehicleSeat.Passenger) '2
- list2.Add(VehicleSeat.RightRear) '3
- list2.Add(VehicleSeat.LeftRear) '4
- list2.Add(VehicleSeat.ExtraSeat1) '5
- list2.Add(VehicleSeat.ExtraSeat2) '6
- Dim list3 As List(Of WeaponHash) = New List(Of WeaponHash)()
- list3.Add(Me.weapselect()) '1
- list3.Add(Me.weapselect()) '2
- list3.Add(Me.weapselect()) '3
- list3.Add(Me.weapselect()) '4
- list3.Add(Me.weapselect()) '5
- list3.Add(Me.weapselect()) '6
- Try
- For Each vehicleSeat As VehicleSeat In list2
- Dim ped As Ped = vehicle.CreatePedOnSeat(vehicleSeat, "s_m_y_uscg_01")
- Script.Wait(5)
- Dim flag4 As Boolean = Entity.Exists(ped)
- If flag4 Then
- Me.createdEntities.Add(ped)
- Me.setAsCop(ped)
- 'check if there still weapons in the list, use default case its empty
- Dim flag5 As Boolean = list3.Count = 0
- If flag5 Then
- list3.Add(Me.weapselect())
- End If
- 'give actual weapon and then remove it from the weapons list, this way we will equip each soldier with one weapon from the list
- ped.Weapons.Give(list3(0), 999, True, True)
- list3.RemoveAt(0)
- 'set the shooting task for each soldier
- Dim flag6 As Boolean = vehicleSeat = VehicleSeat.Driver
- If flag6 Then
- ped.Task.ShootAt(Game.Player.Character, 99999, CType(2437838959UI, FiringPattern))
- ped.DrivingStyle = DrivingStyle.Normal
- ped.AlwaysKeepTask = True
- Else
- ped.Task.ShootAt(Game.Player.Character, 99999)
- End If
- 'set that they may be deleted by the game
- ped.MarkAsNoLongerNeeded()
- End If
- Next
- Finally
- Dim enumerator As List(Of VehicleSeat).Enumerator
- CType(enumerator, IDisposable).Dispose()
- vehicle.MarkAsNoLongerNeeded()
- End Try
- Dim flag7 As Boolean = Entity.Exists(Game.Player.Character.CurrentVehicle)
- If flag7 Then
- vehicle.Heading = Game.Player.Character.CurrentVehicle.Heading
- vehicle.Speed = Game.Player.Character.CurrentVehicle.Speed
- End If
- End If
- End If
- End If
- End Sub
- Private Sub Airforce_heliselect()
- Dim list As List(Of String) = New List(Of String)()
- Me.addVehModelToList(list, "cargobob")
- Me.addVehModelToList(list, "buzzard2")
- Dim flag As Boolean = list.Count = 0
- If Not flag Then
- Dim source As String = list(Me.myRandomSource.[Next](0, list.Count))
- Dim vehicle As Vehicle = World.CreateVehicle(source, Me.getHeliSpawnPos(180.0F))
- Script.Wait(5)
- Dim flag2 As Boolean = Entity.Exists(vehicle)
- If flag2 Then
- Me.createdVehicles.Add(vehicle.Handle)
- Me.createdEntities.Add(vehicle)
- [Function].[Call](Hash._0xA178472EBB8AE60D, New InputArgument() { vehicle })
- Dim flag3 As Boolean = Not Me.checkDist(vehicle)
- If flag3 Then
- Dim list2 As List(Of VehicleSeat) = New List(Of VehicleSeat)()
- list2.Add(VehicleSeat.Driver) '1
- list2.Add(VehicleSeat.Passenger) '2
- list2.Add(VehicleSeat.RightRear) '3
- list2.Add(VehicleSeat.LeftRear) '4
- Dim list3 As List(Of WeaponHash) = New List(Of WeaponHash)()
- list3.Add(CType(2210333304UI, WeaponHash)) '1 CarbineRifle
- list3.Add(CType(2210333304UI, WeaponHash)) '2 CarbineRifle
- list3.Add(CType(2210333304UI, WeaponHash)) '3 CarbineRifle
- list3.Add(WeaponHash.SniperRifle) '4
- Try
- For Each vehicleSeat As VehicleSeat In list2
- Dim ped As Ped = vehicle.CreatePedOnSeat(vehicleSeat, Me.pedselect())
- Script.Wait(5)
- Dim flag4 As Boolean = Entity.Exists(ped)
- If flag4 Then
- Me.createdEntities.Add(ped)
- Me.setAsCop(ped)
- 'check if there still weapons in the list, use default case its empty
- Dim flag5 As Boolean = list3.Count = 0
- If flag5 Then
- list3.Add(CType(2210333304UI, WeaponHash))
- End If
- 'give actual weapon and then remove it from the weapons list, this way we will equip each soldier with one weapon from the list
- ped.Weapons.Give(list3(0), 999, True, True)
- list3.RemoveAt(0)
- 'set the shooting task for each soldier
- Dim flag6 As Boolean = vehicleSeat = VehicleSeat.Driver
- If flag6 Then
- ped.Task.ShootAt(Game.Player.Character, 99999, CType(2437838959UI, FiringPattern))
- ped.DrivingStyle = DrivingStyle.Normal
- ped.AlwaysKeepTask = True
- Else
- ped.Task.ShootAt(Game.Player.Character, 99999)
- End If
- 'set that they may be deleted by the game
- ped.MarkAsNoLongerNeeded()
- vehicle.MarkAsNoLongerNeeded()
- End If
- Next
- Finally
- Dim enumerator As List(Of VehicleSeat).Enumerator
- CType(enumerator, IDisposable).Dispose()
- End Try
- Dim flag7 As Boolean = Entity.Exists(Game.Player.Character.CurrentVehicle)
- If flag7 Then
- vehicle.Heading = Game.Player.Character.CurrentVehicle.Heading
- vehicle.Speed = Game.Player.Character.CurrentVehicle.Speed
- End If
- End If
- End If
- End If
- End Sub
- Private Sub SetAsCop(p As Ped)
- Dim flag As Boolean = Me.copsGroup IsNot Nothing
- If flag Then
- Me.copsGroup.Add(p, False)
- End If
- [Function].[Call](Hash._0xBB03C38DD3FB7FFD, New InputArgument() { p, True })
- End Sub
- Private Function CheckDist(e As Entity) As Boolean
- Dim flag As Boolean = World.GetDistance(Game.Player.Character.Position, e.Position) < 30F
- Dim result As Boolean
- If flag Then
- e.Delete()
- result = True
- Else
- result = False
- End If
- Return result
- End Function
- Private Function Pedselect() As String
- Dim result As String
- Select Case Me.myRandomSource.[Next](6)
- Case 0
- result = "s_m_m_Marine_01"
- Case 1
- result = "s_m_m_Marine_02"
- Case 2
- result = "s_m_y_Marine_01"
- Case 3
- result = "s_m_y_Marine_02"
- Case 4
- result = "s_m_y_Marine_03"
- Case Else
- result = "s_m_y_blackops_01"
- 'Case 6
- ' return "s_m_y_blackops_02"
- 'Case 7
- ' return "s_m_m_Marine_01"
- 'Case 8
- ' return "s_m_y_uscg_01"
- 'Case 9
- ' return "s_m_m_highsec_01"
- 'Case 10
- ' return "u_m_y_juggernaut_01"
- End Select
- Return result
- End Function
- Private Function Weapcomponselect() As WeaponComponent
- Dim num As Integer = Me.myRandomSource.[Next](17)
- Dim flag As Boolean = num >= 0 AndAlso num <= 3
- Dim result As WeaponComponent
- If flag Then
- result = WeaponComponent.AtArFlsh 'Flashlight
- Else
- flag = (num >= 4 AndAlso num <= 10)
- If flag Then
- result = WeaponComponent.AtArFlsh
- Else
- flag = (num >= 11 AndAlso num <= 15)
- If flag Then
- result = WeaponComponent.AtArFlsh
- Else
- flag = (num >= 16 AndAlso num <= 20)
- If flag Then
- result = WeaponComponent.AtArFlsh
- Else
- flag = (num >= 21 AndAlso num <= 23)
- If flag Then
- result = WeaponComponent.AtArFlsh
- Else
- flag = (num >= 24 AndAlso num <= 26)
- If flag Then
- result = WeaponComponent.AtArFlsh
- Else
- flag = (num >= 27 AndAlso num <= 29)
- If flag Then
- result = WeaponComponent.AtArFlsh
- Else
- flag = (num >= 30 AndAlso num <= 32)
- If flag Then
- result = WeaponComponent.AtArFlsh
- Else
- flag = (num >= 41 AndAlso num <= 43)
- If flag Then
- result = WeaponComponent.AtArFlsh
- Else
- flag = (num >= 47 AndAlso num <= 49)
- If flag Then
- result = WeaponComponent.AtPiFlsh
- Else
- flag = (num >= 50 AndAlso num <= 53)
- If flag Then
- result = WeaponComponent.AtPiFlsh
- Else
- flag = (num = 54)
- If flag Then
- result = WeaponComponent.AtArFlsh
- Else
- flag = (num = 55)
- If flag Then
- result = WeaponComponent.AtPiFlsh
- Else
- flag = (num = 56)
- If flag Then
- result = WeaponComponent.AtPiFlsh
- Else
- flag = (num = 57)
- If flag Then
- result = WeaponComponent.AtPiFlsh
- Else
- flag = (num = 58)
- If flag Then
- result = WeaponComponent.AtArFlsh
- Else
- result = WeaponComponent.AtArFlsh
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- Return result
- End Function
- Private Function Weapselect() As WeaponHash
- Dim num As Integer = Me.myRandomSource.[Next](64)
- Dim flag As Boolean = num >= 0 AndAlso num <= 3
- Dim result As WeaponHash
- If flag Then
- result = CType(2937143193UI, WeaponHash) 'Native.WeaponHash.AdvancedRifle
- Else
- flag = (num >= 4 AndAlso num <= 10)
- If flag Then
- result = CType(2210333304UI, WeaponHash) 'Native.WeaponHash.CarbineRifle
- Else
- flag = (num >= 11 AndAlso num <= 15)
- If flag Then
- result = WeaponHash.BullpupRifle
- Else
- flag = (num >= 16 AndAlso num <= 20)
- If flag Then
- result = CType(3231910285UI, WeaponHash) 'Native.WeaponHash.SpecialCarbine
- Else
- flag = (num >= 21 AndAlso num <= 23)
- If flag Then
- result = WeaponHash.SMG
- Else
- flag = (num >= 24 AndAlso num <= 26)
- If flag Then
- result = CType(4024951519UI, WeaponHash) 'Native.WeaponHash.AssaultSMG
- Else
- flag = (num >= 27 AndAlso num <= 29)
- If flag Then
- result = WeaponHash.HeavyShotgun
- Else
- flag = (num >= 30 AndAlso num <= 32)
- If flag Then
- result = CType(3800352039UI, WeaponHash) 'Native.WeaponHash.AssaultShotgun
- Else
- flag = (num >= 33 AndAlso num <= 35)
- If flag Then
- result = WeaponHash.SweeperShotgun
- Else
- flag = (num >= 36 AndAlso num <= 37)
- If flag Then
- result = WeaponHash.CombatMG
- Else
- flag = (num >= 38 AndAlso num <= 39)
- If flag Then
- result = WeaponHash.SniperRifle
- Else
- flag = (num >= 40 AndAlso num <= 42)
- If flag Then
- result = WeaponHash.HeavySniper
- Else
- flag = (num >= 41 AndAlso num <= 43)
- If flag Then
- result = CType(3342088282UI, WeaponHash) 'Native.WeaponHash.MarksmanRifle
- Else
- flag = (num >= 44 AndAlso num <= 46)
- If flag Then
- result = WeaponHash.Minigun
- Else
- flag = (num >= 47 AndAlso num <= 49)
- If flag Then
- result = WeaponHash.Pistol
- Else
- flag = (num >= 50 AndAlso num <= 53)
- If flag Then
- result = WeaponHash.CombatPistol
- Else
- flag = (num = 54)
- If flag Then
- result = WeaponHash.CombatPDW
- Else
- flag = (num = 55)
- If flag Then
- result = CType(2578377531UI, WeaponHash) 'Native.WeaponHash.Pistol50
- Else
- flag = (num = 56)
- If flag Then
- result = CType(3523564046UI, WeaponHash) 'Native.WeaponHash.HeavyPistol
- Else
- flag = (num = 57)
- If flag Then
- result = CType(3249783761UI, WeaponHash) 'Native.WeaponHash.Revolver
- Else
- flag = (num = 58)
- If flag Then
- result = CType(2726580491UI, WeaponHash) 'Native.WeaponHash.GrenadeLauncher
- Else
- flag = (num = 59)
- If flag Then
- result = WeaponHash.HomingLauncher
- Else
- flag = (num = 60)
- If flag Then
- result = WeaponHash.CompactGrenadeLauncher
- Else
- result = WeaponHash.PumpShotgun
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- End If
- Return result
- End Function
- Private Function GetPedType(p As Ped) As ArmyAtSixDispatch.pedType
- Try
- Return CType([Function].[Call](Of Integer)(Hash._0xFF059E1E4C01E63C, New InputArgument() { p }), ArmyAtSixDispatch.pedType)
- Catch ex As Exception
- End Try
- Return CType((-1), ArmyAtSixDispatch.pedType)
- End Function
- Private Function IsCop(p As Entity) As Boolean
- Dim pedType As ArmyAtSixDispatch.pedType = Me.GetPedType(CType(p, Ped))
- Return pedType = ArmyAtSixDispatch.pedType.Cop OrElse pedType = ArmyAtSixDispatch.pedType.Army OrElse pedType = ArmyAtSixDispatch.pedType.SWAT
- End Function
- Private Function GetSpawnPos(Optional pMinRandomDist As Double = 90.0F) As Vector3
- Dim vector As Vector3 = Nothing
- Dim flag As Boolean = Entity.Exists(Game.Player.Character.CurrentVehicle)
- If flag Then
- Me.latestCopCarHeading = CDbl((Game.Player.Character.CurrentVehicle.Heading + 180F))
- Me.latestCopCarSpeed = CDbl(Game.Player.Character.CurrentVehicle.Speed)
- Else
- Me.latestCopCarHeading = CDbl((Game.Player.Character.Heading + 180F))
- Me.latestCopCarSpeed = 5.0
- End If
- For Each ped As Ped In World.GetNearbyPeds(Game.Player.Character.GetOffsetInWorldCoords(Vector3.RelativeFront * 200F), 100F)
- Try
- Dim flag2 As Boolean = Entity.Exists(ped) AndAlso ped.IsAlive AndAlso Me.isCop(ped) AndAlso Entity.Exists(ped.CurrentVehicle) AndAlso Not Me.createdVehicles.Contains(ped.CurrentVehicle.Handle) AndAlso Not ped.CurrentVehicle.Model.IsHelicopter AndAlso Not ped.CurrentVehicle.Model.IsBoat
- If flag2 Then
- vector = ped.CurrentVehicle.Position
- Me.copsGroup = ped.CurrentPedGroup
- Me.latestCopCarHeading = CDbl(ped.CurrentVehicle.Heading)
- Me.latestCopCarSpeed = CDbl(ped.CurrentVehicle.Speed)
- End If
- Catch ex As Exception
- End Try
- Next
- Dim flag3 As Boolean = vector = Nothing
- If flag3 Then
- Dim direction As Vector3 = GameplayCamera.Direction
- direction.Z = 0F
- vector = Game.Player.Character.Position - direction * CSng(pMinRandomDist)
- vector.Z = World.GetGroundHeight(vector) + 1F
- vector = World.GetNextPositionOnStreet(vector)
- End If
- [Function].[Call](Hash._0xA56F01F3765B93A0, New InputArgument() { vector.X, vector.Y, vector.Z, 5F, True, False, True, False })
- Return vector
- End Function
- Private Function GetHeliSpawnPos(Optional pMinRandomDist As Double = 180.0) As Vector3
- Dim vector As Vector3 = Nothing
- Dim flag As Boolean = Entity.Exists(Game.Player.Character.CurrentVehicle)
- If flag Then
- Me.latestCopCarHeading = CDbl((Game.Player.Character.CurrentVehicle.Heading + 180F))
- Me.latestCopCarSpeed = CDbl(Game.Player.Character.CurrentVehicle.Speed)
- Else
- Me.latestCopCarHeading = CDbl((Game.Player.Character.Heading + 180F))
- Me.latestCopCarSpeed = 5.0
- End If
- For Each ped As Ped In World.GetNearbyPeds(Game.Player.Character.GetOffsetInWorldCoords(Vector3.RelativeFront * 200F), 100F)
- Try
- Dim flag2 As Boolean = Entity.Exists(ped) AndAlso ped.IsAlive AndAlso Me.isCop(ped) AndAlso Entity.Exists(ped.CurrentVehicle) AndAlso Not Me.createdVehicles.Contains(ped.CurrentVehicle.Handle)
- If flag2 Then
- vector = ped.CurrentVehicle.Position
- Me.copsGroup = ped.CurrentPedGroup
- Me.latestCopCarHeading = CDbl(ped.CurrentVehicle.Heading)
- Me.latestCopCarSpeed = CDbl(ped.CurrentVehicle.Speed)
- End If
- Catch ex As Exception
- End Try
- Next
- Dim flag3 As Boolean = vector = Nothing
- If flag3 Then
- Dim direction As Vector3 = GameplayCamera.Direction
- direction.Z = 0F
- vector = (Game.Player.Character.Position - direction * CSng(pMinRandomDist)).Around(50.0F)
- End If
- vector.Z = Math.Max(Game.Player.Character.Position.Z + 50.0F, 50.0F)
- [Function].[Call](Hash._0xA56F01F3765B93A0, New InputArgument() { vector.X, vector.Y, vector.Z, 5F, True, False, True, False })
- Return vector
- End Function
- Private Function GetSpawnPosInWater(Optional pMinRandomDist As Double = 180.0F) As Vector3
- Dim vector As Vector3 = Nothing
- Dim flag As Boolean = Entity.Exists(Game.Player.Character.CurrentVehicle)
- If flag Then
- Me.latestCopCarHeading = CDbl((Game.Player.Character.CurrentVehicle.Heading + 180.0F))
- Me.latestCopCarSpeed = CDbl(Game.Player.Character.CurrentVehicle.Speed)
- Else
- Me.latestCopCarHeading = CDbl((Game.Player.Character.Heading + 180.0F))
- Me.latestCopCarSpeed = 5.0
- End If
- For Each ped As Ped In World.GetNearbyPeds(Game.Player.Character.GetOffsetInWorldCoords(Vector3.RelativeFront * 200F), 100F)
- Try
- Dim flag2 As Boolean = Entity.Exists(ped) AndAlso ped.IsAlive AndAlso Me.isCop(ped) AndAlso Entity.Exists(ped.CurrentVehicle) AndAlso Not Me.createdVehicles.Contains(ped.CurrentVehicle.Handle) AndAlso (ped.CurrentVehicle.IsInWater OrElse ped.CurrentVehicle.Model.IsBoat)
- If flag2 Then
- vector = ped.CurrentVehicle.Position
- Me.copsGroup = ped.CurrentPedGroup
- Me.latestCopCarHeading = CDbl(ped.CurrentVehicle.Heading)
- Me.latestCopCarSpeed = CDbl(ped.CurrentVehicle.Speed)
- End If
- Catch ex As Exception
- End Try
- Next
- Dim flag3 As Boolean = vector = Nothing
- If flag3 Then
- Dim direction As Vector3 = GameplayCamera.Direction
- direction.Z = 0F
- vector = (Game.Player.Character.Position - direction * CSng(pMinRandomDist)).Around(50F)
- Dim flag4 As Boolean = World.GetGroundHeight(vector) > -2F
- If flag4 Then
- vector = Nothing
- End If
- End If
- [Function].[Call](Hash._0xA56F01F3765B93A0, New InputArgument() { vector.X, vector.Y, vector.Z, 5F, True, False, True, False })
- Return vector
- End Function
- Private Sub ResetScriptState()
- Me.bSixstars = False
- Me.crimes = 0
- Me.damagedPeds.Clear()
- Me.copsGroup = Nothing
- Me.relationshipGroup = Nothing
- Me.bLoadAnimatedGif = True
- Me.animatedGifFiles_1.Clear()
- Me.animatedGifFiles_currentImages.Clear()
- Me.latestCopCarHeading = 0.0
- Me.latestCopCarSpeed = 0.0
- Me.createdVehicles.Clear()
- Me.createdEntities.Clear()
- End Sub
- Private myRandomSource As Random
- Private bSixStars As Boolean
- Private crimes As Integer
- Private timerCheckKilledPeds As DateTime
- Private damagedPeds As List(Of Integer)
- Private timerDispatch As DateTime
- Private copsGroup As PedGroup
- Private relationshipGroup As PedGroup
- Private bLoadAnimatedGif As Boolean
- Private animatedGifFiles_1 As List(Of String)
- Private animatedGig_timerNextImage As DateTime
- Private animatedGifFiles_currentImages As List(Of String)
- Private timerShowWNews As Date
- Private bShowWNews As Boolean = False
- Private latestCopCarHeading As Double
- Private latestCopCarSpeed As Double
- Private createdVehicles As List(Of Integer)
- Private createdEntities As List(Of Entity)
- Public Enum pedType
- Player = 1
- Male = 4
- Female = 5
- Cop = 6
- Human = 26
- SWAT = 27
- Animal = 28
- Army = 29
- End Enum
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement