Ulysses
General => Developers Corner => Topic started by: Charlie Irwin 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 (https://steamcommunity.com/sharedfiles/filedetails/?id=1363982997)
-
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.
-
Thanks,
I am not the best with LUA so where do I start with making a command?
-
where do I start with making a command?
We've pretty much spoon fed the answer.
JailTP code can be seen here (https://github.com/TeamUlysses/ulx/blob/4c910961728c569e9690a5b4c8cbc9be46c041ad/lua/ulx/modules/sh/fun.lua#L427).
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.