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('Invalid time')
else
TriggerServerEvent('esx_vankilapako:jailplayer_server', player, JailTime, 'prison')
menu.close()
end
end, function (data2, menu)
menu.close()
end)
end
not working with police job, anyone have it working and can show what it looks like?
ESX.RegisterCommand('jail', 'admin', function(xPlayer, args, showError)
JailPlayer(args.playerId, args.time, { jail = 'prison', type = 'first', time = args.time}, xPlayer)
end, true, {help = 'Jail Player', validate = true, arguments = {
{name = 'playerId', help = 'Player ID', type = 'playerId'},
{name = 'time', help = 'Minutes', type = 'number'}
}})
Only an admin can jail another admin. You cannot jail other players. Only admins. if you set admint o police you can only jail police as a police. How do I make it so a police can jail anyone?
@edelin3 I have this as well. Did you find a solution?
Hey, and sorry late answer. You have to download latest version of this script. Also please read docs and use your own brains. Installation is really easy.
Hey, of course itâs possible. You can add exports for any job. But keep in mind that you have to maybe change permissions. If you want to use multiple jobs, use or condition.
Example use in line 10
if xPlayer.job.name == 'sheriff' or xPlayer.job.name == 'statetrooper' or xPlayer.getGroup() == Config.AdminTitle then
I added the lines of the docs to my policejob, but after entering menu nothing happens.
Added the exports to if data.current.value == âcitizen_interactionâ then menu.