Thread: money pouch question

Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11  
    Perplexity owner

    Join Date
    Feb 2011
    Posts
    171
    Thanks given
    32
    Thanks received
    15
    Rep Power
    0
    Quote Originally Posted by ggtip2 View Post
    Code:
    				int amount = 0;
    				for(int i = 0; i < player.getInventory().getAmount(909); i++) {
    					amount++;
    				}
    				player.getInventory().delete(909,amount);
    Why would you do that. Terrible way of doing something.
    Should be done like the following 2 examples.

    Code:
    				int amount = player.getInventory().getAmount(909);
    				player.getInventory().delete(909,amount);
    				player.setMoneyInPouch(player.getMoneyInPouch()+(long)1000000000*amount);
    				player.getPacketSender().sendString(8135, ""+player.getMoneyInPouch());
    				break;
    Or even

    Code:
    				Item item = player.getInventory().getItem(909);
    				If (item == null) {
    					break;
    				}
    				int amount = item.getAmount();
    				player.getInventory().delete(item);
    				player.setMoneyInPouch(player.getMoneyInPouch()+(long)1000000000*amount);
    				player.getPacketSender().sendString(8135, ""+player.getMoneyInPouch());
    				break;
    I wouldn't, Hence the advice under the code
    Reply With Quote  
     

  2. #12  
    Registered Member
    Join Date
    Feb 2014
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    for some reason the replies were not showing when i sent the last reply, thank you both for the advice, ill try what you said
    Reply With Quote  
     

  3. #13  
    Registered Member
    Optimum's Avatar
    Join Date
    Apr 2012
    Posts
    3,570
    Thanks given
    871
    Thanks received
    1,745
    Rep Power
    5000
    Quote Originally Posted by ggtip2 View Post
    Code:
                    int amount = 0;
                    for(int i = 0; i < player.getInventory().getAmount(909); i++) {
                        amount++;
                    }
                    player.getInventory().delete(909,amount);
    Why would you do that. Terrible way of doing something.
    Should be done like the following 2 examples.

    Code:
                    int amount = player.getInventory().getAmount(909);
                    player.getInventory().delete(909,amount);
                    player.setMoneyInPouch(player.getMoneyInPouch()+(long)1000000000*amount);
                    player.getPacketSender().sendString(8135, ""+player.getMoneyInPouch());
                    break;
    Or even

    Code:
                    Item item = player.getInventory().getItem(909);
                    If (item == null) {
                        break;
                    }
                    int amount = item.getAmount();
                    player.getInventory().delete(item);
                    player.setMoneyInPouch(player.getMoneyInPouch()+(long)1000000000*amount);
                    player.getPacketSender().sendString(8135, ""+player.getMoneyInPouch());
                    break;
    thanks used this

    Quote Originally Posted by DownGrade View Post
    Don't let these no life creeps get to you, its always the same on here. They'd rather spend hours upon hours in the rune-server spam section then getting laid! ha ha!Its honestly pathetic i haven't seen so many lowlifes in my life its actually insane i wish that this section would just vanish its probably the only way to get these people out of the community...
    PLEASE BE AWARE OF IMPOSTERS MY DISCORD ID: 362240000760348683
    Reply With Quote  
     

  4. Thankful users:


Page 2 of 2 FirstFirst 12

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Money Pouch - 99%
    By TheLife in forum Tutorials
    Replies: 142
    Last Post: 12-21-2015, 11:47 AM
  2. Replies: 7
    Last Post: 12-27-2013, 08:33 PM
  3. [PI] Money Pouch Problem
    By Gr1nderscape in forum Help
    Replies: 6
    Last Post: 01-06-2012, 08:57 AM
  4. Help me Dementhium Money Pouch
    By A Thugz Life in forum Help
    Replies: 2
    Last Post: 01-06-2012, 02:48 AM
  5. Money pouch problem
    By Gr1nderscape in forum Help
    Replies: 2
    Last Post: 12-17-2011, 06:26 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •