Thread: [PI/DSPK]Method so it sees if you have no items ?

Results 1 to 3 of 3
  1. #1 [PI/DSPK]Method so it sees if you have no items ? 
    Registered Member Gretar's Avatar
    Join Date
    Sep 2011
    Posts
    289
    Thanks given
    69
    Thanks received
    12
    Rep Power
    7
    This is the method if you have any items on it will see that. But what about if you have no items on ?
    Code:
    				for (int j = 0; j < c.playerEquipment.length; j++) {
    					if (c.playerEquipment[j] > 0) {
    						c.sendMessage("@red@You may not wear items while using this command.");
    Owner of Roat Pkz
    Reply With Quote  
     

  2. #2  
    SERGEANT OF THE MASTER SERGEANTS MOST IMPORTANT PERSON OF EXTREME SERGEANTS TO THE MAX!

    cube's Avatar
    Join Date
    Jun 2007
    Posts
    8,871
    Thanks given
    1,854
    Thanks received
    4,745
    Rep Power
    5000
    Code:
    int count = 0;
    for (int j = 0; j < c.playerEquipment.length; j++) {
    	if (c.playerEquipment[j] <= 0) {
    		count++;
    	}
    }
    if(count == c.playerEquipment.length) {
    	c.sendMessage("you have no items on");
    }

    Attached image

    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Mar 2011
    Posts
    4,062
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    i dont get the question?you want one that checks if playerEquipment == 0? whats the difference from that and the one you have?...
    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. 647 Items for 317 PI [DSPK] Client
    By ItsGoml in forum Requests
    Replies: 2
    Last Post: 06-19-2011, 03:17 AM
  2. [DSPK] Storing Items
    By Files' in forum Help
    Replies: 2
    Last Post: 04-24-2011, 02:06 AM
  3. [ DSPK ] Adding Items [ / DSPK ]
    By Project- in forum Help
    Replies: 9
    Last Post: 01-14-2011, 02:43 AM
  4. Replies: 0
    Last Post: 03-22-2009, 10:52 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
  •