Thread: Right click options on an item

Results 1 to 8 of 8
  1. #1 Right click options on an item 
    Registered Member Test Subject's Avatar
    Join Date
    Jun 2014
    Posts
    50
    Thanks given
    0
    Thanks received
    4
    Rep Power
    11
    So, the item I'm trying to make right click options for is very cliche. Rotten potato.

    Current right-click options:



    All I want to happen, is when I click on one of the options other than drop or use it will show an option list in the chatbox.
    The option list looks sort of like this, but with different options:



    All I have in actionhandler is this & it is under secondclickobject
    Code:
    case 5733:
    BTW, clicking 'Slice' wields the potato. I'd like to change that as well.


    If anybody knows how to do this & would like to help, I'd be very grateful! Thanks!

    just.knowing
    Reply With Quote  
     

  2. #2  
    Registered Member Tatsuya's Avatar
    Join Date
    Dec 2011
    Posts
    335
    Thanks given
    74
    Thanks received
    52
    Rep Power
    61
    The problem is that it's under secondClickObject. It should go into the options for items NOT objects.
    Reply With Quote  
     

  3. #3  
    Registered Member Test Subject's Avatar
    Join Date
    Jun 2014
    Posts
    50
    Thanks given
    0
    Thanks received
    4
    Rep Power
    11
    Quote Originally Posted by Drenkai View Post
    The problem is that it's under secondClickObject. It should go into the options for items NOT objects.
    Oh, derp.

    just.knowing
    Reply With Quote  
     

  4. #4  
    Extreme Donator


    Join Date
    Sep 2014
    Posts
    139
    Thanks given
    98
    Thanks received
    92
    Rep Power
    1287
    To fix the wield thing, go into your wield item packet handling class (probably WieldItem or WearItem for PI, I kinda forget), and add a return statement for that item ID.

    if (i == 5733) {
    //put the stuff you actually want it to do before the return statement.
    return;
    }

    The stuff you put in the curly braces before the return statement will execute when you click that option, and the return statement stops it from wielding the potato.
    Attached image
    Reply With Quote  
     

  5. #5  
    Registered Member Test Subject's Avatar
    Join Date
    Jun 2014
    Posts
    50
    Thanks given
    0
    Thanks received
    4
    Rep Power
    11
    Quote Originally Posted by Save View Post
    To fix the wield thing, go into your wield item packet handling class (probably WieldItem or WearItem for PI, I kinda forget), and add a return statement for that item ID.

    if (i == 5733) {
    //put the stuff you actually want it to do before the return statement.
    return;
    }

    The stuff you put in the curly braces before the return statement will execute when you click that option, and the return statement stops it from wielding the potato.
    317 pi so it'd be

    case 5733:
    stuff i want
    return;
    break;

    correct?

    just.knowing
    Reply With Quote  
     

  6. #6  
    Extreme Donator


    Join Date
    Sep 2014
    Posts
    139
    Thanks given
    98
    Thanks received
    92
    Rep Power
    1287
    Quote Originally Posted by Test Subject View Post
    317 pi so it'd be

    case 5733:
    stuff i want
    return;
    break;

    correct?
    Well, that means you just have a switch statement for the item id, you'll see something like:

    switch (itemId) {
    case 1:
    break;
    etc..
    }

    Just put what I said before outside of the switch statement, or try this:

    case 5733:
    //stuff you want to happen
    return;
    Attached image
    Reply With Quote  
     

  7. #7  
    Registered Member Test Subject's Avatar
    Join Date
    Jun 2014
    Posts
    50
    Thanks given
    0
    Thanks received
    4
    Rep Power
    11
    Quote Originally Posted by Save View Post
    Well, that means you just have a switch statement for the item id, you'll see something like:

    switch (itemId) {
    case 1:
    break;
    etc..
    }

    Just put what I said before outside of the switch statement, or try this:

    case 5733:
    //stuff you want to happen
    return;
    So if I wanted to add those options it would look something like

    case 5733:
    c.getDH().sendOption2("Spawn Item", "Give Item");
    return;

    Probably not correct, doing this from memory on my phone.

    just.knowing
    Reply With Quote  
     

  8. #8  
    Extreme Donator


    Join Date
    Sep 2014
    Posts
    139
    Thanks given
    98
    Thanks received
    92
    Rep Power
    1287
    Quote Originally Posted by Test Subject View Post
    So if I wanted to add those options it would look something like

    case 5733:
    c.getDH().sendOption2("Spawn Item", "Give Item");
    return;

    Probably not correct, doing this from memory on my phone.
    I am not familiar with P.I's dialogue system, but yes, that would execute that code and stop it from wielding the potato.
    Attached image
    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 right click option bug only on players
    By syndrome-scape in forum Help
    Replies: 2
    Last Post: 07-07-2013, 06:18 PM
  2. Right click ban on an interface?
    By Jaiden Watling in forum Help
    Replies: 0
    Last Post: 12-23-2012, 07:51 AM
  3. Replies: 3
    Last Post: 12-07-2011, 01:48 AM
  4. Replies: 5
    Last Post: 07-06-2009, 01:41 AM
  5. New right click option on player.
    By b1untma/\/ in forum Help
    Replies: 0
    Last Post: 04-23-2009, 04:23 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
  •