protected override bool Process(Player player, RealmTime time, string[] args) { if (!player.Guild.IsDefault) { try { var saytext = string.Join(" ", args); if (String.IsNullOrWhiteSpace(saytext)) { player.SendHelp("Usage: /guild <text>"); return false; } else { player.Guild.Chat(player, saytext.ToSafeText()); return true; } } catch { player.SendInfo("Cannot guild chat!"); return false; } } else player.SendInfo("You need to be in a guild to use guild chat!"); return false; }
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!"); }