/undoban

/undoban

Postby lucasds12 » 30 May 2013, 21:49

Hello, I would like to have the /undoban
What this command could do is undo all the actions and ban the player with it. I know that /xban is already added and bans the IP and acts like /kickban but I only want it to undo all the actions and ban the player.
>Does not ban IPs.
>Does not act like /kickban!
>Does undo all the actions.
>Does ban the user.
-Lucas
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.

Re: /undoban

Postby Conor » 30 May 2013, 22:40

lucasds12 wrote:Hello, I would like to have the /undoban
What this command could do is undo all the actions and ban the player with it. I know that /xban is already added and bans the IP and acts like /kickban but I only want it to undo all the actions and ban the player.
>Does not ban IPs.
>Does not act like /kickban!
>Does undo all the actions.
>Does ban the user.
-Lucas


This will be relatively easy to create for you, by following this layout:

Code: Select all
Command.all.Find("COMMAND").Use(p, "MESSAGE");


So if you wanted to ban and then undo the player's actions, you would include code looking something like below.

Code: Select all
public override void Use(Player p, string message)
{
   if (String.IsNullOrWhiteSpace(message) || message.Trim().Contains(" "))
   {
       Help(p);
       return;
   }
 
   Player who = Player.Find(message);
   if (who == null || who.hidden)
   {
       Player.SendMessage(p, "Player could not be found.");
   }
   else if (who.group.Permission >= p.group.Permission)
   {
       Player.SendMessage(p, "Cannot use this command on a player of greater or equal rank.");
   }
   else
   {
       Command.all.Find("xundo").Use(p, message);
       Command.all.Find("ban").Use(p, message);
   }
}
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: /undoban

Postby lucasds12 » 30 May 2013, 22:43

Thanks, I will include a change log in to this command.
If you want me to update it, please do so.
Code: Select all
Change Log!
0.1 - Released!
'
I just made it. I just had to still the codes from the /xban source.
Thank you a ton for helping me Conor.
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.

Re: /undoban

Postby lucasds12 » 30 May 2013, 22:48

I got some compiler errors please look into these.
Code: Select all
Error #CS1513
Message: } expected
Line: 37

-------------------------

Error #CS1518
Message: Expected class, delegate, enum, interface, or struct
Line: 65

-------------------------

Error #CS1022
Message: Type or namespace definition, or end-of-file expected
Line: 70
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.

Re: /undoban

Postby Conor » 30 May 2013, 23:01

lucasds12 wrote:I got some compiler errors please look into these.
Code: Select all
Error #CS1513
Message: } expected
Line: 37

-------------------------

Error #CS1518
Message: Expected class, delegate, enum, interface, or struct
Line: 65

-------------------------

Error #CS1022
Message: Type or namespace definition, or end-of-file expected
Line: 70


It looks like you have missed a '}' somewhere, however it is hard to determine without seeing your code.

If you have multiple errors then use the code I posted in the 'Use' method and it should work fine :)

If you need and more help let me know, and post code if needed.
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: /undoban

Postby lucasds12 » 30 May 2013, 23:24

Thanks for helpings Conor!
Oh lol, I just forgot that I have over 50+ posts :D
Too late I guess. Anyways, Conor, I'll check into it and see if it works.
-Lucas
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.

Re: /undoban

Postby Conor » 30 May 2013, 23:50

lucasds12 wrote:Thanks for helpings Conor!
Oh lol, I just forgot that I have over 50+ posts :D
Too late I guess. Anyways, Conor, I'll check into it and see if it works.
-Lucas


No problem, good luck.
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor


Return to Requests for Addon

Who is online

Users browsing this forum: No registered users and 6 guests

cron