[Release] Simple Jail System

I’ve seen lots of people asking for jail system, but unfortunately, there is still none released.

It feels incomplete when you have a Police RP server but don’t know where to send them after you cuffed them, even tho you sent them to jail, they still escaped, therefore, I created this simple jail system for my server, kept them for weeks and still waiting for a better Jail system script to come out, bu still, days after days, there’s still none, so I’ve decided to contribute and release my script, even tho it sucks and looks stupid, hopefully it would be a temporary solution for those people who are still waiting for the Jail System.

How to use it?
it’s a script base under essential mode, so first simply add a column name “detained” under “users” Table, and simply write a script that can set the player value of “detained” to 1, then when they die, they go to jail, if they try to escape then they will be sent back to jail and gained 4 wanted level.

Current Jail locations are under the police department at los santo city, they’re all changeable, sorry for my english if you find it hard to read since English is not my first language, lol, my apology.

Link

1 Like

Hey bmage, i really appreciate what you have done for the community, but the download link says access denied, not sure if its a problem on your end or mine.
Thanks
Kind Regards Poptart

1 Like

Sorry, link updated :smiley:

1 Like

Would appreciate if you could make it /jail player id jail time

Thanks for updating!

Appreciate you for sharing this with the community!

Anyone that is willing to share how to write the script to detain set value to 1 please share for the people like me that don’t know how to do that.

Thank you again

How do i install this onto my sever

@bmage2win

Just curious, if you are going to share with the community your jail script,would you mind sharing your script that sets the player value detained to ‘1’? We would greatly be appreciative.

yes taht would help and i am a dumbass so i dont know how to install this

Anyone find a way to implement this? Anyone have a min to show how to add this to db
Thanks

We have the script installed and streaming but how do we use it to jail someone in game?

PLEASE!!! anyone… is there any way you could help me with this?
Ive added the column “detained” under “users” table using VARCHAR datatype.
But now im stuck regarding (simply wright a script that can set the player value of detained to 1).
All i can come up with is:

TriggerEvent(‘es:addAdminCommand’, ‘jail’, 5, function(source, args, user)
– Has permission
end, function(source, args, user)
– Doesn’t have permission
end)

328 downloads and no one has this working yet??

If anyone is looking to help script a jail system i have a basic script started here:

??? please basse DB please name detained ok type ??? taille ??? valeur ???

Good day,

@bmage2win thank you for your post!

I have attempted to script a simple argument for the sv_admin.lua that would change the “detained” column (value) of the user table within essentialmode/MySQL database to 1. However, it appears that i must be missing something - thus, i am posting this in hopes that someone with script knowledge can help point me in the right direction.

if commandName == ‘detain’ then
if #args ~= 2 then
RconPrint(“Usage: detained [user-id] [1=jailed, 0=free]\n”)
CancelEvent()
return
end

     if(GetPlayerName(tonumber(args[1])) == nil)then
  	RconPrint("Player not ingame\n")
  	CancelEvent()
  	return
     end
     TriggerEvent("es:setPlayerData", tonumber(args[1]), "detained", tonumber(args[2]), function(response, success)
      end)
  CancelEvent()

Thanks in advance for anyone willing to help out!

it doesn’t work. will you fix this ?

I came across this on pastebin .

It is working, but I would replace the * with / if you like in the command line.

Enjoy

Is this your script ?

yes simple search in pastebin will reveal alot of stuff. Thats how I found it.