public override bool OnUse(GameClients.GameClient session, string[] args) { if (args.Length >= 2) { int newBuy = 1; if (!int.TryParse(args[1], out newBuy) || newBuy < 1 || newBuy > 100) { session.SendNotif("Value must be 1-100"); } else { session.GetHabbo().GetCommandCache().BuyCommandValue = newBuy; } return(true); } return(false); }
public override bool OnUse(GameClients.GameClient session, string[] args) { if (args.Length >= 3) { if (session.GetHabbo().HasPermission("cmd_givebadge")) { GameClient target = Skylight.GetGame().GetGameClientManager().GetGameClientByUsername(args[1]); if (target != null) { target.GetHabbo().GetBadgeManager().AddBadge(args[2], 0, true); return(true); } else { session.SendNotif("User not found."); } } } return(false); }
public override bool OnUse(GameClients.GameClient session, string[] args) { if (args.Length >= 2) { if (session.GetHabbo().HasPermission("cmd_ban")) { GameClient target = Skylight.GetGame().GetGameClientManager().GetGameClientByUsername(args[1]); if (target != null) { if (target.GetHabbo().Rank < session.GetHabbo().Rank) { string banLenghtString = "P"; if (args.Length >= 3) { banLenghtString = args[2]; if (banLenghtString != "P") { if (!Char.IsNumber(banLenghtString.Substring(banLenghtString.Length - 1)[0])) { int lenght; if (!int.TryParse(banLenghtString.Substring(0, banLenghtString.Length - 1), out lenght)) { return(false); } } else { int lenght; if (!int.TryParse(banLenghtString, out lenght)) { return(false); } } } } string banReason = "No reason"; if (args.Length >= 4) { banReason = TextUtilies.MergeArrayToString(args, 3); } return(Skylight.GetGame().GetBanManager().BanUser(session, target, BanType.User, target.GetHabbo().ID.ToString(), banReason, banLenghtString)); } else { session.SendNotif("You are not allowed to ban that user."); } } else { session.SendNotif("User not found."); } return(true); } } return(false); }