[Release] Police Interaction Script


#65

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


#66

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.


#67

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?


#68

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


#69

Read the controls…


#70

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


#71

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


#72

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


#73

I just told you… Use the mimicking feature they give you…


#74

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


#75

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


#76
               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:


#77

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.


#78

I’ve got it now :slight_smile: Just finishing it up and I will share it all here :slight_smile:


#79

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

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

#80

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


#82

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.


#83

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


#84

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


#85

How would I add this to vrp