if LEORestrict() then if checkActive() then local LEOMenu = _MenuPool:AddSubMenu(MainMenu, 'LEO Toolbox', 'Law Enforcement Related Menu', true) LEOMenu:SetMenuWidthOffset(Config.MenuWidth) local LEOActions = _MenuPool:AddSubMenu(LEOMenu, 'Actions', '', true) LEOActions:SetMenuWidthOffset(Config.MenuWidth) local Cuff = NativeUI.CreateItem('Cuff', 'Cuff Closest Player') local Drag = NativeUI.CreateItem('Drag', 'Drags Closest Player') local Seat = NativeUI.CreateItem('Seat', 'Puts Player in Vehicle') local Unseat = NativeUI.CreateItem('Unseat', 'Removes Player from Vehicle') local Radar = NativeUI.CreateItem('Radar', 'Toggles Wraith Radar') local Inventory = NativeUI.CreateItem('Inventory', 'Search Inventory') local BAC = NativeUI.CreateItem('BAC', 'Tests BAC Level') local Jail = NativeUI.CreateItem('Jail', 'Jail Player') local Spikes = NativeUI.CreateItem('Deploy Spikes', 'Places Spike Strips in Front of Player') local Shield = NativeUI.CreateItem('Toggle Shield', 'Toggles Bulletproof Shield') local CarbineRifle = NativeUI.CreateItem('Toggle Carbine', 'Toggles Carbine Rifle') local Shotgun = NativeUI.CreateItem('Toggle Shotgun', 'Toggles Shotgun') PropsList = {} for _, Prop in pairs(Config.LEOProps) do table.insert(PropsList, Prop.name) end local Props = NativeUI.CreateListItem('Spawn Props', PropsList, 1, 'Spawn Objects/Props') local RemoveProps = NativeUI.CreateItem('Remove Props', 'Removes Spawned Props') LEOActions:AddItem(Cuff) LEOActions:AddItem(Drag) LEOActions:AddItem(Seat) LEOActions:AddItem(Unseat) if Config.Radar ~= 0 then LEOActions:AddItem(Radar) end LEOActions:AddItem(Inventory) LEOActions:AddItem(BAC) if Config.LEOJail then LEOActions:AddItem(Jail) end LEOActions:AddItem(Spikes) LEOActions:AddItem(Shield) if Config.UnrackWeapons then LEOActions:AddItem(CarbineRifle) LEOActions:AddItem(Shotgun) end if Config.DisplayProps then LEOActions:AddItem(Props) LEOActions:AddItem(RemoveProps) end Cuff.Activated = function(ParentMenu, SelectedItem) local player = GetClosestPlayer() if player ~= false then TriggerServerEvent('SEM_InteractionMenu:CuffNear', player) end end Drag.Activated = function(ParentMenu, SelectedItem) local player = GetClosestPlayer() if player ~= false then TriggerServerEvent('SEM_InteractionMenu:DragNear', player) end end Seat.Activated = function(ParentMenu, SelectedItem) local Veh = GetVehiclePedIsIn(Ped, true) local player = GetClosestPlayer() if player ~= false then TriggerServerEvent('SEM_InteractionMenu:SeatNear', player, Veh) end end Unseat.Activated = function(ParentMenu, SelectedItem) if IsPedInAnyVehicle(GetPlayerPed(-1), true) then Notify('~o~You need to be outside of the vehicle') return end local player = GetClosestPlayer() if player ~= false then TriggerServerEvent('SEM_InteractionMenu:UnseatNear', player) end end Radar.Activated = function(ParentMenu, SelectedItem) if Config.Radar ~= 0 then if IsPedInAnyVehicle(GetPlayerPed(-1)) then if GetVehicleClass(GetVehiclePedIsIn(GetPlayerPed(-1))) == 18 then if GetPedInVehicleSeat(GetVehiclePedIsIn(GetPlayerPed(-1)) == -1) then _MenuPool:CloseAllMenus() if Config.Radar == 1 then TriggerEvent('wk:openRemote') elseif Config.Radar == 2 then TriggerEvent('wk:radarRC') else Notify('~r~Invalid Radar Option, please rectify!') end else Notify('~o~You need to be in the driver seat') end else Notify('~o~You need to be in a police vehicle') end else Notify('~o~You need to be in a vehicle') end end end Inventory.Activated = function(ParentMenu, SelectedItem) local player = GetClosestPlayer() if player ~= false then Notify('~b~Searching ...') TriggerServerEvent('SEM_InteractionMenu:InventorySearch', player) end end BAC.Activated = function(ParentMenu, SelectedItem) local player = GetClosestPlayer() if player ~= false then Notify('~b~Testing ...') TriggerServerEvent('SEM_InteractionMenu:BACTest', player) end end Jail.Activated = function(ParentMenu, SelectedItem) local PlayerID = tonumber(KeyboardInput('Player ID:', 10)) if PlayerID == nil then Notify('~r~Please enter a player ID') return end local JailTime = tonumber(KeyboardInput('Time: (Seconds) - Max Time: ' .. Config.MaxJailTime .. ' | Default Time: 30', string.len(Config.MaxJailTime))) if JailTime == nil then JailTime = 30 end if JailTime > Config.MaxJailTime then Notify('~y~Exceeded Max Time\nMax Time: ' .. Config.MaxJailTime .. ' seconds') JailTime = Config.MaxJailTime end Notify('Player Jailed for ~b~' .. JailTime .. ' seconds') TriggerServerEvent('SEM_InteractionMenu:Jail', PlayerID, JailTime) end Spikes.Activated = function(ParentMenu, SelectedItem) TriggerEvent('SEM_InteractionMenu:Spikes-SpawnSpikes') end Shield.Activated = function(ParentMenu, SelectedItem) if ShieldActive then DisableShield() else EnableShield() end end CarbineRifle.Activated = function(ParentMenu, SelectedItem) if (GetVehicleClass(GetVehiclePedIsIn(GetPlayerPed(-1))) == 18) then CarbineEquipped = not CarbineEquipped ShotgunEquipped = false elseif (GetVehicleClass(GetVehiclePedIsIn(GetPlayerPed(-1))) ~= 18) then Notify('~r~You Must be in a Police Vehicle to rack/unrack your Carbine Rifle') return end if CarbineEquipped then Notify('~g~Carbine Rifle Equipped') GiveWeapon('weapon_carbinerifle') AddWeaponComponent('weapon_carbinerifle', 'component_at_ar_flsh') AddWeaponComponent('weapon_carbinerifle', 'component_at_ar_afgrip') else Notify('~y~Carbine Rifle Unequipped') RemoveWeaponFromPed(GetPlayerPed(-1), 'weapon_carbinerifle') end end Shotgun.Activated = function(ParentMenu, SelectedItem) if (GetVehicleClass(GetVehiclePedIsIn(GetPlayerPed(-1))) == 18) then ShotgunEquipped = not ShotgunEquipped CarbineEquipped = false elseif (GetVehicleClass(GetVehiclePedIsIn(GetPlayerPed(-1))) ~= 18) then Notify('~r~You Must be in a Police Vehicle to rack/unrack your Shotgun') return end if ShotgunEquipped then Notify('~g~Shotgun Equipped') GiveWeapon('weapon_pumpshotgun') AddWeaponComponent('weapon_pumpshotgun', 'component_at_ar_flsh') else Notify('~y~Shotgun Unequipped') RemoveWeaponFromPed(GetPlayerPed(-1), 'weapon_pumpshotgun') end end LEOActions.OnListSelect = function(sender, item, index) if item == Props then for _, Prop in pairs(Config.LEOProps) do if Prop.name == item:IndexToItem(index) then TriggerEvent('SEM_InteractionMenu:Object:SpawnObjects', Prop.spawncode, Prop.name) end end end end RemoveProps.Activated = function(ParentMenu, SelectedItem) for _, Prop in pairs(Config.LEOProps) do DeleteOBJ(Prop.spawncode) end end if Config.DisplayBackup then local LEOBackup = _MenuPool:AddSubMenu(LEOMenu, 'Backup', '', true) LEOBackup:SetMenuWidthOffset(Config.MenuWidth) --[[ Code 1 Backup | No Lights or Siren Code 2 Backup | Only Lights Code 3 Backup | Lights and Siren Code 99 Backup | All Available Unit Responde Code 3 ]] local BK1 = NativeUI.CreateItem('Code 1', 'Call Code 1 Backup to your location') local BK2 = NativeUI.CreateItem('Code 2', 'Call Code 2 Backup to your location') local BK3 = NativeUI.CreateItem('Code 3', 'Call Code 3 Backup to your location') local BK99 = NativeUI.CreateItem('Code 99', 'Call Code 99 Backup to your location') local PanicBTN = NativeUI.CreateItem('~r~Panic Button', 'Officer Panic Button') LEOBackup:AddItem(BK1) LEOBackup:AddItem(BK2) LEOBackup:AddItem(BK3) LEOBackup:AddItem(BK99) LEOBackup:AddItem(PanicBTN) BK1.Activated = function(ParentMenu, SelectedItem) local Coords = GetEntityCoords(GetPlayerPed(-1)) local Street1, Street2 = GetStreetNameAtCoord(Coords.x, Coords.y, Coords.z) local StreetName = GetStreetNameFromHashKey(Street1) TriggerServerEvent('SEM_InteractionMenu:Backup', 1, StreetName, Coords) end BK2.Activated = function(ParentMenu, SelectedItem) local Coords = GetEntityCoords(GetPlayerPed(-1)) local Street1, Street2 = GetStreetNameAtCoord(Coords.x, Coords.y, Coords.z) local StreetName = GetStreetNameFromHashKey(Street1) TriggerServerEvent('SEM_InteractionMenu:Backup', 2, StreetName, Coords) end BK3.Activated = function(ParentMenu, SelectedItem) local Coords = GetEntityCoords(GetPlayerPed(-1)) local Street1, Street2 = GetStreetNameAtCoord(Coords.x, Coords.y, Coords.z) local StreetName = GetStreetNameFromHashKey(Street1) TriggerServerEvent('SEM_InteractionMenu:Backup', 3, StreetName, Coords) end BK99.Activated = function(ParentMenu, SelectedItem) local Coords = GetEntityCoords(GetPlayerPed(-1)) local Street1, Street2 = GetStreetNameAtCoord(Coords.x, Coords.y, Coords.z) local StreetName = GetStreetNameFromHashKey(Street1) TriggerServerEvent('SEM_InteractionMenu:Backup', 99, StreetName, Coords) end PanicBTN.Activated = function(ParentMenu, SelectedItem) local Coords = GetEntityCoords(GetPlayerPed(-1)) local Street1, Street2 = GetStreetNameAtCoord(Coords.x, Coords.y, Coords.z) local StreetName = GetStreetNameFromHashKey(Street1) TriggerServerEvent('SEM_InteractionMenu:Backup', 'panic', StreetName, Coords) end end if Config.ShowStations then local LEOStation = _MenuPool:AddSubMenu(LEOMenu, 'Stations', '', true) LEOStation:SetMenuWidthOffset(Config.MenuWidth) for _, Station in pairs(Config.LEOStations) do local StationCategory = _MenuPool:AddSubMenu(LEOStation, Station.name, '', true) StationCategory:SetMenuWidthOffset(Config.MenuWidth) local SetWaypoint = NativeUI.CreateItem('Set Waypoint', 'Sets Waypoint to Station') local Teleport = NativeUI.CreateItem('Teleport', 'Teleport to Station') StationCategory:AddItem(SetWaypoint) if Config.AllowStationTeleport then StationCategory:AddItem(Teleport) end SetWaypoint.Activated = function(ParentMenu, SelectedItem) SetNewWaypoint(Station.coords.x, Station.coords.y) end Teleport.Activated = function(ParentMenu, SelectedItem) SetEntityCoords(PlayerPedId(), Station.coords.x, Station.coords.y, Station.coords.z) SetEntityHeading(PlayerPedId(), Station.coords.h) end end end if Config.DisplayLEOUniforms or Config.DisplayLEOLoadouts then local LEOLoadouts = _MenuPool:AddSubMenu(LEOMenu, 'Loadouts', '', true) LEOLoadouts:SetMenuWidthOffset(Config.MenuWidth) UniformsList = {} for _, Uniform in pairs(Config.LEOUniforms) do table.insert(UniformsList, Uniform.name) end LoadoutsList = {} for Name, Loadout in pairs(Config.LEOLoadouts) do table.insert(LoadoutsList, Name) end local Uniforms = NativeUI.CreateListItem('Uniforms', UniformsList, 1, 'Spawn Uniforms') local Loadouts = NativeUI.CreateListItem('Loadouts', LoadoutsList, 1, 'Spawns LEO Loadouts') if Config.DisplayLEOUniforms then LEOLoadouts:AddItem(Uniforms) end if Config.DisplayLEOLoadouts then LEOLoadouts:AddItem(Loadouts) end LEOLoadouts.OnListSelect = function(sender, item, index) if item == Uniforms then for _, Uniform in pairs(Config.LEOUniforms) do if Uniform.name == item:IndexToItem(index) then LoadPed(Uniform.spawncode) Notify('~b~Uniform Spawned: ~g~' .. Uniform.name) end end end if item == Loadouts then for Name, Loadout in pairs(Config.LEOLoadouts) do if Name == item:IndexToItem(index) then SetEntityHealth(GetPlayerPed(-1), 200) RemoveAllPedWeapons(GetPlayerPed(-1), true) AddArmourToPed(GetPlayerPed(-1), 100) for _, Weapon in pairs(Loadout) do GiveWeapon(Weapon.weapon) for _, Component in pairs(Weapon.components) do AddWeaponComponent(Weapon.weapon, Component) end end Notify('~b~Loadout Spawned: ~g~' .. Name) end end end end end if Config.ShowLEOVehicles then local LEOVehicles = _MenuPool:AddSubMenu(LEOMenu, 'Vehicles', '', true) LEOVehicles:SetMenuWidthOffset(Config.MenuWidth) for Name, Category in pairs(Config.LEOVehiclesCategories) do local LEOCategory = _MenuPool:AddSubMenu(LEOVehicles, Name, '', true) LEOCategory:SetMenuWidthOffset(Config.MenuWidth) for _, Vehicle in pairs(Category) do local LEOVehicle = NativeUI.CreateItem(Vehicle.name, '') LEOCategory:AddItem(LEOVehicle) if Config.ShowLEOSpawnCode then LEOVehicle:RightLabel(Vehicle.spawncode) end LEOVehicle.Activated = function(ParentMenu, SelectedItem) SpawnVehicle(Vehicle.spawncode, Vehicle.name) end end end end if Config.DisplayTrafficManager then local LEOTrafficManager = _MenuPool:AddSubMenu(LEOMenu, 'Traffic Manager', '', true) LEOTrafficManager:SetMenuWidthOffset(Config.MenuWidth) AreaSize = 15.0 Raduies = {} for _, RaduisInfo in pairs(Config.AvailableRaduies) do table.insert(Raduies, RaduisInfo.name) end local Radius = NativeUI.CreateListItem('Radius', Raduies, 1, '') local ResumeTraffic = NativeUI.CreateItem('~g~Resume ~w~Traffic', '') local SlowTraffic = NativeUI.CreateItem('~y~Slow ~w~Traffic', '') local StopTraffic = NativeUI.CreateItem('~r~Stop ~w~Traffic', '') LEOTrafficManager:AddItem(Radius) LEOTrafficManager:AddItem(ResumeTraffic) LEOTrafficManager:AddItem(SlowTraffic) LEOTrafficManager:AddItem(StopTraffic) Radius.OnListChanged = function(sender, item, index) if item == Radius then for _, RaduisInfo in pairs(Config.AvailableRaduies) do if RaduisInfo.name == item:IndexToItem(index) then AreaSize = RaduisInfo.size end end end end ResumeTraffic.Activated = function(ParentMenu, SelectedItem) if Zone ~= nil then RemoveSpeedZone(Zone) RemoveBlip(Area) if Zone2 then RemoveSpeedZone(Zone2) RemoveBlip(Area2) end Zone = nil Notify("Traffic ~g~Resumed") end end SlowTraffic.Activated = function(ParentMenu, SelectedItem) if Zone ~= nil then RemoveSpeedZone(Zone) RemoveBlip(Area) if Zone2 then RemoveSpeedZone(Zone2) RemoveBlip(Area2) end Zone = nil Notify("Traffic ~g~Resumed") else Notify("Traffic ~y~Slowed") Area = AddBlipForRadius(GetEntityCoords(GetPlayerPed(-1)), AreaSize) SetBlipAlpha(Area, 80) SetBlipColour(Area, 28) Zone = AddSpeedZoneForCoord(GetEntityCoords(GetPlayerPed(-1)), AreaSize, 5.0, false) end end StopTraffic.Activated = function(ParentMenu, SelectedItem) if Zone ~= nil then RemoveSpeedZone(Zone) RemoveSpeedZone(Zone2) RemoveBlip(Area) RemoveBlip(Area2) Notify("Traffic ~g~Resumed") Zone = nil else Notify("Traffic ~r~Stopped") Area = AddBlipForRadius(GetEntityCoords(GetPlayerPed(-1)), AreaSize) Area2 = AddBlipForRadius(GetEntityCoords(GetPlayerPed(-1)), AreaSize + AreaSize * 0.5) Zone = AddSpeedZoneForCoord(GetEntityCoords(GetPlayerPed(-1)), AreaSize, 0.0, false) Zone2 = AddSpeedZoneForCoord(GetEntityCoords(GetPlayerPed(-1)), AreaSize + AreaSize * 0.5, 0.0, false) SetBlipAlpha(Area, 90) SetBlipAlpha(Area2, 80) SetBlipColour(Area, 1) SetBlipColour(Area2, 1) end end end end else print("You must be on duty!") end end