[Release] Police Interaction Script

Ok So I had to make some changes to it to make it work better with the police menu.

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'},
        		{label = _U('PIScallmenu'),	        value = 'PIScallmenu'},
        		{label = _U('PIScall'),	          	value = 'PIScall'},
           		{label = _U('PIStraffic'),        	value = 'PIStraffic'},      
           		{label = _U('mimic'),        	        value = 'mimic'},    	
        		{label = _U('PIStransport'),     	value = 'PIStransport'},
        		{label = _U('PIStow'),            	value = 'PIStow'},

to here

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

			{label = _U('PIS'),	                        value = 'PIS'},
        		{label = _U('PIScallmenu'),	        value = 'PIScallmenu'},
        		{label = _U('PIScall'),	          	value = 'PIScall'},
           		{label = _U('PIStraffic'),        	value = 'PIStraffic'},      
           		{label = _U('mimic'),        	        value = 'mimic'},    	
        		{label = _U('PIStransport'),     	value = 'PIStransport'},
        		{label = _U('PIStow'),            	value = 'PIStow'},

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

then I added this

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

		elseif data.current.value == 'PIScallmenu' then
		TriggerEvent('PIScallmenu')
		ESX.UI.Menu.CloseAll()
		
		elseif data.current.value == 'PIScall' then
		TriggerEvent('PIScall')
		ESX.UI.Menu.CloseAll()
		
		elseif data.current.value == 'PIStraffic' then
		TriggerEvent('PIStraffic')
		ESX.UI.Menu.CloseAll()
		
		elseif data.current.value == 'PIStransport' then
		TriggerEvent('PIStransport')
		
		elseif data.current.value == 'PIStow' then
		TriggerEvent('PIStow')

		elseif data.current.value == 'mimic' then
		TriggerEvent('PISmimic')
		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/other/menu_client.lua

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

        AddEventHandler('PIScall',function(PlayerPed)
        WarMenu.OpenMenu('PIS:call')
        end)

        AddEventHandler('PIScallmenu',function(PlayerPed)
        WarMenu.OpenMenu('PIS:call:mnu')
        end)

        AddEventHandler('PIStransport',function(PlayerPed)
        TriggerEvent('pis:arr:pt')
        end)

        AddEventHandler('PIStow',function(PlayerPed)
        TriggerEvent('pis:spawnTow')
        end)

        AddEventHandler('PIStraffic',function(PlayerPed)
        WarMenu.OpenMenu('PIS:trfc')
        end)

        AddEventHandler('PISmimic',function(PlayerPed)
        WarMenu.OpenMenu('PIS:trfc:veh')
        end)


and to the locale/en.lua in policejob i added

  ['PIScall'] = 'PIS - Callout Responce menu',
  ['PIScallmenu'] = 'PIS - Callouts menu',
  ['PIStransport'] = 'PIS - Spawn prisoner transport',
  ['PIStow'] = 'PIS - Spawn tow truck',
  ['PIStraffic'] = 'PIS - Traffic stop menu',
  ['mimic'] = 'PIS - Mimic menu',

It’s just edited so it works for ‘me’ if it works for you too… Great!!! if not hopefully this has gave you and idea of how u can change it around to suit your needs!

:smiley:

5 Likes

Can you run ID’s and plates from the patrol car? I thought the F6 menu was disabled while in a vehicle.

1 Like

You should be able to, yes.

1 Like

I’ve made it its own menu within the LEO to save space

function OpenPoliceActionsMenu()
	ESX.UI.Menu.CloseAll()
	
	ESX.UI.Menu.Open(
	'default', GetCurrentResourceName(), 'police_actions',
	{
		title    = 'Police',
		align    = 'bottom-right',
		elements = {
			{label = _U('citizen_interaction'),	value = 'citizen_interaction'},
			{label = _U('vehicle_interaction'),	value = 'vehicle_interaction'},
			{label = _U('object_spawner'),		value = 'object_spawner'},
			{label = _U('PISmenu'),		    value = 'PISmenu'},
		}
	}, function(data, menu)
	
		if data.current.value == 'PISmenu' then
                  local elements = {
				{label = _U('PIS'),	                value = 'PIS'},
        		{label = _U('PIScallmenu'),	        value = 'PIScallmenu'},
        		{label = _U('PIScall'),	          	value = 'PIScall'},
           		{label = _U('PIStraffic'),        	value = 'PIStraffic'},       	
		    	{label = _U('mimic'),	      		value = 'mimic'},
        		{label = _U('PIStransport'),     	value = 'PIStransport'},
        		{label = _U('PIStow'),            	value = 'PIStow'},
  }
  ESX.UI.Menu.Open(
	'default', GetCurrentResourceName(), 'police_actions',
	{
	  title    = 'PIS - Main Menu',
	  align    = 'bottom-right',
	  elements = elements,
	},
		function(data, menu)
	  menu.close()
	end
  )
end

and I added this in the locales

  ['PISmenu'] = 'PIS - Main Menu',
1 Like

PIS missing pack file for one of the members trying enter the game

None at all. I was having a talk with another guy about this. I dont use F6 for my LEO Menu its F3. Everything seems to work fine for me.

is that a bug or is there something he can do or i can do ?

Maybe he could try clearing his client cache? I have never seen that error before.

1 Like

@Scott_UK Might i suggest uploading this to Github so others can help with this & people can easily post bug reports.

github.com/ScottUK/PoliceInteractionScript

3 Likes

I’ll do it for 1,000,000 snail dollars though.

How can i add a Blip for this mod?

This may sound like a dumb question, but… Is there a possibility to randomize the place where the call outs will be spawned? since when i start a call out, it’s in sandy.

So, is there a way to get the call outs to randomize the spawn area? (So for example, it happens in the city, or paleto. instead of Sandy the whole time?)

Please let me know.

2 Likes

Sorry, can you send me your file, 'cuz I can’t really know how to add them I added like that:

{label = _U('PIS'),	value = 'PIS'},
{label = _U('vehicle_interaction'),	value = 'vehicle_interaction'},
{label = _U('PIS'),	                value = 'PIS'},
{label = _U('object_spawner'),		value = 'object_spawner'}
	elseif data.current.value == 'PIS' then
		TriggerEvent('PISMenu')
		ESX.UI.Menu.CloseAll()
	elseif data.current.value == 'object_spawner' then

I don’t know how to form that

A question, everyone can use that script on the server? Or only the police officers or only the people in the police cars or?

1 Like

anyone can use. Script requires modification to completely lock to police job

1 Like

Is there a quick way to do that with dunkosvrp and not esx so we dont have civs stopping cars?

And how can I configurate it to be only able for the police officers?

Scripts need more work! When you pull over the AI there need to be a way to force the AI on the shoulder

When you pull over an AI, Angle the front of your car to the left, Almost an entire Width of your Car. Then back up 3 meters/ 10 feet. Then open the Mimic Menu and stear that fucker up into the Forest. You can control it rather well then this way, But you will in some cases Need to readjust it,BUT never Center your car with there car, always at a front left Angle before the Mimic command or menu. If I need to I could do a lil Twitch Video On it. For you Brits, do the same thing but to the Right.