Thread: Placing down a crate + destroying it

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 Placing down a crate + destroying it 
    Registered Member
    Join Date
    Nov 2013
    Posts
    7
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Hi, i have a question. How could i make it so when i click a crate in inventory (id 7630), it would get placed under me as an object (id 1 for the object), and it could get destroyed if clicked on it.
    and i would not be able to walk through it

    could somebody help me out?
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    I assume you have PI

    In ClickItem.java under switch(itemId) {
    Code:
    case itemId:
    c.getObject().createAnObject(c, 1, c.absX, c.absY);
    break;
    and in ActionHandler.java under switch(objectType) {
    Code:
    case 1:
    c.getObject().createAnObject(c, -1, obX, obY);
    break;
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Nov 2013
    Posts
    7
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Nighel View Post
    I assume you have PI

    In ClickItem.java under switch(itemId) {
    Code:
    case itemId:
    c.getObject().createAnObject(c, 1, c.absX, c.absY);
    break;
    and in ActionHandler.java under switch(objectType) {
    Code:
    case 1:
    c.getObject().createAnObject(c, -1, obX, obY);
    break;


    this error : Screenshot by Lightshot

    also i dont have switch(itemId) { in my clickitem.java

    Heres my clickitem . java
    pastebin.com/vK9igujF
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Nov 2013
    Posts
    7
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    and here is the actionhandelr actionhandler - Pastebin.com
    Reply With Quote  
     

  5. #5  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Quote Originally Posted by ponytail789 View Post
    this error : Screenshot by Lightshot

    also i dont have switch(itemId) { in my clickitem.java

    Heres my clickitem . java
    pastebin.com/vK9igujF
    http://puu.sh/5Otzf.txt

    and this in your client.java
    Code:
    	private ObjectHandler object = new ObjectHandler();
    	
    	public ObjectHandler getObject() {
    		return object;
    	}
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Nov 2013
    Posts
    7
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Nighel View Post
    http://puu.sh/5Otzf.txt

    and this in your client.java
    Code:
    	private ObjectHandler object = new ObjectHandler();
    	
    	public ObjectHandler getObject() {
    		return object;
    	}
    Thanks, but one more thing : Screenshot by Lightshot

    why is it like that?
    Reply With Quote  
     

  7. #7  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Code:
    import server.world.ObjectHandler;
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Nov 2013
    Posts
    7
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Nighel View Post
    http://puu.sh/5Otzf.txt

    and this in your client.java
    Code:
    	private ObjectHandler object = new ObjectHandler();
    	
    	public ObjectHandler getObject() {
    		return object;
    	}
    i imported to client.java, and now it says Screenshot by Lightshot
    Reply With Quote  
     

  9. #9  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    You do not have the object system most pi's have then
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Nov 2013
    Posts
    7
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Nighel View Post
    You do not have the object system most pi's have then
    This is my objecthandler asd - Pastebin.com
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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. Will mankind destroy it self?
    By Rusko in forum Chat
    Replies: 11
    Last Post: 11-14-2012, 12:34 AM
  2. Replies: 9
    Last Post: 08-05-2009, 01:15 PM
  3. Replies: 2
    Last Post: 05-16-2009, 09:10 PM
  4. Usertitles, digging this place down.
    By Inside Sin in forum Complaints
    Replies: 8
    Last Post: 05-10-2009, 08:36 PM
  5. Replies: 1
    Last Post: 02-06-2008, 11:47 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
  •