public void TimeBanCommand(Client admin, string playerNameOrId, string time, string reason) { if (AdminChecks.CheckAdminLvl(admin, 2)) { Client player = PlayerHelper.GetPlayerFromNameOrId(playerNameOrId); if (player == null) { admin.sendNotification("~r~Error", "Dieser Spieler existiert nicht!"); return; } try { TimeSpan ts = Timehelper.GetTimeSpanFromTimeString(time); DateTime dt = DateTime.Now; dt = dt.Add(ts); BanSystem.AddBanByAdmin(player, admin, reason, dt); } catch (TimeHelperException) { admin.sendNotification("~r~Error", time + " ist kein valider Timestring."); } } }
public void BanCommand(Client admin, string playerNameOrId, string reason) { if (AdminChecks.CheckAdminLvl(admin, 2)) { Client player = PlayerHelper.GetPlayerFromNameOrId(playerNameOrId); if (player == null) { admin.sendNotification("~r~Error", "Dieser Spieler existiert nicht!"); return; } BanSystem.AddBanByAdmin(player, admin, reason, null); } }