Thread: [PI] No spawning in pits command needed [pi]

Results 1 to 7 of 7
  1. #1 [PI] No spawning in pits command needed [pi] 
    Banned
    Join Date
    Jul 2011
    Posts
    692
    Thanks given
    169
    Thanks received
    43
    Rep Power
    0
    The following is my ::item command, i want it so that you cant spawn items/food while you are in :its.

    Code:
    if (playerCommand.startsWith("item")) {
    						             if(c.inWild()) {
                    c.sendMessage("You cannnot spawn in the wild!");
                     return;
    				 }
    				try {
    					String[] args = playerCommand.split(" ");
    			if (args.length == 3) {
    						int newItemID = Integer.parseInt(args[1]);
    						int newItemAmount = Integer.parseInt(args[2]);
    			if (c.playerRights != 4) {
    						for(int rItem : Config.NON_SPAWNABLE) {
    			if(newItemID == rItem) {
                             c.sendMessage("This is a PkPoint item check the shops!");
                                    return;
                                }
                            }
    					}
    			if ((newItemID <= 30000) && (newItemID >= 0)) {
    						c.getItems().addItem(newItemID, newItemAmount);		
    				} else {
    						c.sendMessage("That item ID does not exist.");
    					}
    				} else {
    						c.sendMessage("Wrong usage: (Ex:(::pickup_ID_Amount)(::item 995 1))");
    					}
    				} catch(Exception e) {
    					
    			}
    		}
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Aug 2011
    Posts
    2,760
    Thanks given
    297
    Thanks received
    534
    Rep Power
    1596
    Code:
    if(c.inPits()) {
                    c.sendMessage("You cannnot spawn in fight pits!");
                     return;
    or

    Code:
    if (playerCommand.startsWith("item")) {
    						             if(c.inWild() || c.inPits()) {
                    c.sendMessage("You cannnot spawn here!");
                     return;
    				 }
    				try {
    					String[] args = playerCommand.split(" ");
    			if (args.length == 3) {
    						int newItemID = Integer.parseInt(args[1]);
    						int newItemAmount = Integer.parseInt(args[2]);
    			if (c.playerRights != 4) {
    						for(int rItem : Config.NON_SPAWNABLE) {
    			if(newItemID == rItem) {
                             c.sendMessage("This is a PkPoint item check the shops!");
                                    return;
                                }
                            }
    					}
    			if ((newItemID <= 30000) && (newItemID >= 0)) {
    						c.getItems().addItem(newItemID, newItemAmount);		
    				} else {
    						c.sendMessage("That item ID does not exist.");
    					}
    				} else {
    						c.sendMessage("Wrong usage: (Ex:(::pickup_ID_Amount)(::item 995 1))");
    					}
    				} catch(Exception e) {
    					
    			}
    		}
    Quote Originally Posted by Aj View Post
    This is not even a tutorial. It's fail for rep. It's fail for life.
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Jul 2011
    Posts
    692
    Thanks given
    169
    Thanks received
    43
    Rep Power
    0
    this is my error:

    Code:
    src\server\model\players\packets\Commands.java:46: cannot find symbol
    symbol  : method inPits()
    location: class server.model.players.Client
    if(c.inPits()) {
        ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    Reply With Quote  
     

  4. #4  
    Donator


    Join Date
    Jun 2011
    Posts
    2,549
    Thanks given
    539
    Thanks received
    402
    Rep Power
    683
    Quote Originally Posted by JokerScape View Post
    this is my error:

    Code:
    src\server\model\players\packets\Commands.java:46: cannot find symbol
    symbol  : method inPits()
    location: class server.model.players.Client
    if(c.inPits()) {
        ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    Then just simply look for the method thats the equivalent. If you can't find it, then simply add the method or whatever, declare and add imports.

    player.java

    Code:
    public boolean inPits = false
    public int pitsStatus = 0;
    All the best,
    Nirvana

    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Aug 2011
    Posts
    2,760
    Thanks given
    297
    Thanks received
    534
    Rep Power
    1596
    Quote Originally Posted by spikeyyy View Post
    Code:
    if(c.inPits()) {
                    c.sendMessage("You cannnot spawn in fight pits!");
                     return;
    or

    Code:
    if (playerCommand.startsWith("item")) {
    						             if(c.inWild() || c.inPits()) {
                    c.sendMessage("You cannnot spawn here!");
                     return;
    				 }
    				try {
    					String[] args = playerCommand.split(" ");
    			if (args.length == 3) {
    						int newItemID = Integer.parseInt(args[1]);
    						int newItemAmount = Integer.parseInt(args[2]);
    			if (c.playerRights != 4) {
    						for(int rItem : Config.NON_SPAWNABLE) {
    			if(newItemID == rItem) {
                             c.sendMessage("This is a PkPoint item check the shops!");
                                    return;
                                }
                            }
    					}
    			if ((newItemID <= 30000) && (newItemID >= 0)) {
    						c.getItems().addItem(newItemID, newItemAmount);		
    				} else {
    						c.sendMessage("That item ID does not exist.");
    					}
    				} else {
    						c.sendMessage("Wrong usage: (Ex:(::pickup_ID_Amount)(::item 995 1))");
    					}
    				} catch(Exception e) {
    					
    			}
    		}
    It might be isinpits, inPits. Inpits or IsInPits dependant on what the name is.
    Quote Originally Posted by Aj View Post
    This is not even a tutorial. It's fail for rep. It's fail for life.
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Jul 2011
    Posts
    692
    Thanks given
    169
    Thanks received
    43
    Rep Power
    0
    Quote Originally Posted by spikeyyy View Post
    It might be isinpits, inPits. Inpits or IsInPits dependant on what the name is.

    Look at my Player.Java for pits method:

    Code:
    	/**
    	 * Fight Pits
    	 */
    	public boolean inPits = false;
    	public int pitsStatus = 0;
    its inPits
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    Aug 2011
    Posts
    2,760
    Thanks given
    297
    Thanks received
    534
    Rep Power
    1596
    Quote Originally Posted by JokerScape View Post
    Look at my Player.Java for pits method:

    Code:
    	/**
    	 * Fight Pits
    	 */
    	public boolean inPits = false;
    	public int pitsStatus = 0;
    its inPits
    Make inPits > inPits = true;
    Quote Originally Posted by Aj View Post
    This is not even a tutorial. It's fail for rep. It's fail for life.
    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. [DEMENTHIUM] Object spawning command
    By `leon in forum Snippets
    Replies: 6
    Last Post: 08-18-2011, 10:46 AM
  2. [BS] Best object spawning command
    By *~Pwnt~* in forum Snippets
    Replies: 5
    Last Post: 04-12-2010, 01:23 AM
  3. ::object spawning command
    By Aaron C. in forum Requests
    Replies: 1
    Last Post: 04-26-2009, 06:04 PM
  4. Npc spawning command
    By jareq in forum Requests
    Replies: 7
    Last Post: 02-13-2009, 02:56 AM
  5. Pits command with full jungle demon
    By zilchuary in forum Tutorials
    Replies: 14
    Last Post: 02-25-2008, 09:55 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
  •