ID:1877596
 
(See the best response by Kaiochao.)
Code:
mob/proc/SpaceTime()
if(src.intank|src.Kaiten|src.sphere|src.inso|src.firing|src.Rasenganon)
return
else
src << "You will take ten seconds to go into, or out of, your Dimension; if you are put below your current health, it will be cancelled, or if you are below 10% health."
src.oldhealth=src.health
src.overlays+='Icons/Jutsus/spacetime.dmi'
sleep(150)
if(src.spacetime==0)
src.prevx=src.x
src.prevy=src.y
src.prevz=src.z
if(src.oldhealth<=src.health)
if(src.health<=src.health/10)
if(!src.spacetime)
src.loc = locate(179,92,1)
src.overlays-='Icons/Jutsus/spacetime.dmi'
src.spacetime=1
else
src.x=src.prevx
src.y=src.prevy
src.z=src.prevz
src.overlays-='Icons/Jutsus/spacetime.dmi'
src.spacetime=0
else
src.overlays-='Icons/Jutsus/spacetime.dmi'
src << "You have failed going into, or out of, your dimension for whatever reason."
return


Problem description:

Firstly, I'd like to be able to do something similar, but create a different proc that allows you to: pick someone nearby, send them into the "dimension" (179,92,1), save their current co-ords, then be able to send them back.

Secondly, I'm wondering if that bit of code looks off, or if it would work (specifically the 14th line)

Best response
All of the | should be || in your first if(). More efficient.
Your if(spacetime == 0) should be if(!spacetime). Too specific.
All of your src. are unnecessary... but that's your choice.
About line 14: (X <= X/10) is only true if X == 0, so it's probably not what you want.

It'd be easier to store the loc instead of the coordinates:
mob
var tmp/turf/previous_loc
var doing_thing = FALSE

verb/do_thing()
var global/turf/special_place = locate(179, 92, 1)

if(!doing_thing)
doing_thing = TRUE
previous_loc = loc
loc = special_place

else
doing_thing = FALSE
loc = previous_loc


Now, to send someone else instead of yourself, it's a bit tricky. Which person should remember where to return the target: the sender or the target? If the sender disappears (dies or logs out or whatever) after sending the target to the other dimension, does the target stay behind (maybe stranded)?
In response to Kaiochao
Firstly, the target should remember where they last were (So when they are sent out, they are brought back). Secondly, if the sender logs out, the character will still be in the dimension (unless the sender is logging out on purpose to keep them there forever), but if the sender dies, the person gets sent out (which should be a simple part).
The previous_loc is the location where they were at last in Kaio's code.

mob
var tmp/turf/previous_loc
var doing_thing = FALSE

verb/do_thing()
var global/turf/special_place = locate(179, 92, 1)

if(!doing_thing)
doing_thing = TRUE
previous_loc = loc // save the last location they were at.
loc = special_place

else
doing_thing = FALSE
loc = previous_loc //go back to that location


If a player logs out in the the "special_place".
mob
Logout() //there are ways around this method
loc = previous_loc
..()


He gave you an example of improving your code. He isn't going to make the whole thing for you.