source: binary-improvements/7dtd-server-fixes/src/CustomCommands/CreativeMenu.cs@ 137

Last change on this file since 137 was 130, checked in by alloc, 10 years ago

Fixes

File size: 802 bytes
RevLine 
[128]1using System;
2using System.Collections.Generic;
3
[130]4namespace AllocsFixes.CustomCommands
[128]5{
[130]6 public class CreativeMenu : ConsoleCommand
[128]7 {
[130]8 public CreativeMenu (ConsoleSdtd cons) : base(cons)
9 {
10 }
[128]11
[130]12 public override string Description ()
13 {
14 return "enable/disable creative menu";
15 }
[128]16
[130]17 public override string[] Names ()
18 {
19 return new string[] { "creativemenu", "cm" };
20 }
[128]21
[130]22 public override void Run (string[] _params)
23 {
24 try {
25 if (_params.Length != 1) {
26 m_Console.SendResult ("Usage: creativemenu <0/1>");
27 return;
28 }
[128]29
[130]30 GameStats.Set (EnumGameStats.IsCreativeMenuEnabled, _params [0].Equals ("1"));
[128]31
[130]32 m_Console.SendResult ("Set creative menu to " + _params [0].Equals ("1"));
33 } catch (Exception e) {
34 Log.Out ("Error in CreativeMenu.Run: " + e);
35 }
[128]36 }
37 }
[130]38}
Note: See TracBrowser for help on using the repository browser.