forked from RocketModPlugins/WebsiteCommand
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRocketWebsiteCommand.cs
More file actions
40 lines (35 loc) · 1.11 KB
/
RocketWebsiteCommand.cs
File metadata and controls
40 lines (35 loc) · 1.11 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
using System;
using Rocket.API.Commands;
using Rocket.Core.DependencyInjection;
using Rocket.Unturned.Player;
namespace WebsiteCommand
{
[DontAutoRegister]
public class RocketWebsiteCommand : ICommand
{
public RocketWebsiteCommand(string name, string description, string url, string permission)
{
Summary = description;
Url = url;
Name = name;
Permission = permission;
}
public string Name { get; }
public string[] Aliases => null;
public string Summary { get; }
public string Description => null;
public string Permission { get; }
public string Syntax => "";
public IChildCommand[] ChildCommands => null;
public string Url { get; }
public bool SupportsUser(Type user)
{
return typeof(UnturnedPlayer).IsAssignableFrom(user);
}
public void Execute(ICommandContext context)
{
UnturnedPlayer uCaller = ((UnturnedUser)context.User).Player;
WebsiteCommandsPlugin.OpenUrl(uCaller, Url, Summary);
}
}
}