Thread: PI How can I get this to work?

Results 1 to 6 of 6
  1. #1 PI How can I get this to work? 
    Registered Member
    Join Date
    Aug 2013
    Posts
    134
    Thanks given
    25
    Thanks received
    2
    Rep Power
    19
    Code:
    case 2467:
    		for (int i = 0; i < c.playerEquipment.length; i++) {
    		if (c.playerEquipment[i] < 0 || c.getItems().freeSlots() < 0) { 
                    c.sendMessage("You can't bring items into Demon Minigame."); 
                    return;
                } else 
    		if (c.playerEquipment[i] == 0 || c.getItems().freeSlots() == 0) {
    		c.getPA().movePlayer(2341, 3656, 0);
    		c.sendMessage("@blu@You enter the minigame.");
    		}
    		}
    		break;
    I have been trying for like 2 hours now... I want it to be where a player can not bring items equipped or in inventory inside the minigame waiting lobby.
    Reply With Quote  
     

  2. #2  
    Retired From RSPS

    iGarrett's Avatar
    Join Date
    Dec 2013
    Posts
    461
    Thanks given
    144
    Thanks received
    110
    Rep Power
    187
    Code:
    public boolean checkEmpty() {
    		if(getItems().freeSlots() == 28) {
    			for(int i = 0; i < playerEquipment.length; i++) {
    				if(playerEquipment[i] != -1) {
    					return false;
    				}
    			}
    			return true;
    		} else {
    			return false;
    		}
    	}

    Use:
    Code:
    if(!c.checkEmpty) {
      c.sendMessage("You can't bring items into Demon Minigame."); 
    } else {
    c.getPA().movePlayer(2341, 3656, 0);
    		c.sendMessage("@blu@You enter the minigame.");
    }
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Aug 2013
    Posts
    134
    Thanks given
    25
    Thanks received
    2
    Rep Power
    19
    Quote Originally Posted by Anrahgra View Post
    Code:
    public boolean checkEmpty() {
    		if(getItems().freeSlots() == 28) {
    			for(int i = 0; i < playerEquipment.length; i++) {
    				if(playerEquipment[i] != -1) {
    					return false;
    				}
    			}
    			return true;
    		} else {
    			return false;
    		}
    	}
    Wait I think I got it Client class right?


    Use:
    Code:
    if(!c.checkEmpty) {
      c.sendMessage("You can't bring items into Demon Minigame."); 
    } else {
    c.getPA().movePlayer(2341, 3656, 0);
    		c.sendMessage("@blu@You enter the minigame.");
    }
    Where exactly do I declare this:
    Code:
    public boolean checkEmpty(Client c) {
    		if(c.getItems().freeSlots() == 28) {
    			for(int i = 0; i < c.playerEquipment.length; i++) {
    				if(c.playerEquipment[i] != -1) {
    					return false;
    				}
    			}
    			return true;
    		} else {
    			return false;
    		}
    	}
    EDIT: I THINK CLIENT CLASS RIGHT?
    Reply With Quote  
     

  4. #4  
    Retired From RSPS

    iGarrett's Avatar
    Join Date
    Dec 2013
    Posts
    461
    Thanks given
    144
    Thanks received
    110
    Rep Power
    187
    Quote Originally Posted by Christoph3r View Post
    Where exactly do I declare this
    You declare this in client java, or anywhere.
    Code:
    public boolean checkEmpty() {
    		if(getItems().freeSlots() == 28) {
    			for(int i = 0; i < playerEquipment.length; i++) {
    				if(playerEquipment[i] != -1) {
    					return false;
    				}
    			}
    			return true;
    		} else {
    			return false;
    		}
    	}
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Aug 2013
    Posts
    134
    Thanks given
    25
    Thanks received
    2
    Rep Power
    19
    Quote Originally Posted by Anrahgra View Post
    You declare this in client java, or anywhere.
    Code:
    public boolean checkEmpty() {
    		if(getItems().freeSlots() == 28) {
    			for(int i = 0; i < playerEquipment.length; i++) {
    				if(playerEquipment[i] != -1) {
    					return false;
    				}
    			}
    			return true;
    		} else {
    			return false;
    		}
    	}
    Finally figured out thanks, do you know how to add chest that give random items, and after one use you cant use it anymore, its a demon survival game haha.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    May 2013
    Posts
    1,169
    Thanks given
    28
    Thanks received
    133
    Rep Power
    53
    Quote Originally Posted by Christoph3r View Post
    Finally figured out thanks, do you know how to add chest that give random items, and after one use you cant use it anymore, its a demon survival game haha.
    Just go google mysterybox crap and use that, if you want it to be a chest instead of the box item, just change it to work with an object instead of an item..
    If only I hadn't given you up, my life could've been different.
    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. [PI] How can i Add this To my Server?
    By 'Glory in forum Help
    Replies: 13
    Last Post: 11-19-2013, 12:52 PM
  2. Replies: 3
    Last Post: 10-23-2011, 02:40 AM
  3. [Help] How to get this to work ? [Help]
    By Xynasty in forum Help
    Replies: 0
    Last Post: 12-22-2010, 04:28 AM
  4. Replies: 10
    Last Post: 08-20-2010, 06:58 PM
  5. How i get this to work?
    By Proffesor Oak in forum Help
    Replies: 2
    Last Post: 02-18-2010, 11:46 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
  •