[Release] Police Interaction Script

yes, i cuff them and it says uncuffing ped all the time

BUG

Hi I tried to drag suspect but when I had dragged her to where I wanted her I couldnā€™t undrag. It said that I had to look at her but I couldnā€™t because I was still in the drag animation.

Iā€™ve got people reporting that they canā€™t get out of the cop car after pulling someone over. Has anyone else had this issue? Any solution for it?

how do you pull ove the ai to the side of the road lol I turned on my lights and the dam ai stayed in the road pleas help

Read the controlsā€¦

I did read it xd they said use ctrl+y not working

You need to use the mimicking feature after you trigger the pull over.

I got the car to pull over so what about getting the car to pull over to the far side of the road not blocking cars

I just told youā€¦ Use the mimicking feature they give youā€¦

1 Like

I have been trying to add a way to open the Interaction Menu through ESX_policejob so I can disable Civs using this script.
Iā€™ve added it to the menu, thats the easy part but I canā€™t get the menu to trigger opening the PIS

		elseif data2.current.value == 'PIS' then	
		TriggerServerEvent('PIS:Main', PlayerPed)

this is what I have. Any light shed would be greatly appreciated

The PIS:Main is a client event not a server, change TriggerServerEvent to TriggerEvent.

               AddEventHandler('PISMenu',function(PlayerPed)
              WarMenu.OpenMenu('PIS:main')
              end)
	
		elseif data.current.value == 'PIS' then	
		TriggerEvent('PISMenu', PlayerPed)

I was told to add this event handler too. But I am having no luck with this at all. TY for the help though :smiley:

Pretty should it should be

TriggerEvent('PIS:main', PlayerPed)

You shouldnā€™t need to add the PIS:main event again as it is already there if you have PIS in your server.

Iā€™ve got it now :slight_smile: Just finishing it up and I will share it all here :slight_smile:

1 Like

Do you know how to make the esx menu default close when this happens?

		elseif data.current.value == 'PIS' then
		TriggerEvent('PISMenu')

Check if there is a closemenu function, I donā€™t use ESX or VRP so I wouldnā€™t really know sorry.

1 Like

Ok to add this to your esx_policejob this is what I did. In client/main.lua of esx_policejob
I added
{label = _U('PIS'), value = 'PIS'},
to here

			{label = _U('vehicle_interaction'),	value = 'vehicle_interaction'},
			{label = _U('PIS'),	                value = 'PIS'},
			{label = _U('object_spawner'),		value = 'object_spawner'}

then I added this

		elseif data.current.value == 'PIS' then
		TriggerEvent('PISMenu')
		ESX.UI.Menu.CloseAll()

above the line
elseif data.current.value == 'object_spawner' then

In PIS/other/menu_client I changed lines 140-143 from

		WarMenu.Display()
			elseif IsDisabledControlPressed(1, modifier) and IsDisabledControlJustPressed(1, mainmnu) then
			WarMenu.OpenMenu('PIS:main')
		end

to this

	WarMenu.Display()
			WarMenu.OpenMenu('PIS:main')
		end

and added this at the end of PIS/menu_client.lua

        AddEventHandler('PISMenu',function(PlayerPed)
        WarMenu.OpenMenu('PIS:main')
        end)

What this does is disables the keypress for the interaction menu and allows only police to use it. I hope it helps someone.

I couldnā€™t have done this without help. Lucifer here and Demonen on the FiveM discord. Donā€™t want to take credit alone.

8 Likes

Not working for me :frowning: Are you registering a PISMenu event? I can find reference to one anywhere.

I missed this part out when I wrote that last night. Was late and I was falling asleep lol.

How would I add this to vrp