[Release] Criminalrecords for ESX

Can you share how, please?

Sunday as Iam away on holiday , sorry.

So i stand next to someone, get to the prompt to type and when i submit, nothing happens.Do i just add a crime for that person or do i need to add that persons id in first. Not sure why submit does nothing.

Stand next to someone and add the crime that’s it ,

Then if someone else gets near they can also view it

Have you added the database ?

I added the database and followed all the steps. Just when I hit submit, nothing happens

2018-08-12

Bugfix -Could not press submit, github updated

Can you maybe update it that it works with the new policejob scripts.
I tried to insert the code and stuff also there but then the script from the policejob doenst load anymore.

nice work m8 ! but i wont use it but def a nice work

Update, cleanup better readme, english, works with new policejob.

Github updated!

1 Like

it is only showing All the records in the DB for me , instead of showing the record from the player im checking at the moment. , also it registers all the records under my name and steam id instead of the player i want to register ?,

i fixed it :slight_smile: working fine

Nice to hear, GL in the future :slight_smile:

Hey guys I am still pretty new to all of this and have done a pretty good job figuring most things out in the past by searching on her or google but this time I am stumped, I added the code to the police menu but now my policejob isn’t working at all. I’ve tried to study each of the examples above in detail but still can’t figure out what my problem is. Any help would be greatly appreciated.


ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'police_actions',
{
	title    = 'Police',
	align    = 'top-left',
	elements = {
		{label = _U('citizen_interaction'),	value = 'citizen_interaction'},
		{label = _U('vehicle_interaction'),	value = 'vehicle_interaction'},
		{label = _U('object_spawner'),		value = 'object_spawner'}
	}
}, function(data, menu)

	if data.current.value == 'citizen_interaction' then
		local elements = {
			{label = _U('id_card'),			value = 'identity_card'},
			{label = _U('search'),			value = 'body_search'},
			{label = _U('handcuff'),		value = 'handcuff'},
			{label = _U('drag'),			value = 'drag'},
			{label = _U('put_in_vehicle'),	value = 'put_in_vehicle'},
			{label = _U('out_the_vehicle'),	value = 'out_the_vehicle'},
			{label = _U('fine'),			value = 'fine'},
			{label = _U('unpaid_bills'),	value = 'unpaid_bills'},
		}
	
		if Config.EnableLicenses then
			table.insert(elements, { label = _U('license_check'), value = 'license' })
		end
	
		ESX.UI.Menu.Open(
		'default', GetCurrentResourceName(), 'citizen_interaction',
		{
			title    = _U('citizen_interaction'),
			align    = 'top-left',
			elements = {
			 {label = 'Criminalrecord',      value = 'criminalrecords'},
		}, function(data2, menu2)
			local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
			if closestPlayer ~= -1 and closestDistance <= 3.0 then
				local action = data2.current.value

				if action == 'identity_card' then
					OpenIdentityCardMenu(closestPlayer)
				elseif action == 'body_search' then
					TriggerServerEvent('esx_policejob:message', GetPlayerServerId(closestPlayer), _U('being_searched'))
					OpenBodySearchMenu(closestPlayer)
				elseif action == 'handcuff' then
					TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(closestPlayer))
				elseif action == 'drag' then
					TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(closestPlayer))
				elseif action == 'put_in_vehicle' then
					TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(closestPlayer))
				elseif action == 'out_the_vehicle' then
					TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(closestPlayer))
				elseif action == 'fine' then
					OpenFineMenu(closestPlayer)
				elseif action == 'license' then
					ShowPlayerLicense(closestPlayer)
				elseif action == 'unpaid_bills' then
					OpenUnpaidBillsMenu(closestPlayer)
				elseif action == 'criminalrecords' then
					TriggerEvent('esx_criminalrecords:open', GetPlayerServerId(closestPlayer))	
				end

			else
				ESX.ShowNotification(_U('no_players_nearby'))
			end
		end, function(data2, menu2)
			menu2.close()
		end)
		}

OK Try to add it under unpaid bills and not there image

Ok thanks! I’ll give it a shot when I get home

This script works 100%, i’ve used and implemented it on more than one server. You have to make sure you implement it according to what version policejob you have. There are a few examples a little higher up in the comments

Well what version do i need?

The current update will work with the latest versrion of esx_policejob

I have it set in my police job and everything works fine. However, civilians can press f5 and it brings the menu up in the default language. how do I remove this part?

Remove the iscontroljustpressed in esx_criminalrecords