String name in lottery plugin. (iConomy API)

Discussion in 'Plugin Development' started by HungerCraftNL, Sep 1, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    HungerCraftNL

    Hello,
    I've seriously no idea what I have to place by 'String name', can someone maybe help me?
    Code:java
    1. package me.Shadow48402.LomeusLottery;
    2.  
    3. import java.util.Random;
    4.  
    5. import org.bukkit.ChatColor;
    6. import org.bukkit.command.Command;
    7. import org.bukkit.command.CommandSender;
    8. import org.bukkit.entity.Player;
    9.  
    10. import com.iCo6.system.Account;
    11. import com.iCo6.system.Accounts;
    12. import com.iCo6.system.Holdings;
    13.  
    14. public class FlipACoin {
    15. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
    16. if(cmd.getName().equalsIgnoreCase("flip")) {
    17. Player p = (Player) sender;
    18. Random object = new Random();
    19. Account account = iConomy.getAccount(String name);
    20. Holdings balance = iConomy.getAccount(String name).getHoldings();
    21. if(balance.hasEnough(50)){
    22. balance.subtract(50);
    23. int flip;
    24. for(int counter =1; counter<=1;counter++){
    25. flip = 1+object.nextInt(2);
    26.  
    27. if(flip == 1){
    28. p.sendMessage(ChatColor.WHITE + "You " + ChatColor.GREEN + "WIN " + "$100");
    29. p.sendMessage(ChatColor.AQUA + "Your balance is now: " + balance.getBalance());
    30. balance.add(100);
    31. }
    32. else if(flip == 2){
    33. p.sendMessage(ChatColor.WHITE + "You" + ChatColor.RED + "LOSE");
    34. }
    35. }
    36. }
    37. }
    38. }
    39. }

    Thanks,
    Shadow
     
  2. Offline

    Sabersamus

    Use player.getName() ?
     
  3. Offline

    HungerCraftNL

    Already tried, then I get this: 'The method getAccount(String) is undefined for the type iConomy' as error.
     
  4. Offline

    Sabersamus

    You know, looking at iConomy's source, I dont see iConomy.getAccount(Anything) anywhere.
     
  5. Offline

    HungerCraftNL

    What has it to be then?
     
  6. Offline

    aranwhite

    1. Insane Limits V0.8/R2: Player/Weapon Permission Lottery (not SQDM)
     
Thread Status:
Not open for further replies.

Share This Page