Add tp command

This commit is contained in:
Jens Pitkänen 2020-08-08 02:14:23 +03:00
parent 5feda5b8c2
commit ae45a57781
1 changed files with 9 additions and 0 deletions

View File

@ -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", "<Keyboard>/s")
.With("Left", "<Keyboard>/a")
.With("Right", "<Keyboard>/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() {