Thread: [PI] Not allowed to wear armor in a minigame ?

Results 1 to 7 of 7
  1. #1 [PI] Not allowed to wear armor in a minigame ? 
    Donator
    Garrett's Avatar
    Join Date
    May 2010
    Age
    29
    Posts
    350
    Thanks given
    45
    Thanks received
    21
    Rep Power
    28
    Should've posted this in my first post today but, is there a way that when someone clicks on the portal to enter the minigame, if you are wearing armor or have items in your inventory you must bank them before entering?, I've been it before it other servers but i never really played with it before.
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Oct 2011
    Age
    28
    Posts
    1,880
    Thanks given
    311
    Thanks received
    557
    Rep Power
    703
    Code:
    				for (int i = 0; i < c.playerEquipment.length; i++) {
    					if (c.playerEquipment[i] > 0) {
    						c.sendMessage("Take your items off before using this function.");
    						return;
    					}
    				}
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Donator
    Garrett's Avatar
    Join Date
    May 2010
    Age
    29
    Posts
    350
    Thanks given
    45
    Thanks received
    21
    Rep Power
    28
    I've never done this before, but would it look like this?

    Code:
    	/**Going into the zombie Minigame**/
    				    } else if (client.objectX == 2464 && client.objectY == 4783) { // Object Coords, 
    				    	for (int i1 = 0; i < client.playerEquipment.length; i++) {
    				    	    if (client.playerEquipment[i1] > 0) {
    				    	        client.sendMessage("Take your items off before using this function.");
    				    	        return;
    				    	    }
    				    	}
    				   } else {	
    				    	client.getPA().startTeleport(2525, 4776, 0, "modern");
    						client.sendMessage("<b><col=ff0000>You have been given a few starter items to begin.");
    						client.sendMessage("<b><col=ff0000>Zombies will drop items for you to use also.");
    				    	client.sendMessage("<b><col=ff0000>PREPARE TO FIGHT FOR YOUR LIFE.");
    				    	client.getPA().addZombieStarter();
    				    	break;
    				   }
    Reply With Quote  
     

  5. #4  
    Donator

    6ix9ine's Avatar
    Join Date
    Oct 2012
    Posts
    622
    Thanks given
    514
    Thanks received
    112
    Rep Power
    582
    Yes exaclty like that.
    Quote Originally Posted by Huey View Post
    Because of all the nub syipkpkers nulls that runs in no way to stop them ***gots. There runing everything yyou can't even enjoy an fucking server with out an asshole with his head stuck up his *** crashing an server. Every fucking 10 minutes an asshole always log on server crashing it because of the ***got who made it... So how the hell do yall stand these ***gots that's crashing server. Damn people just move on do something else play warock or something that's what im about to start playing... if you would like to add me its [email protected] it was nice knowing ya rune-server and burn in hell server crashers
    Reply With Quote  
     

  6. #5  
    Donator
    Garrett's Avatar
    Join Date
    May 2010
    Age
    29
    Posts
    350
    Thanks given
    45
    Thanks received
    21
    Rep Power
    28
    //Eclipse keeps telling me "int i" is already declared as a local variable just they're something that shouldn't even effect it ._.

    Never mind i just removed the "int" part, thanks guys it works! :]
    Reply With Quote  
     

  7. #6  
    Registered Member
    Join Date
    Jul 2010
    Posts
    141
    Thanks given
    3
    Thanks received
    3
    Rep Power
    17
    Woops, didn't realize you fixed.

    Computers are like bikinis. They save people a lot of guesswork.


    Reply With Quote  
     

  8. #7  
    Member
    Join Date
    Aug 2012
    Posts
    261
    Thanks given
    3
    Thanks received
    39
    Rep Power
    0
    If I recall correctly, isn't a lack of an item represented by a -1 and not a zero?
    So it should be:
    Code:
    for (int i = 0; i < c.playerEquipment.length; i++) {
        if (!c.playerEquipment[i] = -1) {
            c.sendMessage("Take your items off before using this function.");
            return;
        }
    }
    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 armor sets give you armor
    By g0d 0f war in forum Snippets
    Replies: 12
    Last Post: 08-15-2011, 02:39 AM
  2. Replies: 0
    Last Post: 09-05-2010, 04:28 AM
  3. Replies: 3
    Last Post: 06-14-2010, 01:30 PM
  4. Am I allowed to wear this in the signature or profile picture?
    By ZammyPk25 in forum Forum Related Help
    Replies: 31
    Last Post: 03-22-2010, 12:58 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
  •