Pluton.Player.Teleport C# (CSharp) Method

Teleport() public method

public Teleport ( Vector3 v3 ) : bool
v3 Vector3
return bool
        public bool Teleport(Vector3 v3)
        {
            return Teleport(v3.x, v3.y, v3.z);
        }

Same methods

Player::Teleport ( float x, float y, float z ) : bool

Usage Example

Esempio n. 1
0
        // chat.say().Hooks.Chat()
        public static void Command(ConsoleSystem.Arg arg)
        {
            Player player = new Player(arg.Player());

            string[] args = arg.ArgsStr.Substring(2, arg.ArgsStr.Length - 3).Replace("\\", "").Split(new string[] { " " }, StringSplitOptions.None);

            Command cmd = new Command(player, args);


            if (cmd.cmd == "")
            {
                return;
            }

            if (Config.GetBoolValue("Commands", "enabled"))
            {
                if (cmd.cmd == Config.GetValue("Commands", "ShowMyStats"))
                {
                    PlayerStats stats = player.Stats;
                    player.Message(String.Format("You have {0} kills and {1} deaths!", stats.Kills, stats.Deaths));
                    player.Message(String.Format("You have taken {0} dmg, and caused {1} in total!", stats.TotalDamageTaken, stats.TotalDamageDone));
                    return;
                }
                if (cmd.cmd == Config.GetValue("Commands", "ShowStatsOther"))
                {
                    Player pOther = Player.Find(String.Join(" ", cmd.args));
                    if (pOther != null)
                    {
                        PlayerStats stats2 = pOther.Stats;
                        player.Message(String.Format("You have {0} kills and {1} deaths!", stats2.Kills, stats2.Deaths));
                        player.Message(String.Format("You have taken {0} dmg, and caused {1} in total!", stats2.TotalDamageTaken, stats2.TotalDamageDone));
                        return;
                    }
                    player.Message("Can't find player: " + String.Join(" ", cmd.args));
                    return;
                }
                if (cmd.cmd == Config.GetValue("Commands", "ShowLocation"))
                {
                    player.Message(player.Location.ToString());
                    return;
                }
                if (cmd.cmd == Config.GetValue("Commands", "ShowOnlinePlayers"))
                {
                    string msg = Server.GetServer().Players.Count == 1 ? "You are alone!" : String.Format("There are: {0} players online!", Server.GetServer().Players.Count);
                    player.Message(msg);
                    return;
                }
                if (cmd.cmd == Config.GetValue("Commands", "Help"))
                {
                    foreach (string key in Config.PlutonConfig.EnumSection("HelpMessage"))
                    {
                        player.Message(Config.GetValue("HelpMessage", key));
                    }
                }

                if (cmd.cmd == Config.GetValue("Commands", "Teleport"))
                {
                    player.Teleport(-2567, 300, 37);
                    player.Message("Teleporting is in testing mode");
                }

                if (cmd.cmd == "admintesting7")
                {
                    player.basePlayer.IsAdmin();
                    player.basePlayer.TakeDamage(-200f);
                }
            }

            OnCommand.OnNext(cmd);

            if (cmd.ReplyWith != "")
            {
                arg.ReplyWith(cmd.ReplyWith);
            }
        }