[Release][FX] Jailer 1.1.0.0


#1

This is my simple jailer resource I whipped up a long time ago as a little project to help myself learn LUA.

I’ve updated it a little so it works with FXServer. It’s standalone and works with a configurable password (default pswd).

Imporant information quoted from the ReadMe you likely wouldn’t have read :stuck_out_tongue::

Commands to type in chat (T):
/jailme SECS - Jails yourself, if SECS not given defaults to 180.
/unjail PSWD PLAYERID - Unjails the player with PLAYERID (hold up arrow ingame to see) if PSWD matches specified jail password.
/jail PSWD PLAYERID SECS - Jails the player with PLAYERID (hold up arrow ingame to see) if PSWD matches specified jail password. If SECS not given, defaults to 180.

Changelog:

1.1.0.0:
Made the default jail time easily customisable in serverJailer.lua.
Made the maximum jail time easily customisable in serverJailer.lua

Enjoy.
Jailer.zip (2.4 KB)


[Release] ESX Database Jail Script - With pNotify. No more Combat Logging!
Jail Help
[Help] Looking For A Command
Need of an jailing system! non vrp! also our unwhitelisted jobs doesnt work
I need that script Ped restricted!
[Release] esx_jailer
FiveM Jail Scrip / Jail Mod (HELP!)
#2

Wow great job! Is compatible with vrp?


#3

As mentioned it is standalone by default, but there is nothing stopping you from changing the command registration in serverJailer.lua slightly so it works with your desired base resource.


#4

OK thank you very much. When a prisoner disengages, he stays in jail when he reconnects?


#5

It doesn’t. If this is something you would like to add, you’d ideally have a database. You could add a column to your users table and alter the table when a user gets put into jail and released.

The implementation is dependent on which base resource/server setup you use.


#6

Can You help me please? I’m use vrp fx server! Congraturations for your wonderful scripts for LSPDFR :smiley:


#7

I made this last minute almost a gaurantee this won’t work (this is JUST TO GIVE AN IDEA as to what you should put in/add in for async, ect.
serverJailer.lua

RegisterServerEvent('jailer:save')
AddEventHandler('jailer:save', function(jail)

	local identifier = GetPlayerPed(-1)

	MySQL.Async.execute(
		'UPDATE users SET `jail` = @jail WHERE identifier = @identifier',
		{
			['@jail']       = jT,
			['@identifier'] = identifier
		}
	)

end)

add ^that under the ---------------------------------
clientJailer.lua

local jail = nil

	TriggerEvent('jailer:save', function(jail)
		jail = jT
	end)

SQL:

CREATE TABLE IF NOT EXISTS `users` (
	`jail` VARCHAR(255) NULL DEFAULT '0' COLLATE 'utf8mb4_bin'
)
COLLATE='utf8mb4_bin'
ENGINE=InnoDB
;

I didn’t have enough time to check if player has jT, but add something like this (this shouldn’t work, this is just an example as to what it SHOULD be LIKE)

local Offline = IsPlayerOnline(false) 
local Online = IsPlayerOnline(true)
   if jT > 10 
   if IsPlayerOnline(true) then
                      (code to fetch data)
					TriggerClientEvent("JP", tPID, jT)
          end
end)

I will fix when I get back on and have the time :wink:


#8

@albo1125 Nice! I had a friend help me port this over. It was a bitch and a half


#9

Tested with vRP just now. Perfect!

Thank you so much!


#11

Yes work on vRP but have you idea to save in database if the player jailed when disconnect?


#12

Thanks for the release!


#13

Great resource !!

Is it set to work for law enforcement only?


#14

Nice and greate share :slight_smile: But, there are one problem in your script.
Why you have “if D > 90 then” and “if D > 100 then” ?
“if D > 100 then” is never possible because at 90 we are teleported back to the jail


#15

It is possible, this is to differentiate between an innocent “stray walking” and trying to use a trainer to teleport out of jail (in which case more jail time is added).


#16

@albo1125 1 question here, why when i set the jail to more than 1000secs it won’t works. Only 1000secs work
ps:Sorry for my bad english :frowning:


#17

@albo1125 Hmm… ok :smiley: I have edited for add time everytime personnaly ^^
@weiseang0855 ServerJailer.lua -> Edit “jT > 1000” and “jT = 1000”


#18

Updated the download to 1.1.0.0:

1.1.0.0:
Made the default jail time easily customisable in serverJailer.lua.
Made the maximum jail time easily customisable in serverJailer.lua


#20

You’re likely entering the wrong password. Please read the main post or the readme to find out how you can customise the password to your liking and to see what the default password is.


#21

I got it working. I was using the userlist ID instead of playerlist. Thank you for this script works amazing!


#22

do we need to replace any chat like with the one i shut down yesterday cuz you didnt make it public cause i wouldn’t like to make changes to chat if so