TP GUN Request

BIGWORM

New Member
Member
Jan 12, 2015
17
1
1
50
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.
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
That never existed.

The only thing like that was the TeleShooter plugin, but only worked if you shot a player.
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 it :p
 

Snake

Moderator
Moderator
Jul 13, 2014
288
174
28
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 it :p
I saw that on Oxide, but never on Magma o_O
 

h0wHigh

Retired Staff
Retired Staff
Aug 5, 2014
103
9
18
There was a plugin called TPMaster that had the Portal gun, but needs an update. But not sure if anyone has it.
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Decided to come back to this.
This would be pretty cool plugin to have butttttttt someone isn't to good with the whole RayCasting :oops:
Not even sure if im going in the right direction with the code below..
Python:
    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")
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Update:
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")
its getting there lol..
 

Snake

Moderator
Moderator
Jul 13, 2014
288
174
28
Update:
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")
its getting there lol..
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...
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Update:
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")
its getting there lol..
Where did u stop?
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Update:
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")
its getting there lol..
Does this thing work?
 

MasterPeace

Retired Staff
Retired Staff
Feb 2, 2015
269
69
28
45
Poland
Shouldn't you raycast from camera? I think Player Eyes != Camera View.

OH fock I forgot we are talking about server side. Sorry.