本文整理汇总了C#中CommandParameters.GetIntParameter方法的典型用法代码示例。如果您正苦于以下问题:C# CommandParameters.GetIntParameter方法的具体用法?C# CommandParameters.GetIntParameter怎么用?C# CommandParameters.GetIntParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommandParameters
的用法示例。
在下文中一共展示了CommandParameters.GetIntParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override void Execute(Network.Game.GameClient client, CommandParameters parameters)
{
var mapid = parameters.GetIntParameter(0);
var cellid = parameters.GetIntParameter(1);
var toTeleport = client;
if (parameters.Lenght > 2)
{
var playerName = parameters.GetParameter(2);
toTeleport = World.GetClient(playerName);
}
if (toTeleport != null)
{
toTeleport.Teleport(mapid, cellid);
client.ConsoleMessage("Teleportation effectuer !");
toTeleport.Character.Save();
}
else
{
client.ConsoleMessage("Impossible de trouver le joueur", Enums.ConsoleColorEnum.RED);
}
}
示例2: Execute
public override void Execute(Network.Game.GameClient client, CommandParameters parameters)
{
if (parameters.Lenght > 0)
{
var itemID = parameters.GetIntParameter(0);
var itemTemplate = Items.ItemManager.GetTemplate(itemID);
var quantity = 1;
var style = false;
if (itemTemplate != null)
{
if (parameters.Lenght > 1)
{
quantity = parameters.GetIntParameter(1);
}
if (parameters.Lenght > 2)
{
var styleStr = parameters.GetParameter(2).ToLower();
if (styleStr == "max")
{
style = true;
}
}
var item = Items.ItemManager.GenerateItem(client.Character.ID, itemTemplate, quantity, style);
client.Character.Bag.Add(item);
client.ConsoleMessage("L'objet <b>'" + itemTemplate.Name + "'</b> a correctement ete generer !", Enums.ConsoleColorEnum.GREEN);
}
else
{
client.ConsoleMessage("Impossible de trouver l'objet n°" + itemID, Enums.ConsoleColorEnum.RED);
}
}
else
{
client.ConsoleMessage("Parametres invalide !", Enums.ConsoleColorEnum.RED);
}
}
示例3: Execute
public override void Execute(Network.Game.GameClient client, CommandParameters parameters)
{
var quantity = parameters.GetIntParameter(0);
var to = client;
if (parameters.Lenght > 1)
{
var name = parameters.GetParameter(1);
to = World.GetClient(name);
}
if (to != null)
{
to.Character.Kamas += quantity;
to.SendStats();
client.ConsoleMessage("Kamas ajouter");
client.Character.Save();
}
else
{
client.ConsoleMessage("Impossible de trouver le joueur", Enums.ConsoleColorEnum.RED);
}
}