From ae45a57781aed7514b9eb0910f0c24cf232d043e Mon Sep 17 00:00:00 2001 From: Jens Pitkanen Date: Sat, 8 Aug 2020 02:14:23 +0300 Subject: [PATCH] Add tp command --- Assets/Scripts/Players/LocalPlayer.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Assets/Scripts/Players/LocalPlayer.cs b/Assets/Scripts/Players/LocalPlayer.cs index d6cf360..2404bde 100644 --- a/Assets/Scripts/Players/LocalPlayer.cs +++ b/Assets/Scripts/Players/LocalPlayer.cs @@ -1,5 +1,6 @@ using UnityEngine; using UnityEngine.InputSystem; +using NeonTea.Quakeball.Interface; using NeonTea.Quakeball.Networking; using NeonTea.Quakeball.Networking.Packets; @@ -44,6 +45,14 @@ namespace NeonTea.Quakeball.Players { .With("Down", "/s") .With("Left", "/a") .With("Right", "/d"); + + Terminal.Singleton.RegisterCommand("tp", args => { + if (args.Length != 3) { + return false; + } + transform.position = new Vector3(float.Parse(args[0]), float.Parse(args[1]), float.Parse(args[2])); + return true; + }, "tp x y z - Teleports the local player to the specified coordinates."); } private void Update() {