本文整理汇总了C#中Player.SendHelp方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SendHelp方法的具体用法?C# Player.SendHelp怎么用?C# Player.SendHelp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player.SendHelp方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Process
protected override bool Process(Player player, RealmTime time, string[] args)
{
if (args.Length == 0)
{
player.SendHelp("Usage: /addeff <Effectname or Effectnumber>");
return false;
}
try
{
player.ApplyConditionEffect(new ConditionEffect
{
Effect = (ConditionEffectIndex)Enum.Parse(typeof(ConditionEffectIndex), args[0].Trim(), true),
DurationMS = -1
});
{
player.SendInfo("Success!");
}
}
catch
{
player.SendError("Invalid effect!");
return false;
}
return true;
}
示例2: Execute
public void Execute(Player player, string[] args)
{
if (args.Length == 0)
{
player.SendHelp("Usage: /addeff <effect name or effect number>");
}
else
{
try
{
player.ApplyConditionEffect(new ConditionEffect
{
Effect = (ConditionEffectIndex) Enum.Parse(typeof (ConditionEffectIndex), args[0].Trim(), true),
DurationMS = -1
});
{
player.SendInfo("Success!");
}
}
catch
{
player.SendError("Invalid effect!");
}
}
}
示例3: Process
protected override bool Process(Player player, RealmTime time, string[] args)
{
if(!player.Guild.IsDefault)
{
try
{
var saytext = string.Join(" ", args);
if (String.IsNullOrWhiteSpace(saytext))
{
player.SendHelp("Usage: /g <text>");
return false;
}
else
{
player.Guild.Chat(player, saytext.ToSafeText());
return true;
}
}
catch
{
player.SendInfo("Cannot guild chat!");
return false;
}
}
else
player.SendInfo("You need to be in a guild to use guild chat!");
return false;
}
示例4: Buy
public override void Buy(Player player)
{
if (!player.Guild.IsDefault)
{
if (player.Guild[player.AccountId].Rank >= 30)
{
using (var db = new Database())
{
if (db.GetGuild(db.GetGuildId(player.Guild[player.AccountId].Name)).GuildFame >= Price)
{
var cmd = db.CreateQuery();
cmd.CommandText = "UPDATE guilds SET level=level+1, [email protected] WHERE [email protected]";
cmd.Parameters.AddWithValue("@guildName", player.Guild.Name);
cmd.Parameters.AddWithValue("@price", Price);
if (cmd.ExecuteNonQuery() == 1)
{
player.Client.SendPacket(new BuyResultPacket
{
Message = "{\"key\":\"server.sale_succeeds\"}",
Result = -1
});
player.SendInfo("Please leave the Guild Hall, we need some minutes to update the Guild Hall.");
player.Guild.UpdateGuildHall();
}
}
else
{
player.SendHelp("FUCK");
player.Client.SendPacket(new BuyResultPacket
{
Message = "{\"key\":\"server.not_enough_fame\"}",
Result = 9
});
}
}
}
else
{
player.Client.SendPacket(new BuyResultPacket
{
Message = "Founder or Leader rank required.",
Result = 0
});
}
}
}
示例5: Execute
public void Execute(Player player, string[] args)
{
if (args.Length == 0)
{
player.SendHelp("Usage: /announce <text>");
}
else
{
var saytext = string.Join(" ", args);
foreach (var i in RealmManager.Clients.Values)
i.SendPacket(new TextPacket
{
BubbleTime = 0,
Stars = -1,
Name = "#Announcement",
Text = " " + saytext
});
}
}