This script allows x staff groups that are able to forcefully jail a player and locking them into a closed area, to where they can’t move depending on how much time you’ve jailed that individual for. This script is useful for semi/serious RP servers, to send those who’s character died into Admin Jail, to where they are no longer able to use that character anymore and or servers who just want to put an individual on “timeout”. The time jailed is saved in the database & will not go down unless the designated player is connected into the server & on that character.
Configurable groups to have access to the commands.
Configurable text (language).
Configurable admin-jail location.
Configurable admin-jail release location.
Configurable admin-jail list command - shows all the players currently admin-jailed/cked.
Discord webhook logging (track who jails/releases & updates time).
./adminjail (playerID, reason, time) - jail a player for x time.
./adminjailtime - see the current time you have left.
./adminjailrelease (playerID) - release a player from admin-jail.
./adminjaillist - shows all the players currently admin-jailed/cked.
./ck (playerID) - locks the players character slot that they are currently on.
./enablechar char#:license - to reactivate the characters license.
This resource is drag/drop if ESX, aside from configuring the config to your needs. IF you're on QB framework, remove the es_extended line from the fxmanifest & also change your settings inside Config.lua. RUN the SQL, then you will just need to add the following inside of your server.cfg, restart your server & you're good to go.
ensure adminplus-adminjail
Feel free to check the config.lua & customize what jobs have access, the job grade, the pricing & also the cooldown.
-- ███████████████████████████████████████████████████████████████████████████ --
Config = {}
Config.Framework = 1 -- (ESX == 1), (QB == 2)
Config.FrameworkExport = 'es_extended' -- (ESX == 'es_extended'), (QB == 'qb-core')
Config.ReleaseLocation = vector3(187.1704, -919.8855, 29.8055-1) -- Replace x, y, z with the default release coordinates
-- Edit controls of what players can do in client/main.lua
Config.AdminJailCommand = 'adminjail'
Config.AdminJailCommandRelease = 'adminjailrelease'
Config.AdminJailTime = 'adminjailtime'
Config.AdminJailList = 'adminjaillist'
-- this is the distance from how far before they get tped back to the jail location.
Config.DistanceCheck = 20.0
Config.DistanceMessage = 'You were teleported back to admin-jail for trying to get away.'
Config.DisabledControls = {24, 257, 25, 263, 45, 22, 44, 37, 23, 288, 289, 170, 167, 73, 59, 71, 72, 36, 47, 264, 257, 140, 141, 142, 143, 75} -- 245 for T keybind (chat)
--
Config.EnableCKCommand2 = false
Config.CKCommand2 = 'ck'
Config.EnableUNCKCommand2 = false
Config.UNCKCommand2 = 'unck'
Config.EnableCKAnnounceChat2 = false
--
-- Chat Messages IF ENABLED. -- (mainly for changing the RGBA colors & modifications -- don't touch if you don't know what you're doing)
Config.Admin_Jail_Updated = '<div style="color: rgba(255, 99, 71, 1); width: fit-content; max-width: 125%; word-break: break-word; "> {0} </div>'
Config.Admin_Jail_Sent = '<div style="color: rgba(255, 99, 71, 1); width: fit-content; max-width: 125%; word-break: break-word; "> {0} </div>'
Config.CK_Announce_Chat = '<div style="width: fit-content; max-width: 125%; word-break: break-word; "><span style="color: rgba(255, 99, 71, 1);">{0}</span> <span style="color: rgba(255, 255, 255, 1);">{1}</span></div>'
--
Config.AcePerm = false -- check readme
Config.AdminGroups = {
'god',
'admin',
'mod',
'superadmin',
'tester',
'developer',
'management',
'owner'
}
-- to run /ck & /adminjail -- (don't have access to /unck & /adminjailrelease to avoid abuse from the job)
Config.Jobs = {
{ name = 'police', grade = 6 },
{ name = 'ambulance', grade = 6 },
}
Config.JailLocation = {
x = 3557.8950, -- Insert X coordinate of the admin jail location
y = 3659.7058, -- Insert Y coordinate of the admin jail location
z = 28.1219-1 -- Insert Z coordinate of the admin jail location
}
Config.EnableWebhook = false -- (if true add webhook to server side) adminplus-adminjail/server/webhooks.lua
Config.Strings = {
adminjail = 'send an individual to Admin Jail',
adminjailrelease = 'release an individual from Admin Jail',
adminjailchecktime = 'check the time of a person in Admin Jail',
adminjailtimecommand = 'Check remaining jail time',
--
-- playerID = 'player ID',
-- reason = 'reason',
insufficientpermissions = 'insufficient permission to use this command',
invalid_player_id = 'invalid Player ID',
invalid_reason = 'invalid reason',
invalid_time = 'invalid time',
player_not_found = 'player not found',
usage_admin_release = 'Usage: /adminjailrelease [playerId]',
usage_admin_jail = 'Usage: /adminjail [playerId] [reason] [time]',
usage_admin_ck = 'Usage: /ck [playerId]',
admin_jail_fail_remove = 'Failed to remove Admin Jail record from the database',
admin_jail_fail_insert = 'Failed to insert admin jail record into the database',
admin_jail_fail_update = 'Failed to update admin jail record in the database',
admin_jail_released = 'You have been released from Admin Jail!',
admin_jail_sent = 'You have been sent to Admin Jail!',
time = ' \nTime: ',
admin_jail_updated = 'Your Admin Jail time has been updated! \nTime Updated: ',
remaining_jail_time = 'Your remaining jail time:',
remaining_jail_time_other = 'remaining jail time:',
minutes = ' minute(s) ',
seconds = ' seconds',
player = ' player ',
reason = ' \nReason: ',
staff = ' \nStaff: ',
active_admin_jail = 'You have an active Admin Jail sentence.',
no_active_admin_jail = 'You do not have an active jail sentence.',
no_active_admin_jail_other = 'does not have an active jail sentence.',
chat_message_sent_to_jail = '%s has sent %s to Admin Jail for %s minute(s). Reason: %s',
chat_message_has_updated = '%s has updated %s Admin Jail time to %s minute(s). Reason: %s',
--
ck = 'send an individiual to be CKed',
ckrelease = 'release an individual from being CKed',
usage_ck_admin_jail = 'Usage: /ck [playerId]',
chat_ck_message_sent_to_jail = '%s has has been sent to the morgue. Reason: %s',
chat_ck_message_has_updated = '%s has updated %s Admin Jail time to %s minute(s). Reason: %s',
admin_ck_fail_update = 'User is already in the morgue.',
admin_ck_fail_remove = 'Failed to remove CK record from the database',
admin_ck_sent = 'You have been sent to the Morgue!',
admin_ck_fail_insert = 'Failed to insert CK record into the database',
usage_ck_release = 'Usage: /unck [playerId]',
admin_ck_released = 'You have been released from the Morgue!',
-- client side menu notifications
admin_menu_name = 'Admin Jail Features',
admin_menu_list = 'Admin Jail List ',
admin_menu_reason = 'Reason: ',
admin_menu_jail_time = '\nJail Time: ',
admin_menu_update_user_time = 'Update admin-jail time',
admin_menu_update_user_time_desc = 'Update the admin-jail time of this individual.',
admin_menu_update_input_user_time = 'Update admin-jail time for "',
admin_menu_update_input_user_time_desc = 'How many minutes do you want this character to be admin-jailed for? ',
admin_menu_remove_admin_jail_title = 'Remove admin-jail',
admin_menu_remove_admin_jail_desc = 'Remove the admin-jail of this individual.',
admin_menu_remove_ck_title = 'Un Character Kill',
admin_menu_remove_ck_desc = 'Remove the character kill of this individual.',
admin_menu_remove_copy_title = 'Copy Identifier',
admin_menu_remove_copy_desc = 'Copy character\'s identifier.',
admin_menu_remove_back_title = 'Back',
admin_menu_remove_back_desc = 'Go back to admin-jail history.',
admin_menu_clipboard = 'Copied identifier to clipboard \n',
-- server side menu notifications
admin_menu_remove_admin_jail = 'Character Admin-Jail removed from database: ',
admin_menu_remove_admin_jail_online = 'Character is in the city and was successfully removed from admin-jail.',
admin_menu_remove_admin_jail_offline = 'Character is not in the city but was successfully removed from admin-jail.',
admin_menu_fail_remove_license = 'Failed to remove license from database: ',
admin_menu_ck_remove = 'Character-Kill removed from database: ',
admin_menu_remove_ck_online = 'Character is in the city and was successfully un-cked.',
admin_menu_remove_ck_offline = 'Character is not in the city but was successfully un-cked.',
admin_menu_update_time = 'Updated admin jail time for: ',
admin_menu_fail_update_time = 'Failed to update admin jail time for: ',
}
-- ███████████████████████████████████████████████████████████████████████████ --
Fixed locales missing (reported in Discord Ticket)
Allowed editing to client/main.lua for controls to be modified (disable specific controls so users can't click specific controls/keys).
Added Job compatability (add what jobs have access to adminjail / adminjailrelease) (suggestion requested in Discord Ticket.
V 1.0.3
Fixed chat display not changing even when you changed it inside of the locales. (useful for other languages etc..)
Added Chat Suggestion when doing the commands.
V 1.0.4
Added /ck command - will lock the individuals character slot they are playing on.
V 1.0.5
Updated /ck for VMS_MULTICHARS (shouldn't show error anymore when /ck)
-- READ THE README & ADD THE FOLLOWING TO THE VMS_MULTICHARS Changeable command name & chat message. Option to turn both on/off.
V 1.0.6
Added a distance check HIGHLY RECOMMEND UPDATING so player gets teleported back if x distance from jail location.
V 1.1.6
Now supports QB Framework!
Moved Webhook to server-side to avoid server dumpers spamming your webhooks.