本文整理汇总了C#中MCGalaxy.Player.SendBlockchange方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SendBlockchange方法的具体用法?C# Player.SendBlockchange怎么用?C# Player.SendBlockchange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCGalaxy.Player
的用法示例。
在下文中一共展示了Player.SendBlockchange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Player_PlayerBlockChange
void Player_PlayerBlockChange(Player p, ushort x, ushort y, ushort z, byte type)
{
if (started)
{
if (p.level == mainlevel && !blueteam.members.Contains(p) && !redteam.members.Contains(p))
{
p.SendBlockchange(x, y, z, p.level.GetTile(x, y, z));
Player.SendMessage(p, "You are not on a team!");
Plugin.CancelPlayerEvent(PlayerEvents.BlockChange, p);
}
if (p.level == mainlevel && blueteam.members.Contains(p) && x == redbase.x && y == redbase.y && z == redbase.z && mainlevel.GetTile(redbase.x, redbase.y, redbase.z) != Block.air)
{
Player.GlobalMessageLevel(mainlevel, blueteam.color + p.name + " took the " + redteam.color + " red team's FLAG!");
GetPlayer(p).hasflag = true;
}
if (p.level == mainlevel && redteam.members.Contains(p) && x == bluebase.x && y == bluebase.y && z == bluebase.z && mainlevel.GetTile(bluebase.x, bluebase.y, bluebase.z) != Block.air)
{
Player.GlobalMessageLevel(mainlevel, redteam.color + p.name + " took the " + blueteam.color + " blue team's FLAG");
GetPlayer(p).hasflag = true;
}
if (p.level == mainlevel && blueteam.members.Contains(p) && x == bluebase.x && y == bluebase.y && z == bluebase.z && mainlevel.GetTile(bluebase.x, bluebase.y, bluebase.z) != Block.air)
{
if (GetPlayer(p).hasflag)
{
Player.GlobalMessageLevel(mainlevel, blueteam.color + p.name + " RETURNED THE FLAG!");
GetPlayer(p).hasflag = false;
GetPlayer(p).cap++;
GetPlayer(p).points += cappoint;
blueteam.points++;
mainlevel.Blockchange(redbase.x, redbase.y, redbase.z, Block.red);
p.SendBlockchange(x, y, z, p.level.GetTile(x, y, z));
Plugin.CancelPlayerEvent(PlayerEvents.BlockChange, p);
if (blueteam.points >= maxpoints)
{
End();
return;
}
}
else
{
Player.SendMessage(p, "You cant take your own flag!");
p.SendBlockchange(x, y, z, p.level.GetTile(x, y, z));
Plugin.CancelPlayerEvent(PlayerEvents.BlockChange, p);
}
}
if (p.level == mainlevel && redteam.members.Contains(p) && x == redbase.x && y == redbase.y && z == redbase.z && mainlevel.GetTile(redbase.x, redbase.y, redbase.z) != Block.air)
{
if (GetPlayer(p).hasflag)
{
Player.GlobalMessageLevel(mainlevel, redteam.color + p.name + " RETURNED THE FLAG!");
GetPlayer(p).hasflag = false;
GetPlayer(p).points += cappoint;
GetPlayer(p).cap++;
redteam.points++;
mainlevel.Blockchange(bluebase.x, bluebase.y, bluebase.z, Block.blue);
p.SendBlockchange(x, y, z, p.level.GetTile(x, y, z));
Plugin.CancelPlayerEvent(PlayerEvents.BlockChange, p);
if (redteam.points >= maxpoints)
{
End();
return;
}
}
else
{
Player.SendMessage(p, "You cant take your own flag!");
p.SendBlockchange(x, y, z, p.level.GetTile(x, y, z));
Plugin.CancelPlayerEvent(PlayerEvents.BlockChange, p);
}
}
}
}