private void PBClear(CommandArgs args) { if (args.Parameters.Count == 1 && (args.Parameters[0] == "*" || args.Parameters[0].Equals("all", StringComparison.CurrentCultureIgnoreCase))) { if (!args.Player.HasPermission("pb.clear")) { args.Player.SendErrorMessage("You do not have permission to clear all permabuffs."); return; } foreach (KeyValuePair <int, DBInfo> kvp in DB.PlayerBuffs) { kvp.Value.bufflist.Clear(); DB.ClearDB(); } args.Player.SendSuccessMessage("All permabuffs have been deactivated for all players."); if (!args.Silent) { TSPlayer.All.SendInfoMessage("{0} has deactivated all permabuffs!", args.Player.Account.Name); } } else { if (!args.Player.RealPlayer) { args.Player.SendErrorMessage("You must be in-game to use this command."); return; } DB.PlayerBuffs[args.Player.Account.ID].bufflist.Clear(); DB.ClearPlayerBuffs(args.Player.Account.ID); args.Player.SendSuccessMessage("All of your permabuffs have been deactivated."); } }
public void OnAccDelete(AccountDeleteEventArgs args) { DB.ClearPlayerBuffs(args.Account.ID); }