private static bool OnSignKill(int x, int y, string text, int who) { if (!text.ToLower().StartsWith(config.DefineSignCommands.ToLower())) { return(false); } var sPly = ScPlayers[who]; var tPly = TShock.Players[who]; if (sPly == null || tPly == null) { return(false); } var sign = ScSigns.Check(x, y, text, sPly.TsPlayer); if (sPly.DestroyMode && ScUtils.CanBreak(sPly.TsPlayer)) { sPly.DestroyMode = false; //Cooldown removal return(false); } try { sign.ExecuteCommands(sPly); } catch (Exception ex) { SendErrorToPlayer(sPly, tPly, ex.Message); } return(true); }
public static bool OnSignHit(int x, int y, string text, int who) { if (!text.ToLower().StartsWith(config.DefineSignCommands.ToLower())) return false; var tPly = TShock.Players[who]; var sPly = ScPlayers[who]; var sign = ScSigns.Check(x, y, text, tPly); if (tPly == null || sPly == null) return false; var canBreak = ScUtils.CanBreak(tPly); if (sPly.DestroyMode && canBreak) return false; if (config.ShowDestroyMessage && canBreak && sPly.AlertDestroyCooldown == 0) { tPly.SendInfoMessage("To destroy this sign, Type \"/destroysign\"."); sPly.AlertDestroyCooldown = 10; } try { sign.ExecuteCommands(sPly); } catch (Exception ex) { SendErrorToPlayer(sPly, tPly, ex.Message); } return true; }