public virtual void OnVote(Mobile from, VoteStatus status) { if (status == VoteStatus.Success && VoteSite.Valid) { if (_Messages) { from.SendMessage("Thank you for voting on {0}!", VoteConfig.Instance.DefaultName); } if (VoteConfig.Instance.DefaultGold > 0) { from.AddToBackpack(new Gold(VoteConfig.Instance.DefaultGold)); from.SendAsciiMessage("{0} gold has been added to your backpack", VoteConfig.Instance.DefaultGold); from.PlaySound(55); } //from.LaunchBrowser("http://www.gamesites200.com/ultimaonline/in.php?id=2224"); Not allowed to have this :( from.LaunchBrowser(VoteConfig.Instance.DefaultURL); VoteHelper.SetLastVoteTime(from, VoteSite); } else if (status == VoteStatus.TooEarly) { if (_Messages) { TimeSpan timeLeft = VoteHelper.GetTimeLeft(from, VoteSite); from.SendMessage(0x22, "Sorry, you can not vote on {0} for {1}.", VoteConfig.Instance.DefaultName, VoteHelper.GetFormattedTime(timeLeft)); } } else if (status == VoteStatus.Invalid) { if (_Messages) { from.SendMessage(0x22, "Sorry, voting is currently unavailable."); } } }
public virtual void OnVote(Mobile from, VoteStatus status) { if (from == null || from.Deleted) { return; } switch (status) { case VoteStatus.Success: { if (VoteSite.Valid) { if (_Messages) { from.SendMessage("Thank you for voting on {0}!", VoteSite.Name); } from.LaunchBrowser(VoteSite.URL); VoteHelper.SetLastVoteTime(from, VoteSite); } else { if (_Messages) { from.SendMessage(0x22, "Sorry, voting is currently unavailable."); } } } break; case VoteStatus.Invalid: { if (_Messages) { from.SendMessage(0x22, "Sorry, voting is currently unavailable."); } } break; case VoteStatus.TooEarly: { if (_Messages) { TimeSpan timeLeft = VoteHelper.GetTimeLeft(from, VoteSite); from.SendMessage(0x22, "Sorry, you can not vote at {0} for {1}.", VoteSite.Name, VoteHelper.GetFormattedTime(timeLeft)); } } break; case VoteStatus.Custom: { } break; } }