source: binary-improvements/AllocsCommands/Commands/DebuffPlayer.cs@ 287

Last change on this file since 287 was 253, checked in by alloc, 9 years ago

Fixes 6_8_10

File size: 1.2 KB
Line 
1using System;
2using System.Collections.Generic;
3
4namespace AllocsFixes.CustomCommands
5{
6 public class DebuffPlayer : ConsoleCmdAbstract
7 {
8 public override string GetDescription ()
9 {
10 return "Remove a buff from a player";
11 }
12
13 public override string GetHelp () {
14 return "Usage:\n" +
15 " debuffplayer <player name / steam id / entity id> <buff name>\n" +
16 "Remove the given buff from the player given by the player name or entity id (as given by e.g. \"lpi\").";
17 }
18
19 public override string[] GetCommands ()
20 {
21 return new string[] { "debuffplayer" };
22 }
23
24 public override void Execute (List<string> _params, CommandSenderInfo _senderInfo)
25 {
26 try {
27 if (_params.Count != 2) {
28 SdtdConsole.Instance.Output ("Invalid arguments");
29 return;
30 }
31
32 string buff = _params [1];
33
34 ClientInfo receiver = ConsoleHelper.ParseParamIdOrName (_params [0]);
35 if (receiver != null) {
36 receiver.SendPackage (new NetPackageConsoleCmdClient ("debuff " + buff, true));
37 } else {
38 SdtdConsole.Instance.Output ("Playername or entity ID not found.");
39 }
40 } catch (Exception e) {
41 Log.Out ("Error in DebuffPlayer.Run: " + e);
42 }
43 }
44 }
45}
Note: See TracBrowser for help on using the repository browser.