Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@Author: Alloc => 7dtd-server-fixes => https://7dtd.illy.bz/browser/binary-improvements/7dtd-server-fixes
- //@Author: ketchu13 => Unban console command => [email protected]
- using System;
- using System.Collections.Generic;
- namespace AllocsFixes.CustomCommands
- {
- public class UnBan : ConsoleCommand
- {
- public UnBan (ConsoleSdtd cons) : base(cons)
- {
- }
- public override string Description ()
- {
- return "Deban un joueur (Steamid)";
- }
- public override string[] Names ()
- {
- return new string[] { "unban", "ub" };
- }
- public override void Run (string[] _params)
- {
- try {
- if (_params.Length != 1) {
- m_Console.SendResult("Utilisation: unban <steamidDuJoueur>");
- return;
- }
- long tempLong;
- if (_params [0].Length != 17 || !long.TryParse (_params [0], out tempLong)) {
- m_Console.SendResult ("Not a valid Steam ID.");
- return;
- }
- string steamid = CommonMappingFunctions.GetSteamID(_params[0]);
- if (steamid == null)
- {
- m_Console.SendResult("SteamId introuvable.");
- return;
- }
- AdminTools at = CommonMappingFunctions.GetGameManager ().adminTools;
- if (!at.isBanned (_params [0])) {
- m_Console.SendResult ("Steam ID is not banned.");
- return;
- }
- at.RemoveBan (_params [0]);
- m_Console.SendResult ("Joueur deban " + _params [0]);
- } catch (Exception e) {
- Log.Out ("Error in Unban.Run: " + e);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment