esx-community / esx_jail Goto Github PK
View Code? Open in Web Editor NEWLet cops jail people, an FiveM project
Let cops jail people, an FiveM project
When i add the code lines to the esx_policejob to get this to work it doesn't show an error but it won't let me open the F6 menu as PD
For some reason, most of the times I unjail myself or someone else, it has a long delay after the "player has been released from jail" text pops up. I have a script that takes players inventory and returns it upon release. This is conflicting because it's giving their guns back while they are still in jail due to the delayed release. Is this purposely done? Can I remove the delay?
when I attempt to jail someone and my ID is 1 it will only jail me no matter who uses the script.
hello, i have error when sending to jail
Error running call reference function for resource esx_policejob: citizen:/scripting/lua/scheduler.lua:351: @es_extended/locale.lua:8: bad argument #2 to 'format' (no value)
stack traceback:
[C]: in function 'string.format'
@es_extended/locale.lua:8: in function '_'
@es_extended/locale.lua:20: in function '_U'
client/main.lua:847: in function 'JailPlayer'
client/main.lua:539: 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
Error running system event handling function for resource esx_menu_default: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: citizen:/scripting/lua/MessagePack.lua:830: missing bytes
stack traceback:
[C]: in function 'error'
citizen:/scripting/lua/MessagePack.lua:830: in method 'underflow'
citizen:/scripting/lua/MessagePack.lua:465: in field 'any'
citizen:/scripting/lua/MessagePack.lua:860: in field 'unpack'
citizen:/scripting/lua/scheduler.lua:563: in field 'submit'
client/main.lua:53: in upvalue 'handler'
citizen:/scripting/lua/scheduler.lua:175: in function citizen:/scripting/lua/scheduler.lua:174
stack traceback:
[C]: in function 'error'
citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
citizen:/scripting/lua/scheduler.lua:174: in function citizen:/scripting/lua/scheduler.lua:138
[C]: in function 'coroutine.resume'
citizen:/scripting/lua/scheduler.lua:34: in field 'CreateThreadNow'
citizen:/scripting/lua/scheduler.lua:174: in function citizen:/scripting/lua/scheduler.lua:138
I edited the files as expected into the client folder for the police job and now I cannot get my F6 button to work even if I remove the code.
Hi,
How Can add Jail in the Menu for police.
can you please more explain.
Best Regards
Akram
Everytime I try adding jail to the job menu, it breaks the entire police job. I believe I put everything in right. I could use some assistance please.
There is a bug where say you jail a player through the F6 Menu or /jail. When they are jailed for say 5mins (300secs) then you /unjail them the timer still counts down and will go negative like -1125. But when they die the timer goes away. Then when you jail them again for 5mins (300secs) the timer will start at -1125 & countdown to -1425 then it will release them. Then when we jail them again for 5mins (300secs) it will start off at -1425 & does the same thing over & over again. There is no fix that we can tell.
I tryed to add a check to see if the player has the job police before sending someone in jail because some modders has been sending everyone in jail at the same time using a lua injector with the event handler.. but it doesn't work.. it keep returning attempt to call a nil value (local xPlayer)
-- 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 ~= nil and 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
TriggerClientEvent('chat:addMessage', -1, { args = { xPlayer, "à tenter de mettre quelqu'un en prison sans avoir les permissions" }, color = { 147, 196, 109 } })
print(('esx_policejob: %s attemped to send someone in prison (not cop)!'):format(xPlayer.identifier))
end
end)
what the title says.
For instance when you jail 2 players they r always put in the same cell. Add the ability to add more then 1 location. Like if someone moved the jail to mission row pd. You can setup all the cells.
/unjail - Removes the timer but doesn't teleport you out, or, when it does, takes a tone of time.
When you leave the server and come ON again the timer restarts to initial timer.
Creating script environments for esx_jail
Error loading script server/main.lua in resource esx_jail: @esx_jail/server/main.lua:38: attempt to call a nil value (field 'RegisterCommand')
stack traceback:
@esx_jail/server/main.lua:38: in main chunk
Failed to load script server/main.lua.
I tried to jail someone infront of me and it picked a random person from the server and jailed them instead.
It became a huge issue so I stopped using this
im trying to get jailing to work so that i dont have to make all my cops in the server an admin, but im getting errors and it doesnt work. perhaps someone can see what im doing wrong because i followed the instructions with no succes.
Error running call reference function for resource esx_policejob: citizen:/scripting/lua/scheduler.lua:351: @es_extended/locale.lua:8: bad argument #2 to 'format' (no value)
stack traceback:
[C]: in function 'string.format'
@es_extended/locale.lua:8: in function '_'
@es_extended/locale.lua:20: in function '_U'
client/main.lua:847: in function 'JailPlayer'
client/main.lua:539: 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
Error running system event handling function for resource esx_menu_default: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: citizen:/scripting/lua/MessagePack.lua:830: missing bytes
stack traceback:
[C]: in function 'error'
citizen:/scripting/lua/MessagePack.lua:830: in method 'underflow'
citizen:/scripting/lua/MessagePack.lua:465: in field 'any'
citizen:/scripting/lua/MessagePack.lua:860: in field 'unpack'
citizen:/scripting/lua/scheduler.lua:563: in field 'submit'
client/main.lua:53: in upvalue 'handler'
citizen:/scripting/lua/scheduler.lua:175: in function citizen:/scripting/lua/scheduler.lua:174
stack traceback:
[C]: in function 'error'
citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
citizen:/scripting/lua/scheduler.lua:174: in function citizen:/scripting/lua/scheduler.lua:138
[C]: in function 'coroutine.resume'
citizen:/scripting/lua/scheduler.lua:34: in field 'CreateThreadNow'
citizen:/scripting/lua/scheduler.lua:174: in function citizen:/scripting/lua/scheduler.lua:138
these are in my policejob main.lua
https://gyazo.com/2f5dced0065d9ebeeb475e811d051eb5
Hi,
I read through the code. Is it possible to make it available for cops aswell as admins?
Thanks!
Error loading script server/main.lua in resource esx_jail: @esx_jail/server/main.lua:38: attempt to call a nil value (field 'RegisterCommand')
When I jail myself for 2 minutes, it seems to be counting way too fast, maybe 2 seconds pass on the timer in one second or something. Two minutes doesnt seem to = 2 minutes IRL time
Can be abused by injection to jail everyone on the server, check missing to verify it's police or a staff member.
When I add all the things to the client/main.lua it wont let me open my citizen menu
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.