[RELEASE] Badger_Jailing

Badger_Jailing

Documentation

What is it?

Badger_Jailing is a pretty basic jailing script. I wrote it for my past FiveM server because the current jail system was wonky and would let people out of jail if they changed their ped model. This jail script functions a little bit differently than most however. Instead of having a single place to spend jail time, there are cells you define in the config. A player can only be in a cell if it is open. If all the cells are taken, then the player who was jailed will be on a queue waiting to be jailed when a cell is open. In general, I suggest 10+ cells defined in the config as well as a nice jail interior like the one displayed in Images. Another nice thing is that jail times carry over even when the server is restarted or a player leaves. Players therefore cannot afford their jail time. You do the crime, you do the timeā€¦

Images

Commands

/jail <id> <time> - Requires Badger_Jailing.Jail permission.

/free <id> - Requires Badger_Jailing.Unjail permission.

Configuration

Config = {
    Prefix = '^1[^5Badger_Jailing^1] ^3',
    PrisonExit = { x = 1840.57, y = 2586.37, z = 45.95 },
    Cells = {
        ['Cell 1'] = { x = 1774.48, y = 2568.42, z = 49.55 },
        ['Cell 2'] = { x = 1778.49, y = 2568.26, z = 49.55 },
        ['Cell 3'] = { x = 1782.50, y = 2568.27, z = 49.55 },
        ['Cell 4'] = { x = 1786.21, y = 2568.40, z = 49.55 },
        ['Cell 5'] = { x = 1790.10, y = 2574.27, z = 49.55 },
        ['Cell 6'] = { x = 1790.03, y = 2577.72, z = 49.55 },
        ['Cell 7'] = { x = 1790.08, y = 2582.19, z = 49.55 },
        ['Cell 8'] = { x = 1790.00, y = 2586.09, z = 49.55 },
        ['Cell 9'] = { x = 1789.73, y = 2590.07, z = 49.55 },
        ['Cell 10'] = { x = 1789.93, y = 2594.00, z = 49.55 },
        ['Cell 11'] = { x = 1789.92, y = 2597.65, z = 49.55 },
        ['Cell 12'] = { x = 1785.60, y = 2602.10, z = 49.55 },
    },
}

Download

6 Likes

Love To See It!

Fantastic! Any way to turn off ACE perms and make it available for everyone to use?

Interesting a cool concept, Although could this possibly be written to use the police job function?

SCRIPT ERROR: @Badger_Jailing_main/server.lua:6: bad argument #1 to ā€˜decodeā€™ (string expected, got nil)

I have this Error, can you help me ?

If someone wants to code it in and fork it. I wonā€™t be.

I might do it later today

3 Likes

Great work on this script @OfficialBadger!!

Could you please notify me when you have done this? @Striikez101
I appreciate you taking your time to help the ones of us who donā€™t know how to do it :stuck_out_tongue:

well, what Iā€™d do is using this together with his DiscordAcePerms, then create a group for police officers, add the ace perms for the command to that group, and assign it to people who has the role on discordā€¦but again, thatā€™s what I would do.

2 Likes

Where can we get the interior in the showcase?

No idea lol

You can use builtin.everyone for an ace group that allows everyone to use it.

Hello, could someone give an example of how to give permission to someone? I canā€™t quite understand how to do it

1 Like

So Iā€™m wanting to modify this to use for our hospital system and until I can go around and get coords for a bunch of diff hospital rooms around the map, will this work if I just use the same coords for each ā€œcellā€?

Yes it potentially should. I donā€™t see why not

So, the coords already set in the config. Are they for that interior you use? I hope so :wink:

Ye, the interior in the gif I believe

This is an amazing script is there any way to stop the script from teleporting me back to my cell every 5 seconds. If you donā€™t understand basically when i tested it i put my self in for 30 secs and every 5 secs in chat popped up you have 25 secs left, 20 secs left,15 secs left, etc. And everytime it pops up in the chat it teleports me back into my cell

To you guys wondering too go to client and find 34. line (if mod(jailTime, 5) == 0 and jailTime ~= 0 then)
then change it to if mod(jailTime, 0) == 0 and jailTime ~= 0 then

For some reason when we are jailing people they do not go to a cell even though we made sure the cellā€™s have the right coordinates.

Instead, they go to the central location inside the prison every time. Any fix for this?