Giter VIP home page Giter VIP logo

esx_jail's People

Contributors

dux1993 avatar ekennn avatar elpumpo avatar psycodeliccircus avatar rex2630 avatar tanguyortegat avatar theoriginalpapa avatar victor4x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esx_jail's Issues

Issue with police jailing (Solved)

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

release delay

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?

jail error

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

F6 Menu wont work

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.

Adding to menu breaks police job

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.

Bug with /unjail

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.

Police check

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)

Add more Jail locations

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.

Bugs

/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.

Jailing Random Players

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

policejob jailing

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

https://gyazo.com/2f5dced0065d9ebeeb475e811d051eb5

Allow for cops?

Hi,
I read through the code. Is it possible to make it available for cops aswell as admins?
Thanks!

Error loading script

Error loading script server/main.lua in resource esx_jail: @esx_jail/server/main.lua:38: attempt to call a nil value (field 'RegisterCommand')

Jail timer counting too fast?

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

Security Flaw

Can be abused by injection to jail everyone on the server, check missing to verify it's police or a staff member.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.