Thread: little problem

Results 1 to 6 of 6
  1. #1 little problem 
    Banned
    Join Date
    Sep 2010
    Posts
    883
    Thanks given
    20
    Thanks received
    6
    Rep Power
    0
    Code:
    	public void appendKillCount(int i) {
    		Client c = (Client)Server.playerHandler.players[npcs[i].killedBy];
    		if(c != null) {
    			int[] kcMonsters = {122,49,2558,2559,2560,2561,2550,2551,2552,2553,2562,2563,2564,2565};
    			for (int j : kcMonsters) {
    				if (npcs[i].npcType == j) {
    					if (c.killCount < 20) {
    						c.killCount++;
    						c.sendMessage("Killcount: " + c.killCount);
    					} else {
    						c.sendMessage("You already have 20 kill count");
    					}
    					break;
    				}
    			}
    		}	
    	}
    how do you add the following in there:

    Code:
    	public int[] zamorakKC = {
    		6218, 6257, 6256, 6255, 6229, 6230, 6231,
    		6270, 6216, 6214, 6211, 6221, 6276, 6277,
    		6219
    	};
    
    	public int[] saradominKC = {
    		6257, 6256, 6259, 6258, 6254, 6255, 6229, 6230, 
    		6231, 6221, 6276, 6277, 6219
    	};
    
    	public int[] armadylKC = { 
    		6246, 6233, 6257, 6256, 6255, 6229, 6230, 6231,
    		6232, 6234, 6235, 6236, 6237, 6238, 6239, 6240,
    		6241, 6242, 6243, 6246, 6244, 6221, 6276, 6277,
    		6219
    	};
    
    	public int[] bandosKC = {
    		6269, 6210, 6212, 6257, 6256, 6255, 6229, 6230, 
    		6231, 6268, 6274, 6283, 6282, 6275, 6221, 6273,
    		6276, 6272, 6213, 6277, 6219
    
    	};
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Sep 2010
    Posts
    883
    Thanks given
    20
    Thanks received
    6
    Rep Power
    0
    bump
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Sep 2010
    Posts
    883
    Thanks given
    20
    Thanks received
    6
    Rep Power
    0
    bump
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Sep 2010
    Age
    29
    Posts
    567
    Thanks given
    147
    Thanks received
    202
    Rep Power
    0
    Why not make 4 apart voids for each kill count?

    like: public void zamorakKillCount(int i) {
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Banned
    Join Date
    Sep 2010
    Posts
    883
    Thanks given
    20
    Thanks received
    6
    Rep Power
    0
    my question is if somebody can put them into the first void.
    Reply With Quote  
     

  7. #6  
    Registered Member
    Xynth's Avatar
    Join Date
    May 2009
    Posts
    2,222
    Thanks given
    226
    Thanks received
    259
    Rep Power
    1155
    Code:
    for ( int i : zamorakKC) {
    		if (npcs[i].npcType == i) {
                             //Code here
                    }
    }
    for ( int k : saradominKC) {
    		if (npcs[i].npcType == k) {
                             //Code here
                    }
    }
    for ( int n : armadylKC) {
    		if (npcs[i].npcType == n) {
                             //Code here
                    }
    }
    for ( int h : bandosKC) {
    		if (npcs[i].npcType == h) {
                             //Code here
                    }
    }
    This can be done ALOT neater, but I am just doing it from the rune-server quick reply box, so I'm not going into detail.
    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. Replies: 4
    Last Post: 01-23-2011, 07:27 PM
  2. Replies: 6
    Last Post: 07-04-2009, 04:19 PM
  3. Replies: 3
    Last Post: 02-22-2009, 08:14 PM
  4. Replies: 4
    Last Post: 04-23-2008, 04:54 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
  •