How to teleport a player to a coordinate?

I am using the AdminMenu plugin to save teleport commands to one of 6 jail cells that I will have my police officers being able to use to send criminals to jail but the command isnt working to send player to saved location or coordinate.

I thought my config will work to do this but it doesnt. I will show the error it gives after this:

{
"Name": "Jail Cell 1",
"Command": "/tp {target1_name} -96.60 53.23 82.89",
"Description": "Send player to jail cell 1",
"CloseOnRun": false,
"RequiredPermission": ""
},

ERROR:  You cant teleport a player to yourself!

and I also tried like this after doing /tpsave JailCell1 in a location and I also tried this without the {target1_name} and also does not work:

{
"Name": "Jail Cell 1",
"Command": "/tp {target1_name} JailCell1",
"Description": "Send player to jail cell 1",
"CloseOnRun": false,
"RequiredPermission": ""
},
I dont understand why it thinks I am trying to teleport a player to myself? I'm trying to teleport myself to those coordinates that are specified. There is no other player specified other than me.
The help file says:  "/tp x y z 'teleports you to a saved location' but thats what I typed in, I believe.

Any assistance is appreciated, thanks!

I think you need to change

if (permission.UserHasPermission(player.UserIDString, PermDisallowTpToMe))

to

if (permission.UserHasPermission(target.UserIDString, PermDisallowTpToMe) && target != player)

on line 3281 and again on line 3312 in NTeleportation.cs file

nivex

I think you need to change

if (permission.UserHasPermission(player.UserIDString, PermDisallowTpToMe))

to

if (permission.UserHasPermission(target.UserIDString, PermDisallowTpToMe) && target != player)

on line 3281 and again on line 3312 in NTeleportation.cs file

Thanks for the reponse! I will give this a try. Im looking in my .cs file right now and the first instance on line 3281 was there and I can replace that, but there is nothing for me on 3312. 

But here is this exact code on 3164, so I dont know if thats the same thing or if I should leave that one?  It only found those two instances, but the second one is not on the same line as you mentioned.

you need to update. thats why its on a different line

nivex

you need to update. thats why its on a different line

Okay thanks. I have updated and changed the two lines with what you gave, and now when I try to TP to the saved location it just tells me that I entered the tpl command but does not do it, and no longer returns the error about how I cant teleport to myself.

The command im using through AdminMenu is:   "/tpl {target1_name} JailCell1"   and then I select my name in the AdminMenu.  I also tried with {target2_name} to see if maybe the target2 would change anything.

When I type /tpl, I see:
The following locations are available:
JailCell1 (x,y,z)
JailCell2...
3, 4, 5, 6

So it appears everything should be working. What I just now noticed while writing this, is there may not be functionality to teleport other player to a saved location.  When I try to just type manually   "/tpl DrummerJacob JailCell1" it says A Syntax Error Occurred!

And then it onloy gives 2 options.   /tpl to see a list, and /tpl locationname to teleport only me to a location, but not one for other players.

Can you confirm, does this even have the functionality to teleport other player to a saved location called a jailcell? If so, maybe I need to change the way im using the command.  Can you suggest best way to setup teleport save location to act like 6 different jail cells I can send players to? 

Thanks again!

I looked, and tpl doesn't work that way. it's specifically for the person typing the command as locations are saved per player rather than in the config like towns

you need to use tp with coordinates. i've tried /tp nivex -96.60 53.23 82.89 which works

/tp {target1_id} -96.60 53.23 82.89 where {target1_id} should be used over {target1_name} so there's no conflict with players sharing the same name variations

I implemented the below functionality if you want to try:

/tp {target1_id} JailCell1

this will loop through every data entry and find whoever saved JailCell1 and then teleport {target1_id} to that. players should not be given nteleportation.tpl or nteleportation.tpsave as those are meant for admin/mods. players can use /sethome to create their own save points

I changed /tp so that it can be used from the server console, too. I'm too busy to thoroughly test this but it appears to work

https://pastebin.com/et9D3UKb

Save as NTeleportation.cs

nivex

I looked, and tpl doesn't work that way. it's specifically for the person typing the command as locations are saved per player rather than in the config like towns

you need to use tp with coordinates. i've tried /tp nivex -96.60 53.23 82.89 which works

/tp {target1_id} -96.60 53.23 82.89 where {target1_id} should be used over {target1_name} so there's no conflict with players sharing the same name variations

I implemented the below functionality if you want to try:

/tp {target1_id} JailCell1

this will loop through every data entry and find whoever saved JailCell1 and then teleport {target1_id} to that. players should not be given nteleportation.tpl or nteleportation.tpsave as those are meant for admin/mods. players can use /sethome to create their own save points

I changed /tp so that it can be used from the server console, too. I'm too busy to thoroughly test this but it appears to work

https://pastebin.com/et9D3UKb

Save as NTeleportation.cs

Thank you so much! That was very kind of you to put in some more work on this. :)  Im also super busy about to release a server tomorrow after 2 months of almost full time work, but if I dont reply to this again by tomorrow you can assume it worked just fine. I just had not quite fully understood how exactly this plugin works because I am not familiar enough to read through code and understand too much.  Cheers!

no problem