Thread: [any base] Better way of adding starter items.

Results 1 to 4 of 4
  1. #1 [any base] Better way of adding starter items. 
    Registered Member
    thim slug's Avatar
    Join Date
    Nov 2010
    Age
    25
    Posts
    4,142
    Thanks given
    1,079
    Thanks received
    1,137
    Discord
    View profile
    Rep Power
    5000
    Client class. (server sided obviously)
    Code:
    int[][] startingItems = {{995, 7000000}, {6570, 1}};
    In your initialize method:
    Code:
    for (int i = 0; i < startingItems.length; i++) actionSender.sendInventoryItem(startingItems[i][0], startingItems[i][1]);
    PI (because you're too lazy to change a variable name...):
    Code:
    for (int i = 0; i < startingItems.length; i++) getItems().addItem(startingItems[i][0], startingItems[i][1]);
    Usage:
    Then you add your items to the multi dimensional array, in the one i provided, you'd get 7 Million coins and 1 firecape, so
    Code:
    int[][] startingItems = {{itemId, amount}, {2nd itemId, 2nd amount}};
    and you can add as many as you want.
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Banned

    Join Date
    Mar 2011
    Posts
    4,064
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    made this a few weeks ago when i realized how messy it looked with all those addItems xD

    OT: GJ should help some people
    Reply With Quote  
     

  4. #3  
    Extreme Donator

    Jilic-Matt's Avatar
    Join Date
    May 2011
    Age
    26
    Posts
    1,614
    Thanks given
    799
    Thanks received
    495
    Rep Power
    540
    nice this looks much better gonna giv this a go
    Reply With Quote  
     

  5. #4  
    Registered Member
    thim slug's Avatar
    Join Date
    Nov 2010
    Age
    25
    Posts
    4,142
    Thanks given
    1,079
    Thanks received
    1,137
    Discord
    View profile
    Rep Power
    5000
    Np, just thought it would help a couple of people, and make things look neater, also now people understand it, they can use for different things, like for quests (giving rewards).
    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. Good Starter Base
    By skullz4ever in forum Help
    Replies: 4
    Last Post: 04-09-2011, 03:22 AM
  2. Starter items ++REP
    By jorjus16 in forum Help
    Replies: 5
    Last Post: 10-04-2010, 06:18 PM
  3. Replies: 5
    Last Post: 08-21-2009, 08:39 AM
  4. Starter items
    By sunscape in forum Help
    Replies: 2
    Last Post: 06-07-2009, 03:34 AM
  5. Replies: 20
    Last Post: 11-29-2008, 01:25 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
  •