public void Execute(Player player, string[] args) { if (player.Guild != "") { try { var saytext = string.Join(" ", args); foreach (var w in RealmManager.Worlds) { var world = w.Value; if (w.Key == 0) continue; foreach (var i in world.Players.Where(i => i.Value.Guild == player.Guild)) { if (string.IsNullOrEmpty(saytext)) player.SendHelp("Usage: /g <text>"); else { var tp = new TextPacket { BubbleTime = 10, Stars = player.Stars, Name = player.ResolveGuildChatName(), Recipient = "*Guild*", Text = saytext }; if (world.Id == player.Owner.Id) tp.ObjectId = player.Id; i.Value.Client.SendPacket(tp); } } } } catch { player.SendInfo("Cannot guild chat!"); } } else player.SendInfo("You need to be in a guild to use guild chat!"); }
public void SayGuild(Player src, string text) { foreach (Client i in src.Manager.Clients.Values) { if (String.Equals(src.Guild, i.Player.Guild)) { i.SendPacket(new TextPacket() { Name = src.ResolveGuildChatName(), ObjectId = src.Id, Stars = src.Stars, BubbleTime = 10, Recipient = "*Guild*", Text = text.ToSafeText(), CleanText = text.ToSafeText() }); } } }