Thread: Platinum tokens converting

Results 1 to 4 of 4
  1. #1 Platinum tokens converting 
    Banned
    Join Date
    Sep 2017
    Posts
    340
    Thanks given
    24
    Thanks received
    30
    Rep Power
    0
    Hello just wondering how to calculate the amount of coins being converted into platinum tokens i have no idea how to make it each 1000coins = 1 token can someone give me practice thanks if someone will be helpful
    Reply With Quote  
     

  2. #2  
    zen2
    Corey's Avatar
    Join Date
    Feb 2012
    Age
    23
    Posts
    1,388
    Thanks given
    1,090
    Thanks received
    1,450
    Discord
    View profile
    Rep Power
    5000
    Code:
    final int platinumTokenValue = 1000;
    final int platinumTokenAmount = coinAmount / platinumTokenValue;
    
    if (platinumTokenAmount > 0) {
        player.getInventory().removeItem(995, platinumTokenAmount * platinumTokenValue);
    } else {
        // not enough coins to convert
    }
    what exactly do you need help with?
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Community Veteran

    George's Avatar
    Join Date
    Mar 2009
    Posts
    7,059
    Thanks given
    2,100
    Thanks received
    2,939
    Rep Power
    5000
    You multiply the token amount by 1.000? Or you could just set the item's value to 1.000 and use that when converting the tokens to coins?

    I'm not actually sure I know what you're trying to do.


    Reply With Quote  
     

  4. #4  
    Banned
    Join Date
    Sep 2017
    Posts
    340
    Thanks given
    24
    Thanks received
    30
    Rep Power
    0
    Quote Originally Posted by Tesla View Post
    Code:
    final int platinumTokenValue = 1000;
    final int platinumTokenAmount = coinAmount / platinumTokenValue;
    
    if (platinumTokenAmount > 0) {
        player.getInventory().removeItem(995, platinumTokenAmount * platinumTokenValue);
    } else {
        // not enough coins to convert
    }
    what exactly do you need help with?
    Thanks i've been doing it wrong lol...

    Code:
    final int value = 1000;
    		final int size = player.getInventory().getItemAmount(995);
    		player.getInventory().remove(new Item(995, size * value));
    		player.getInventory().add(new Item(13204, size / 2));
    Reply With Quote  
     


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. [REQ] Platinum Tokens
    By pityer tank in forum Models
    Replies: 6
    Last Post: 11-07-2020, 07:56 AM
  2. [OSRSPK/Elvarg] Platinum Token exchanging
    By VenomRS in forum Snippets
    Replies: 15
    Last Post: 03-17-2020, 08:41 PM
  3. Replies: 12
    Last Post: 02-24-2017, 03:56 AM
  4. Platinum Tokens? [PI]
    By zayuhh in forum Help
    Replies: 1
    Last Post: 02-14-2017, 12:12 AM
  5. [REQ Platinum tokens + ints]
    By White Vans in forum Models
    Replies: 3
    Last Post: 11-08-2015, 09:17 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
  •