[Release] esx_jailer

roleplay
police

#83

May implement some kind of unjailing tonight. Don’t except anything fancy, but I’m thinking a circle in mission row PD where you can unjail people


#84

I can get this to work via chat command but not from the police menu


#85

iam stuck here,

image


#86

dose this update keep /jail and /unjail for admins?


#87

you need to go into your files and into where the translations are and add it


#88

I cant get the script to load, i keep getting the error, Failed to load script serverJailer.lua??
From what i can tell this script never had a serverJailer.lua?


#89

How to jail
Use the esx_jailer:sendToJail(target, jailTime) server side trigger
Use the /jail playerID jailTime command (only admins)
Use the /unjail playerID to unjail a player (only admins)

Where it should be written in which file


#90

how would one make it so it show who jailed who on chat?


#91

has anyone found a fix to where the if cuffed and you put them in jail it will uncuff them so they can move around?


#92

Just trigger the handcuff event on them?


#94

how to add? apply to policejob and crash all police


#95

Is it possible to change from seconds to minutes?


#96

Can someone paste there main.lua from esx_police, i am fairly new and am having some issues putting it in. Thanks


#97

Hey what do you mean go into the files, i am having this too


#98

Hello,

People using LuaInjector are able to send everybody on the server in jail at the same time because there are no check if it’s a police…

I tryed to do it but it’s only detecting the “ELSE” part and it’s ignoring the rest even tough I am a police…

-- send to jail and register in database
RegisterServerEvent('esx_jailer:sendToJail')
AddEventHandler('esx_jailer:sendToJail', function(target, jailTime)
	local xPlayer = ESX.GetPlayerFromId(source)
 	if xPlayer.job.name == 'police' then
	local identifier = GetPlayerIdentifiers(target)[1]
	MySQL.Async.fetchAll('SELECT * FROM jail WHERE identifier=@id', {['@id'] = identifier}, function(result)
		if result[1] ~= nil then
			MySQL.Async.execute("UPDATE jail SET jail_time=@jt WHERE identifier=@id", {['@id'] = identifier, ['@jt'] = jailTime})
		else
			MySQL.Async.execute("INSERT INTO jail (identifier,jail_time) VALUES (@identifier,@jail_time)", {['@identifier'] = identifier, ['@jail_time'] = jailTime})
		end
	end)	
		TriggerClientEvent('chat:addMessage', -1, { args = { _U('judge'), _U('jailed_msg', GetPlayerName(target), ESX.Round(jailTime / 60)) }, color = { 147, 196, 109 } })
		TriggerClientEvent('esx_policejob:unrestrain', target)
		TriggerClientEvent('esx_jailer:jail', target, jailTime)
	else
		TriggerServerEvent('_chat:messageEntered', GetPlayerName(id), { 255, 0, 0 }, '^1J\'ai essayer d\'envoyer quelqu\'un en prison sans avoir les permissions.')	
		--print(('esx_jailer: %s attempted to drag out from vehicle (not cop)!'):format(xPlayer.identifier))
	end
end)

#99

Error running call reference function for resource essentialmode: citizen:/scripting/lua/scheduler.lua:351: server/main.lua:218: attempt to index a nil value (field ‘?’)
stack traceback:
server/main.lua:218: in upvalue ‘ref’
citizen:/scripting/lua/scheduler.lua:337: in function citizen:/scripting/lua/scheduler.lua:336
[C]: in function ‘xpcall’
citizen:/scripting/lua/scheduler.lua:336: in function citizen:/scripting/lua/scheduler.lua:335
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/scheduler.lua:351: in function citizen:/scripting/lua/scheduler.lua:322

Can you help me what can i do? I cant jail anyone.


#100

Is there any way to get rid of the you cannot escape form jail option?


#101

so i have added the prison script and im trying to change the coordinates in my jail script but for some reason it does not work. Does anyone know why i cant change the coords? thx


#102

Did anyone have a problem with the esx_jailer script? The script adds to the database, and nothing else happens, only this error pops up.

Error running call reference function for resource essential: citizen: /scripting/lua/scheduler.lua: 351: server / main.lua: 218: attempt to index a nil value (field ‘?’)
traceback stack:
server / main.lua: 218: in upvalue ‘ref’
citizen: /scripting/lua/scheduler.lua: 337: in function
[C]: in function ‘xpcall’
citizen: /scripting/lua/scheduler.lua: 336: in function
traceback stack:
[C]: in function ‘error’
citizen: /scripting/lua/scheduler.lua: 351: in function


#103

last time i try to use the latest updated on this it would not let me use /jail or unjail anymore