Solved/ban command doesn't work

Posts 1–4 of 4 · Page 1 of 1
/ban command doesn't work
http://puu.sh/sDMmY/d516fc2e0f.png

Code:
    internal class BanCommand : Command
    {
        public BanCommand() : 
            base("ban", Ranks.Admin)
        {
        }

        protected override bool Process(Player player, RealmTime time, string[] args)
        {
            var p = player.Manager.FindPlayer(args[1]);
            if (p == null)
            {
                player.SendError("Player not found");
                return false;
            }
            player.Manager.Database.DoActionAsync(db =>
            {
                var cmd = db.CreateQuery();
                cmd.CommandText = "UPDATE accounts SET banned=1 WHERE id=@accId;";
                cmd.Parameters.AddWithValue("@accId", p.AccountId);
                cmd.ExecuteNonQuery();
            });
            return true;
        }
    }
change
Code:
var p = player.Manager.FindPlayer(args[1]);
to
Code:
var p = player.Manager.FindPlayer(args[0]);
Quote Originally Posted by ossimc82 View Post
change
Code:
var p = player.Manager.FindPlayer(args[1]);
to
Code:
var p = player.Manager.FindPlayer(args[0]);
lol i was literally thinking of doing that but I didn't know if that would fix it, thanks
@059 @Raple @Ahl solved
Quote Originally Posted by LegumI View Post
lol i was literally thinking of doing that but I didn't know if that would fix it, thanks
@059 @Raple @Ahl solved
Solved
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us