Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Police Menu Integration for Latest esx_policejob #2

Merged
merged 57 commits into from
May 17, 2018

Conversation

SoldatMI
Copy link

-------------------------------------------Client/main.lua--------------------------------------------

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('jail'),			value = 'jail'}
		}

				if action == 'identity_card' then
					OpenIdentityCardMenu(player)
				elseif action == 'body_search' then
					OpenBodySearchMenu(player)
				elseif action == 'handcuff' then
					TriggerServerEvent('esx_mspjob:handcuff', GetPlayerServerId(player))
				elseif action == 'drag' then
					TriggerServerEvent('esx_mspjob:drag', GetPlayerServerId(player))
				elseif action == 'put_in_vehicle' then
					TriggerServerEvent('esx_mspjob:putInVehicle', GetPlayerServerId(player))
				elseif action == 'out_the_vehicle' then
					TriggerServerEvent('esx_mspjob:OutVehicle', GetPlayerServerId(player))
				elseif action == 'fine' then
					OpenFineMenu(player)
				elseif action == 'jail' then
					JailPlayer(GetPlayerServerId(player))	
				elseif action == 'license' then
					ShowPlayerLicense(player)
				end

function JailPlayer(player)
ESX.UI.Menu.Open(
'dialog', GetCurrentResourceName(), 'jail_menu',
{
title = _U('jail_menu_info'),
},
function (data2, menu)
local jailTime = tonumber(data2.value)
if jailTime == nil then
ESX.ShowNotification(_U('invalid_amount'))
else
TriggerServerEvent("esx_jailer:sendToJail", player, jailTime * 60)
menu.close()
end
end,
function (data2, menu)
menu.close()
end
)
end

---------------------------------------LOCALES [EN]---------------------------------------------------------

['jail'] = 'Sentence to Jail!',
['jail_menu_info'] = 'Enter Amount of Months to be served Months = Minutes',

@TanguyOrtegat TanguyOrtegat merged commit 2f3a02b into esx-community:master May 17, 2018
@oogienl oogienl mentioned this pull request Sep 9, 2018
@tazuuuu tazuuuu mentioned this pull request Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants