Thread: Keys opening houses(Pi erased pkz)

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 Keys opening houses(Pi erased pkz) 
    So when I'm free, I'm free


    Jay Gatsby's Avatar
    Join Date
    Jun 2010
    Posts
    2,307
    Thanks given
    1,148
    Thanks received
    1,982
    Rep Power
    5000
    Hey so i was wondering if anyone could tell me how to make it so when you have a key,and click a door,it gets you through the door ONLY if you have the key. If you dont have the key it says " This house is not currently owned by you.To own a house ,look on the forums for the donator packages".
    If anyone could give me a tutorial or code for this then i would greatly appreciate it
    I'm using Pi erased pkz.
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Jan 2012
    Posts
    22
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    case OBJECTID:
    if(c.getItems().playerHasItem(KEYID, 1) {
    Move the player to the cordinates through door or w.e u want
    } else {
    c.sendMessage("This house is not currently owned by you.");
    }
    break;
    Reply With Quote  
     

  3. #3  
    So when I'm free, I'm free


    Jay Gatsby's Avatar
    Join Date
    Jun 2010
    Posts
    2,307
    Thanks given
    1,148
    Thanks received
    1,982
    Rep Power
    5000
    Kai would that go in clickingbuttons.java? And also for the teleing,what would it be? Thanks for the code
    Reply With Quote  
     

  4. #4  
    Banned
    Join Date
    Jan 2012
    Posts
    22
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Is this when u push a door (object) or a button (clickingbutton)?
    Reply With Quote  
     

  5. #5  
    So when I'm free, I'm free


    Jay Gatsby's Avatar
    Join Date
    Jun 2010
    Posts
    2,307
    Thanks given
    1,148
    Thanks received
    1,982
    Rep Power
    5000
    Door
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Jan 2012
    Posts
    22
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    find:
    Code:
    firstClickObject
    In ActionHandler.java
    Then under it somewhere you should see:
    Code:
    switch(objectType) {
    Under that add:
    Code:
    case DOORID:
    if(c.getItems().playerHasItem(KEYID, 1) {
    c.getPA().movePlayer(TELEX, TELEY, c.heightLevel);
    } else {
    c.sendMessage("This house is not currently owned by you.");
    }
    break;
    Replace those telex/teley ect with you're variables/loactions/ids or w.e
    Reply With Quote  
     

  7. #7  
    Registered Member
    Naughty Panda's Avatar
    Join Date
    Dec 2007
    Posts
    631
    Thanks given
    12
    Thanks received
    46
    Rep Power
    347
    Seems I got beaten to it.. oh well. ^ ^ ^


    In ActionHandler (in firstClickObject method, under the switch statement):

    Code:
    case DOOR_ID:
    if(c.getItems().playerHasItem(KEY_ID, 1)) {
    	c.getPA().startTeleport(TO_X, TO_Y, TO_HEIGHT, "modern"); // If you want tele with animation... otherwise delete this.
    	c.getPA().movePlayer(TO_X, TO_Y); //If you want the player to teleport without the teleport graphics/animation. Otherwise delete this.
    } else {
    	c.sendMessage("This house is not owned by you.");
    	c.sendMessage("To buy a house, look at the donator packages on the forums.");
    }
    break;
    Reply With Quote  
     

  8. Thankful user:


  9. #8  
    Banned
    Join Date
    Jan 2012
    Posts
    22
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Naughty Panda View Post
    Seems I got beaten to it.. oh well. ^ ^ ^


    In ActionHandler (in firstClickObject method, under the switch statement):

    Code:
    case DOOR_ID:
    if(c.getItems().playerHasItem(KEY_ID, 1)) {
    	c.getPA().startTeleport(TO_X, TO_Y, TO_HEIGHT, "modern"); // If you want tele with animation... otherwise delete this.
    	c.getPA().movePlayer(TO_X, TO_Y); //If you want the player to teleport without the teleport graphics/animation. Otherwise delete this.
    } else {
    	c.sendMessage("This house is not owned by you.");
    	c.sendMessage("To buy a house, look at the donator packages on the forums.");
    }
    break;
    noshit sherlock?
    Reply With Quote  
     

  10. #9  
    Registered Member
    Naughty Panda's Avatar
    Join Date
    Dec 2007
    Posts
    631
    Thanks given
    12
    Thanks received
    46
    Rep Power
    347
    Quote Originally Posted by InsanityXLikeABoss! View Post
    noshit sherlock?
    Yeah I noticed you did it first.

    But yours would cause an error (simple fix but still, he probably wouldn't work it out) and yours looks like shit anyway.
    Reply With Quote  
     

  11. #10  
    Banned
    Join Date
    Jan 2012
    Posts
    22
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Naughty Panda View Post
    Yeah I noticed you did it first.

    But yours would cause an error (simple fix but still, he probably wouldn't work it out) and yours looks like shit anyway.
    Hello Moron, could you state what i did wrong?
    And How does mine look like shit when you're is 80% identical
    Says you lmao teleporting the player then moving them? Lol.
    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. Erased-Pkz | 90% Summoning | Full screen
    By Moe in forum Downloads
    Replies: 80
    Last Post: 06-08-2012, 06:08 AM
  2. [PI] Erased pkz pc portal respawning
    By Yelser3 in forum Help
    Replies: 16
    Last Post: 09-22-2011, 06:04 PM
  3. erased-pkz
    By jtag12 in forum Advertise
    Replies: 1
    Last Post: 09-13-2011, 04:21 AM
  4. Wierd glitch [erased pkz]
    By Mocco in forum Help
    Replies: 3
    Last Post: 08-13-2011, 08:30 AM
  5. PI dupe on erased Pkz
    By Vindicus in forum Help
    Replies: 5
    Last Post: 07-06-2011, 02:32 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
  •