You've made a few errors such as not using the right caps, I've corrected the code so if you look at it you can compare with the mistakes, also if you are posting this as a command to ask for help with, please post it in "Help in Coding" in future reference.
Note: You cannot use custom ranks like LevelPermission.trusted;
You have to use one of the following: Banned, Guest, Builder, AdvBuilder, Operator, Admin, Nobody.
In your case I chose AdvBuilder which has a permission value of 50, should be close to Trusted permissions, but you can always set the permission to a custom rank in-game.
- Code: Select all
using System;
using System.IO;
using System.Threading;
namespace MCDzienny
{
public class clientfreeze : Command
{
public override string name { get { return "clientfreeze"; } }
public override string shortcut { get { return "cf"; } }
public override string type { get { return "other"; } }
public override bool museumUsable { get { return false; } }
public override LevelPermission defaultRank { get { return LevelPermission.AdvBuilder; } }
public override void Use(Player p, string message)
{
Player who = Player.Find(message);
if (who == null)
{
Player.SendMessage(p, message + "Player is not online");
return;
}
Command.all.Find("freeze").Use(p, who.name);
Player.GlobalMessage(p.color + p.PublicName + " has been frozen please turn off your hacks");
}
public override void Help(Player p)
{
Player.SendMessage(p, "/clientfreeze or /cf - Freezes the chosen player and tell them to get off their hacks.");
}
}
}