This repository was archived by the owner on Mar 20, 2025. It is now read-only.
forked from steven4547466/NWAPIBulletHoleVisualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisualizerCommand.cs
More file actions
82 lines (74 loc) · 2.72 KB
/
Copy pathVisualizerCommand.cs
File metadata and controls
82 lines (74 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using CommandSystem;
using PluginAPI.Core;
using RemoteAdmin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NWAPIBulletHoleVisualizer
{
[CommandHandler(typeof(RemoteAdminCommandHandler))]
public class VisualizerCommand : ICommand
{
public string Command { get; } = "bulletvisualizer";
public string[] Aliases { get; } = new string[] { "bv" };
public string Description { get; } = "Enable/disable bullet hole visualizer.";
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
if (!(sender is PlayerCommandSender plrSender))
{
response = "Not a player";
return false;
}
//Player player = Player.Get(plrSender.ReferenceHub);
if (Utils.IsVisualizing(plrSender.ReferenceHub))
{
Utils.StopVisualizing(plrSender.ReferenceHub);
response = "No longer visualizing";
return true;
}
else
{
Utils.StartVisualizing(plrSender.ReferenceHub, true);
response = "Now visualizing";
string searching = null;
if (arguments.Count > 0)
{
searching = string.Join(" ", arguments);
response = $"Now visualizing, with filter: '{searching}'";
}
Utils.StartVisualizing(plrSender.ReferenceHub, true, searching);
return true;
}
}
}
//[CommandHandler(typeof(GameConsoleCommandHandler))]
//public class VisualizerCommandGameConsole : ICommand
//{
// public string Command { get; } = "bulletvisualizer";
// public string[] Aliases { get; } = new string[] { "bv" };
// public string Description { get; } = "Enable/disable bullet hole visualizer.";
// public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
// {
// if (!(sender is PlayerCommandSender plrSender))
// {
// response = "Not a player";
// return false;
// }
// Player player = Player.Get(plrSender.ReferenceHub);
// if (Utils.IsVisualizing(player))
// {
// Utils.StopVisualizing(player);
// response = "No longer visualizing";
// return true;
// }
// else
// {
// Utils.StartVisualizing(player, false);
// response = "Now visualizing";
// return true;
// }
// }
//}
}