Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string[] OnCall(ICommandSender sender, string[] args)
- {
- if (!int.TryParse(args[0], out int playerid))
- {
- return new string[] { "\n<color=red><b>CRITICAL ERROR!</b> \nInvalid playerid:" + args[0] + "</color>" };
- }
- args.Add(" ");
- Player target = PluginManager.Manager.Server.GetPlayer(playerid);
- ReferenceHub targetRef = ReferenceHub.GetHub(target.PlayerId);
- GameObject gameObject;
- if (args.Length > 0)
- {
- if (args.Length > 4)
- {
- return new string[] { "\n<color=red><b>CRITICAL ERROR!</b> Invalid number of arguments.</color>" };
- }
- if (!float.TryParse(args[1], out float x))
- {
- Plugin.SpawnWorkbench(targetRef.gameObject.transform.position + (gameObject = targetRef.gameObject).GetComponent<Scp049_2PlayerScript>().plyCam.transform.forward * 2, gameObject.transform.rotation.eulerAngles, new Vector3(1, 1, 1));
- return new string[] { "\n<color=red>Invalid X size</color>:" + args[1] + ", using default value 1. \n<color=#00FF44>Successfully created workbench near " + target.Name + ", at " + target.GetPosition().ToString() + ", with sizes: <b>X = 1, Y = 1, Z = 1</b></color>" };
- }
- if (!float.TryParse(args[2], out float y))
- {
- Plugin.SpawnWorkbench(targetRef.gameObject.transform.position + (gameObject = targetRef.gameObject).GetComponent<Scp049_2PlayerScript>().plyCam.transform.forward * 2, gameObject.transform.rotation.eulerAngles, new Vector3(x, 1, 1));
- return new string[] { "\n<color=red>Invalid Y size</color>:" + args[2] + ", using default value 1.</color> \n<color=#00FF44>Successfully created workbench near " + target.Name + ", at " + target.GetPosition().ToString() + ", with sizes: <b>X = " + x + ", Y = 1, Z = 1</b></color>" };
- }
- if (!float.TryParse(args[3], out float z))
- {
- Plugin.SpawnWorkbench(targetRef.gameObject.transform.position + (gameObject = targetRef.gameObject).GetComponent<Scp049_2PlayerScript>().plyCam.transform.forward * 2, gameObject.transform.rotation.eulerAngles, new Vector3(x, y, 1));
- return new string[] { "\n</color>Invalid Z size</color>:" + args[3] + ", using default value 1. \n<color=#00FF44>Successfully created workbench near " + target.Name + ", at " + target.GetPosition().ToString() + ", with sizes: <b>X = " + x + ", Y = " + y + ", Z = 1</b></color>" };
- }
- Plugin.SpawnWorkbench(targetRef.gameObject.transform.position + (gameObject = targetRef.gameObject).GetComponent<Scp049_2PlayerScript>().plyCam.transform.forward * 2, gameObject.transform.rotation.eulerAngles, new Vector3(x, y, z));
- return new string[] { "\n<color=#00FF44>Successfully created workbench near " + target.Name + ", at " + target.GetPosition().ToString() + ", with sizes: <b>X = " + x + ", Y = " + y + ", Z = " + z + "</b></color>" };
- }
- return new string[] { GetUsage() };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement