2011-10-09 21:57:43 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
2011-04-06 12:04:57 +02:00
|
|
|
|
2011-10-08 22:03:44 +02:00
|
|
|
import com.massivecraft.factions.P;
|
2011-10-09 14:53:38 +02:00
|
|
|
import com.massivecraft.factions.struct.Permission;
|
2011-04-06 12:04:57 +02:00
|
|
|
|
2011-10-25 21:18:08 +02:00
|
|
|
public class CmdAdmin extends FCommand
|
2011-10-09 14:53:38 +02:00
|
|
|
{
|
2011-10-25 21:18:08 +02:00
|
|
|
public CmdAdmin()
|
2011-10-09 14:53:38 +02:00
|
|
|
{
|
|
|
|
super();
|
2011-10-25 21:18:08 +02:00
|
|
|
this.aliases.add("admin");
|
2011-04-06 12:04:57 +02:00
|
|
|
|
2011-10-09 14:53:38 +02:00
|
|
|
//this.requiredArgs.add("");
|
2011-10-15 19:46:44 +02:00
|
|
|
this.optionalArgs.put("on/off", "flip");
|
2011-10-09 14:53:38 +02:00
|
|
|
|
2011-10-25 21:18:08 +02:00
|
|
|
this.permission = Permission.ADMIN.node;
|
2011-10-09 21:57:43 +02:00
|
|
|
this.disableOnLock = false;
|
2011-10-09 14:53:38 +02:00
|
|
|
|
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = false;
|
2011-10-23 17:55:53 +02:00
|
|
|
senderMustBeOfficer = false;
|
|
|
|
senderMustBeLeader = false;
|
2011-04-06 12:04:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2011-10-09 14:53:38 +02:00
|
|
|
public void perform()
|
|
|
|
{
|
2011-10-25 21:18:08 +02:00
|
|
|
fme.setHasAdminMode(this.argAsBool(0, ! fme.hasAdminMode()));
|
2011-10-09 18:35:39 +02:00
|
|
|
|
2011-10-25 21:18:08 +02:00
|
|
|
if ( fme.hasAdminMode())
|
2011-10-09 14:53:38 +02:00
|
|
|
{
|
2011-10-25 21:18:08 +02:00
|
|
|
fme.msg("<i>You have enabled admin bypass mode.");
|
2011-10-09 14:53:38 +02:00
|
|
|
P.p.log(fme.getName() + " has ENABLED admin bypass mode.");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-10-10 13:40:24 +02:00
|
|
|
fme.msg("<i>You have disabled admin bypass mode.");
|
2011-10-09 14:53:38 +02:00
|
|
|
P.p.log(fme.getName() + " DISABLED admin bypass mode.");
|
2011-04-06 12:04:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|