Imports System
Imports System.Windows.forms
Imports System.Drawing
Imports System.IO
Imports GTA
Imports GTA.Math
Imports GTA.Native
Public Class copweapons
    Inherits Script

    Public Sub New()
        Me.Interval = 1000
    End Sub

    Private curweap As WeaponHash, cops As Ped()
    Shadows Sub keydown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown
    End Sub
    Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
        If Game.Player.WantedLevel = 2 Then
            If Game.Player.Character.Weapons.Current.Group = WeaponGroup.Unarmed Or Game.Player.Character.Weapons.Current.Group = WeaponGroup.Melee Then
                cops = World.GetAllPeds("S_M_Y_Cop_01")
                For Each cop As Ped In cops
                    If cop.Money <> 5 Then
                        cop.Weapons.RemoveAll()
                        cop.Weapons.Give(WeaponHash.Nightstick, 1, True, True)
                        cop.Money = 5
                    End If
                Next
                cops = World.GetAllPeds("S_F_Y_Cop_01")
                For Each cop As Ped In cops
                    If cop.Money <> 5 Then
                        cop.Weapons.RemoveAll()
                        cop.Weapons.Give(WeaponHash.Nightstick, 1, True, True)
                        cop.Money = 5
                    End If
                Next
                cops = World.GetAllPeds("S_M_Y_Sheriff_01")
                For Each cop As Ped In cops
                    If cop.Money <> 5 Then
                        cop.Weapons.RemoveAll()
                        cop.Weapons.Give(WeaponHash.Nightstick, 1, True, True)
                        cop.Money = 5
                    End If
                Next
                cops = World.GetAllPeds("S_F_Y_Sheriff_01")
                For Each cop As Ped In cops
                    If cop.Money <> 5 Then
                        cop.Weapons.RemoveAll()
                        cop.Weapons.Give(WeaponHash.Nightstick, 1, True, True)
                        cop.Money = 5
                    End If
                Next
                cops = World.GetAllPeds("S_M_M_Fibsec_01")
                For Each cop As Ped In cops
                    If cop.Money <> 5 Then
                        cop.Weapons.RemoveAll()
                        cop.Weapons.Give(WeaponHash.Nightstick, 1, True, True)
                        cop.Money = 5
                    End If
                Next
                cops = World.GetAllPeds("S_M_Y_HWayCop_01")
                For Each cop As Ped In cops
                    If cop.Money <> 5 Then
                        cop.Weapons.RemoveAll()
                        cop.Weapons.Give(WeaponHash.Nightstick, 1, True, True)
                        cop.Money = 5
                    End If
                Next
            ElseIf Game.Player.Character.Weapons.Current.Group <> WeaponGroup.Unarmed Or Game.Player.Character.Weapons.Current.Group <> WeaponGroup.Melee Then
                cops = World.GetAllPeds("S_M_Y_Cop_01")
                For Each cop As Ped In cops
                    If cop.Money <> 4 Then
                        cop.Weapons.RemoveAll()
                        cop.Weapons.Give(WeaponHash.Pistol, 1, True, True)
                        cop.Money = 4
                    End If
                Next
                cops = World.GetAllPeds("S_F_Y_Cop_01")
                For Each cop As Ped In cops
                    If cop.Money <> 4 Then
                        cop.Weapons.RemoveAll()
                        cop.Weapons.Give(WeaponHash.Pistol, 1, True, True)
                        cop.Money = 4
                    End If
                Next
                cops = World.GetAllPeds("S_M_Y_Sheriff_01")
                For Each cop As Ped In cops
                    If cop.Money <> 4 Then
                        cop.Weapons.RemoveAll()
                        cop.Weapons.Give(WeaponHash.Pistol, 1, True, True)
                        cop.Money = 4
                    End If
                Next
                cops = World.GetAllPeds("S_F_Y_Sheriff_01")
                For Each cop As Ped In cops
                    If cop.Money <> 4 Then
                        cop.Weapons.RemoveAll()
                        cop.Weapons.Give(WeaponHash.Pistol, 1, True, True)
                        cop.Money = 4
                    End If
                Next
                cops = World.GetAllPeds("S_M_M_Fibsec_01")
                For Each cop As Ped In cops
                    If cop.Money <> 4 Then
                        cop.Weapons.RemoveAll()
                        cop.Weapons.Give(WeaponHash.Pistol, 1, True, True)
                        cop.Money = 4
                    End If
                Next
                cops = World.GetAllPeds("S_M_Y_HWayCop_01")
                For Each cop As Ped In cops
                    If cop.Money <> 4 Then
                        cop.Weapons.RemoveAll()
                        cop.Weapons.Give(WeaponHash.Pistol, 1, True, True)
                        cop.Money = 4
                    End If
                Next
            End If
        End If
    End Sub
End Class
