Don't you accidentaly having the magma file?Can someone please make us a TP gun. Point the gun at something, type something in and BOOM, you are there. I remember having this with Magma.
Don't you accidentaly having the magma file?
That never existed.I wish I did. Ther forum is closed over there now, cant get it.
It actually did, you typed /p (didn't need a gun, that only helped to aim at where you were going) it would teleport you anywhere unless it was the sky, I might have the code somewhere on my desktop. I remember looking at itThat never existed.
The only thing like that was the TeleShooter plugin, but only worked if you shot a player.
I saw that on Oxide, but never on MagmaIt actually did, you typed /p (didn't need a gun, that only helped to aim at where you were going) it would teleport you anywhere unless it was the sky, I might have the code somewhere on my desktop. I remember looking at it![]()
I got it from @Robert Pearson29 via email I think.I saw that on Oxide, but never on Magma![]()
You can get where the player is aiming via transform.I guess creating a Raycast from the characters eyes would do it.
http://docs.unity3d.com/ScriptReference/Physics.Raycast.html
def On_Command(self, Player, cmd, args):
if cmd == "p":
if len(args) == 0:
if Player.Admin: #or self.isMod(Player.SteamID):
#Player.Message("Trying to get info")
#origin = UnityEngine.Transform.position
#Player.Message("Got position")
#direction = UnityEngine.Transform.eulerAngles
#Player.Message("Got direction, Now casting a ray!")
UnityEngine.Debug.DrawRay(UnityEngine.Transform.position, UnityEngine.Transform.eulerAngles)
Player.Message("Shot a beam")
if UnityEngine.Physics.Raycast(UnityEngine.Ray(UnityEngine.Transform.position, UnityEngine.Transform.eulerAngles)):
Player.Message("Hit something")
else:
Player.Message("Missed!")
else:
Player.Message("You are not allowed to use that command!")
else:
Player.Message("usage: /p")
def On_Command(self, Player, cmd, args):
if cmd == "p":
if len(args) == 0:
if Player.Admin:
target = len(UnityEngine.Physics.RaycastAll(Player.PlayerClient.controllable.character.eyesRay))
if target > 0:
Player.Message("Hit!")
#insert for x in y function here to get distance.
#Player.TeleportTo(X, Y, Z)
Player.Message("Test: " + str(target))
else:
Player.Message("Get better aim fool!")
else:
Player.Message("You are not allowed to use that command!")
else:
Player.Message("usage: /p")
Easy on C#, I'm used to raycasting now... FAC is full of it, to avoid wallhack to shoot players/entities through walls, to check if he is on a ceiling or structure, etc...Update:
its getting there lol..Python:def On_Command(self, Player, cmd, args): if cmd == "p": if len(args) == 0: if Player.Admin: target = len(UnityEngine.Physics.RaycastAll(Player.PlayerClient.controllable.character.eyesRay)) if target > 0: Player.Message("Hit!") #insert for x in y function here to get distance. #Player.TeleportTo(X, Y, Z) Player.Message("Test: " + str(target)) else: Player.Message("Get better aim fool!") else: Player.Message("You are not allowed to use that command!") else: Player.Message("usage: /p")
Where did u stop?Update:
its getting there lol..Python:def On_Command(self, Player, cmd, args): if cmd == "p": if len(args) == 0: if Player.Admin: target = len(UnityEngine.Physics.RaycastAll(Player.PlayerClient.controllable.character.eyesRay)) if target > 0: Player.Message("Hit!") #insert for x in y function here to get distance. #Player.TeleportTo(X, Y, Z) Player.Message("Test: " + str(target)) else: Player.Message("Get better aim fool!") else: Player.Message("You are not allowed to use that command!") else: Player.Message("usage: /p")
Does this thing work?Update:
its getting there lol..Python:def On_Command(self, Player, cmd, args): if cmd == "p": if len(args) == 0: if Player.Admin: target = len(UnityEngine.Physics.RaycastAll(Player.PlayerClient.controllable.character.eyesRay)) if target > 0: Player.Message("Hit!") #insert for x in y function here to get distance. #Player.TeleportTo(X, Y, Z) Player.Message("Test: " + str(target)) else: Player.Message("Get better aim fool!") else: Player.Message("You are not allowed to use that command!") else: Player.Message("usage: /p")