2011-10-13 14:41:07 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.Faction;
|
|
|
|
import com.massivecraft.factions.integration.Econ;
|
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
|
|
|
|
|
|
|
|
public class CmdMoneyDeposit extends FCommand
|
|
|
|
{
|
|
|
|
|
|
|
|
public CmdMoneyDeposit()
|
|
|
|
{
|
|
|
|
super();
|
2011-10-13 16:07:07 +02:00
|
|
|
this.aliases.add("d");
|
2011-10-13 14:41:07 +02:00
|
|
|
this.aliases.add("deposit");
|
|
|
|
|
|
|
|
this.requiredArgs.add("amount");
|
|
|
|
this.optionalArgs.put("faction", "yours");
|
|
|
|
|
|
|
|
this.permission = Permission.MONEY_DEPOSIT.node;
|
2011-10-13 16:07:07 +02:00
|
|
|
this.setHelpShort("deposit money");
|
2011-10-13 14:41:07 +02:00
|
|
|
|
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = false;
|
|
|
|
senderMustBeModerator = false;
|
|
|
|
senderMustBeAdmin = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform()
|
|
|
|
{
|
2011-10-13 16:07:07 +02:00
|
|
|
double amount = this.argAsDouble(0, 0d);
|
2011-10-13 14:41:07 +02:00
|
|
|
Faction faction = this.argAsFaction(1, myFaction);
|
|
|
|
if (faction == null) return;
|
|
|
|
Econ.transferMoney(fme, fme, faction, amount);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|