Thread: [718] Correct calling of containsItems()

Results 1 to 3 of 3
  1. #1 [718] Correct calling of containsItems() 
    Registered Member Equity's Avatar
    Join Date
    Aug 2013
    Posts
    388
    Thanks given
    57
    Thanks received
    15
    Rep Power
    15
    Screenshot by Lightshot

    How can I call that correctly?
    trying to check if inventory contains both the items.

    Thanks!
    Attached image
    Reply With Quote  
     

  2. #2  
    Success is the worst teacher

    Santa Hat's Avatar
    Join Date
    Oct 2012
    Age
    27
    Posts
    3,334
    Thanks given
    807
    Thanks received
    1,185
    Rep Power
    190
    the parameter is an integer array, so to correctly call the method you will need to instance a new int array, like this

    containsItems(new int[] { 1, 2, 3}, new int[] { 10, 20, 30}) {

    }

    however if it were me, I would rather reference the Item object, then you can declare the itemid and amount in the same parameter like this

    containsItems(new Item[] { new Item(995, 10000 ), new Item(1050, 1) }) {

    }


    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member Equity's Avatar
    Join Date
    Aug 2013
    Posts
    388
    Thanks given
    57
    Thanks received
    15
    Rep Power
    15
    Quote Originally Posted by Santa Hat View Post
    the parameter is an integer array, so to correctly call the method you will need to instance a new int array, like this

    containsItems(new int[] { 1, 2, 3}, new int[] { 10, 20, 30}) {

    }

    however if it were me, I would rather reference the Item object, then you can declare the itemid and amount in the same parameter like this

    containsItems(new Item[] { new Item(995, 10000 ), new Item(1050, 1) }) {

    }
    Thank you man, I appreciate it.
    Attached image
    Reply With Quote  
     

  5. Thankful user:



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. *Official* Call of Duty 4 picture thread!
    By JavaBoy in forum Console
    Replies: 38
    Last Post: 09-05-2008, 04:21 AM
  2. Call Of Duty 4: Modern Warfare
    By blaze old in forum Console
    Replies: 8
    Last Post: 04-25-2008, 09:49 PM
  3. [Suggestion] Call Of Duty 4 [PC]
    By Makam in forum PC
    Replies: 13
    Last Post: 04-05-2008, 12:18 AM
  4. Call Of Duty4 Modern Warfare.
    By daneo in forum Console
    Replies: 8
    Last Post: 01-03-2008, 09:20 PM
  5. call of duty-new sig
    By kamzyd in forum Showcase
    Replies: 1
    Last Post: 12-10-2007, 09:57 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •