-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMsgCommand.cs
More file actions
40 lines (37 loc) · 1.31 KB
/
MsgCommand.cs
File metadata and controls
40 lines (37 loc) · 1.31 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 System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HellionExtendedServer.Common;
using HellionExtendedServer.Common.Plugins;
using HellionExtendedServer.Managers;
using HellionExtendedServer.Managers.Commands;
using ZeroGravity;
using ZeroGravity.Objects;
namespace CyberCore
{
[Permission(PermissionName = "CyberTech.CyberCore.Msg")]
[Command(CommandName = "msg", Description = "Message Other Players", Permission = "CyberTech.CyberCore.Msg", Plugin = "CyberCore", Usage = "/msg <player> <message>")]
public class MsgCommand : Command
{
public MsgCommand(Server svr) : base(svr)
{
}
public override void runCommand(Player sender, string[] args)
{
if (args.Length < 2)
{
GetPluginHelper.SendMessageToClient(sender,"Error! Format /msg <player> <message>");
return;
}
Player target = GetPluginHelper.GetPlayer(args[0]);
if (target == null)
{
GetPluginHelper.SendMessageToClient(sender, "Error! Target not found");
return;
}
GetPluginHelper.SendMessageToClient(target, sender.Name + " > You : " + string.Join(" ", args.Skip(1)));
}
}
}