Author Topic: Custom Jail  (Read 2938 times)

0 Members and 1 Guest are viewing this topic.

Offline Charlie Irwin

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Custom Jail
« on: April 17, 2018, 12:48:59 PM »
Hey ,

I am wondering how I could make a command so when I jail someone it brings them to a certain area. I know !jailtp but that is not what I am talking about.

I want it so I can have a jail system where it automatically teleports them to the admin room on the bottom of my map because in rp_downtown_altered you get an admin room but I want that to be the place users go to when I jail them

Picture: https://steamcommunity.com/sharedfiles/filedetails/?id=1363982997

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Custom Jail
« Reply #1 on: April 17, 2018, 02:44:15 PM »
Take a look at jailtp.

Then rather than teleporting them to where you are, teleport them to a set coordinate.

I'd make this into a new command though since we don't recommend overwriting base code.

Offline Charlie Irwin

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Custom Jail
« Reply #2 on: April 18, 2018, 06:20:48 AM »
Thanks,

I am not the best with LUA so where do I start with making a command?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Custom Jail
« Reply #3 on: April 18, 2018, 05:53:02 PM »
where do I start with making a command?
We've pretty much spoon fed the answer.
JailTP code can be seen here.

Your challenges;
- Learning how to find out the co-ordinates of the place you want the person to go and plugging them into your own jailadmin command.
- Changing the function name, help and command name text.
- If the room isn't big enough for it's own jail, figuring out how to edit the example code to not A) Check space clearance for the walls - B) Not put up walls
- Learning how to create your own modules files, so it won't be stored with ours (hint, on server, this should work) - gmod/addons/My_ULX/lua/ulx/modules/sh/myULXcode.lua
- There will be more as you go, but those are the main ones to start wtih.
« Last Edit: April 18, 2018, 05:54:37 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming