bool CheckTNTWarsChange(Player p, ushort x, ushort y, ushort z, ref byte block) { if (!(block == Block.TNT || block == Block.TNT_Big || block == Block.TNT_Nuke || block == Block.TNT_Small)) { return(true); } TntWarsGame game = TntWarsGame.GameIn(p); if (game.InZone(x, y, z, true)) { return(false); } if (p.CurrentAmountOfTnt == game.Config.MaxPlayerActiveTnt) { Player.Message(p, "TNT Wars: Maximum amount of TNT placed"); return(false); } if (p.CurrentAmountOfTnt > game.Config.MaxPlayerActiveTnt) { Player.Message(p, "TNT Wars: You have passed the maximum amount of TNT that can be placed!"); return(false); } p.TntAtATime(); block = Block.TNT_Small; return(true); }
bool CheckTNTWarsChange(Player p, ushort x, ushort y, ushort z, ref byte block) { if (!(block == Block.tnt || block == Block.bigtnt || block == Block.nuketnt || block == Block.smalltnt)) { return(true); } TntWarsGame game = TntWarsGame.GetTntWarsGame(p); if (game.InZone(x, y, z, true)) { return(false); } if (p.CurrentAmountOfTnt == game.TntPerPlayerAtATime) { Player.Message(p, "TNT Wars: Maximum amount of TNT placed"); return(false); } if (p.CurrentAmountOfTnt > game.TntPerPlayerAtATime) { Player.Message(p, "TNT Wars: You have passed the maximum amount of TNT that can be placed!"); return(false); } p.TntAtATime(); block = Block.smalltnt; return(true); }
bool CheckTNTWarsChange(Player p, ushort x, ushort y, ushort z, ref byte type) { if (!p.PlayingTntWars) return true; if (!(type == Block.tnt || type == Block.bigtnt || type == Block.nuketnt || type == Block.smalltnt)) return true; TntWarsGame game = TntWarsGame.GetTntWarsGame(p); if (game.InZone(x, y, z, true)) return false; if (p.CurrentAmountOfTnt == game.TntPerPlayerAtATime) { Player.SendMessage(p, "TNT Wars: Maximum amount of TNT placed"); return false; } if (p.CurrentAmountOfTnt > game.TntPerPlayerAtATime) { Player.SendMessage(p, "TNT Wars: You have passed the maximum amount of TNT that can be placed!"); return false; } p.TntAtATime(); type = Block.smalltnt; return true; }