本文整理汇总了C#中fCraft.Player.Message方法的典型用法代码示例。如果您正苦于以下问题:C# Player.Message方法的具体用法?C# Player.Message怎么用?C# Player.Message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fCraft.Player
的用法示例。
在下文中一共展示了Player.Message方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CModeWater
internal static void CModeWater(Player player, Command cmd)
{
if (!player.Can(Permissions.ControlPhysics))
{
player.NoAccessMessage(Permissions.ControlPhysics);
return;
}
string blockpar = cmd.Next();
string wmt = "";
int BlockAddr = -1;
try { BlockAddr = Convert.ToInt32(blockpar); }
catch
{
player.Message("Incorrect parameter!"); return;
}
if (BlockAddr < 3 && BlockAddr >= 0)
{
player.world.map.modeWater = BlockAddr;
switch (BlockAddr)
{
case 0: wmt = "'none'"; break;
case 1: wmt = "'infinite'"; break;
case 2: wmt = "'finite'"; break;
}
player.Message("Water mode set to " + wmt + ".");
}
}
示例2: DoZone
void DoZone( Player player, Command cmd ) {
if( !player.Can( Permissions.SetSpawn ) ) {
world.NoAccessMessage( player );
return;
}
string name = cmd.Next();
if( name == null ) {
player.Message( "No zone name specified. See " + Color.Help + "/help zone" );
return;
}
if( !Player.IsValidName( name ) ) {
player.Message( "\"" + name + "\" is not a valid zone name" );
return;
}
Zone zone = new Zone();
zone.name = name;
string property = cmd.Next();
if( property == null ) {
player.Message( "No zone rank/whitelist/blacklist specified. See " + Color.Help + "/help zone" );
return;
}
PlayerClass minRank = world.classes.ParseClass( property );
if( minRank != null ) {
zone.buildRank = minRank.rank;
player.tag = zone;
player.marksExpected = 2;
player.marks.Clear();
player.markCount = 0;
player.selectionCallback = MakeZone;
}
}
示例3: SetParametrization
public static void SetParametrization(Player p, Command cmd)
{
string strFunc = cmd.Next();
if (string.IsNullOrWhiteSpace(strFunc))
{
p.Message("Error: empty parametrization expression");
return;
}
if (strFunc.Length < 3)
{
p.Message("Error: expression is too short (should be like x=f(t,u,v))");
return;
}
strFunc = strFunc.ToLower();
try
{
string coordVar = SimpleParser.PreparseAssignment(ref strFunc);
CheckCoordVar(coordVar);
Expression expression = SimpleParser.Parse(strFunc, new string[] { "t", "u", "v" });
p.Message("Expression parsed as " + coordVar + "=" + expression.Print());
GetPlayerParametrizationCoordsStorage(p)[VarNameToIdx(coordVar[0])] = expression;
}
catch (Exception e)
{
p.Message("Error: "+e.Message);
}
}
示例4: FuncDrawOperation
protected FuncDrawOperation(Player player, Command cmd)
: base(player)
{
string strFunc = cmd.Next();
if (string.IsNullOrWhiteSpace(strFunc))
{
player.Message("&WEmpty function expression");
return;
}
if (strFunc.Length < 3)
{
player.Message("&WExpression is too short (should be like z=f(x,y))");
return;
}
strFunc = strFunc.ToLower();
_vaxis = GetAxis(SimpleParser.PreparseAssignment(ref strFunc));
_expression = SimpleParser.Parse(strFunc, GetVarArray(_vaxis));
Player.Message("Expression parsed as "+_expression.Print());
string scalingStr=cmd.Next();
_scaler = new Scaler(scalingStr);
}
示例5: PayHandler
static void PayHandler(Player player, Command cmd)
{
string targetName = cmd.Next();
string money = cmd.Next();
int amount;
if (money == null)
{
player.Message("&ePlease select the amount of bits you wish to send.");
return;
}
Player target = Server.FindPlayerOrPrintMatches(player, targetName, false, true);
if (target == null)
{
player.Message("&ePlease select a player to pay bits towards.");
return;
}
if (!int.TryParse(money, out amount))
{
player.Message("&ePlease select from a whole number.");
return;
}
PayHandler(player, new Command("/economy pay " + target + " " + money));
}
示例6: Paint
void Paint( Player player, Command cmd ) {
player.replaceMode = !player.replaceMode;
if( player.replaceMode ){
player.Message( "Replacement mode: ON" );
} else {
player.Message( "Replacement mode: OFF" );
}
}
示例7: PrintUsage
public void PrintUsage( Player player ) {
if( player == null ) throw new ArgumentNullException( "player" );
if( Usage != null ) {
player.Message( "Usage: &H{0}", Usage );
} else {
player.Message( "Usage: &H/{0}", Name );
}
}
示例8: SetParamIteration
public static void SetParamIteration(Player p, CommandReader cmd)
{
string strParam = cmd.Next();
if (string.IsNullOrWhiteSpace(strParam))
{
p.Message("Error: missing param variable name");
return;
}
strParam = strParam.ToLower();
try
{
CheckParamVar(strParam);
double from = ReadDoubleParam(cmd, "lower bound");
double to = ReadDoubleParam(cmd, "upper bound");
double step = ReadDoubleParam(cmd, "step");
if (step == 0 ||
(to - from)/step < 0)
throw new ArgumentException("wrong iteration bounds/step combination");
p.Message("Iteration for " + strParam + " from " + from + " to " + to + " with step " + step + ". " +
((to - from)/step + 1) + " steps.");
GetPlayerParametrizationParamsStorage(p)[VarNameToIdx(strParam[0])] = new double[] {from, to, step};
}
catch (Exception e)
{
p.Message("Error: " + e.Message);
}
}
示例9: CancelDraw
internal static void CancelDraw( Player player, Command command )
{
if( player.marksExpected > 0 ) {
player.marksExpected = 0;
} else {
player.Message( "There is currently nothing to cancel." );
}
}
示例10: Compass
void Compass( Player player, Command cmd ) {
int offset = (int)(player.pos.r / 255f * 64f) + 32;
string name = cmd.Next();
if( name != null ) {
Player target = world.FindPlayer( name );
if( target != null ) {
player.Message( "Coordinates of player \"" + target.name + "\":" );
offset = (int)(target.pos.r / 255f * 64f) + 32;
} else {
world.NoPlayerMessage( player, name );
return;
}
}
player.Message( Color.Silver, String.Format( "({0},{1},{2}) - {3}[{4}{5}{6}{3}{7}]",
player.pos.x / 32,
player.pos.y / 32,
player.pos.h / 32,
Color.White,
compass.Substring( offset - 12, 11 ),
Color.Red,
compass.Substring( offset - 1, 3 ),
compass.Substring( offset + 2, 11 ) ) );
}
示例11: BumHandler
static void BumHandler(Player player, CommandReader cmd)
{
string newModeName = cmd.Next();
if (newModeName == null)
{
player.Message("&sBytes Sent: {0} Per Second: {1:0.0}", player.BytesSent, player.BytesSentRate);
player.Message("&sBytes Received: {0} Per Second: {1:0.0}", player.BytesReceived, player.BytesReceivedRate);
player.Message("&sBandwidth mode: {0}",player.BandwidthUseMode);
return;
}
else if (player.Can(Permission.EditPlayerDB))
{
var newMode = (BandwidthUseMode)Enum.Parse(typeof(BandwidthUseMode), newModeName, true);
player.Message("&sBandwidth mode: {0} --> {1}", player.BandwidthUseMode, newMode.ToString());
player.BandwidthUseMode = newMode;
player.Info.BandwidthUseMode = newMode;
return;
}
else
{
player.Message("You need {0}&s to change your BandwidthUseMode", RankManager.GetMinRankWithAnyPermission(Permission.EditPlayerDB).ClassyName);
return;
}
}
示例12: TrollHandler
private static void TrollHandler( Player player, CommandReader cmd ) {
string Name = cmd.Next();
if ( Name == null ) {
player.Message( "Player not found. Please specify valid name." );
return;
}
if ( !Player.IsValidPlayerName( Name ) )
return;
Player target = Server.FindPlayerOrPrintMatches( player, Name, SearchOptions.Default );
if ( target == null )
return;
string options = cmd.Next();
if ( options == null ) {
CdTroll.PrintUsage( player );
return;
}
string Message = cmd.NextAll();
if ( Message.Length < 1 && options.ToLower() != "leave" ) {
player.Message( "&WError: Please enter a message for {0}.", target.ClassyName );
return;
}
switch ( options.ToLower() ) {
case "pm":
if ( player.Can( Permission.UseColorCodes ) && Message.Contains( "%" ) ) {
Message = Chat.ReplacePercentColorCodes( Message, false );
}
Server.Players.Message( "&Pfrom {0}: {1}",
target.Name, Message );
break;
case "st":
case "staff":
Chat.SendStaff( target, Message );
break;
case "i":
case "impersonate":
case "msg":
case "message":
case "m":
Server.Message( "{0}&S&F: {1}",
target.ClassyName, Message );
break;
case "leave":
case "disconnect":
case "gtfo":
Server.Players.Message( "&SPlayer {0}&S left the server.",
target.ClassyName );
break;
default:
player.Message( "Invalid option. Please choose st, ac, pm, message or leave" );
break;
}
}
示例13: Grass
void Grass( Player player, Command cmd ) {
if( player.mode == BlockPlacementMode.Grass ) {
player.mode = BlockPlacementMode.Normal;
player.Message( "Grass: OFF" );
} else if( player.Can( Permissions.PlaceGrass ) ) {
player.mode = BlockPlacementMode.Grass;
player.Message( "Grass: ON. Dirt blocks are replaced with grass." );
} else {
world.NoAccessMessage( player );
}
}
示例14: Water
void Water( Player player, Command cmd ) {
if( player.mode == BlockPlacementMode.Water ) {
player.mode = BlockPlacementMode.Normal;
player.Message( "Water: OFF" );
} else if( player.Can( Permissions.PlaceWater ) ) {
player.mode = BlockPlacementMode.Water;
player.Message( "Water: ON. Blue blocks are replaced with water." );
} else {
world.NoAccessMessage( player );
}
}
示例15: Lava
void Lava( Player player, Command cmd ) {
if( player.mode == BlockPlacementMode.Lava ) {
player.mode = BlockPlacementMode.Normal;
player.Message( "Lava: OFF." );
} else if( player.Can( Permissions.PlaceWater ) ) {
player.mode = BlockPlacementMode.Lava;
player.Message( "Lava: ON. Red blocks are replaced with lava." );
} else {
world.NoAccessMessage( player );
}
}