Thread: [PI] Dialogue help please.

Results 1 to 7 of 7
  1. #1 [PI] Dialogue help please. 
    Registered Member
    Join Date
    Aug 2013
    Posts
    112
    Thanks given
    12
    Thanks received
    3
    Rep Power
    11
    I've added a dialogue that gives you dragon claws when you talk to an NPC. I've gotten it almost finished the only problem is that lets say you have 25M and claws were 25M , it takes the 25M and gives you claws BUT. you can just come with like 1GP and you'll still get the claws.. anybody know how I can make it so you need the exact amount of 25M? thanks.
    Reply With Quote  
     

  2. #2  
    Registered Member WhatSarcasm's Avatar
    Join Date
    Sep 2013
    Posts
    42
    Thanks given
    0
    Thanks received
    1
    Rep Power
    32
    Add an if statement, that checks the players inventory for the exact amount and removes the exact amount
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Aug 2013
    Posts
    112
    Thanks given
    12
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by WhatSarcasm View Post
    Add an if statement, that checks the players inventory for the exact amount and removes the exact amount
    this is what I have so far. doesn't work.
    Code:
    			} else if(c.dialogueAction == 23) {
    					if(!c.getItems().playerHasItem(995,25000000));
    					c.sendMessage("You don't have enough money!");
    					c.getPA().removeAllWindows();
    					c.getItems().addItem(14484,1); 
    					c.getItems().deleteItem(995,
    					c.getItems().getItemSlot(995), 25000000);	
    					c.nextChat = 23;
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    May 2013
    Posts
    1,169
    Thanks given
    28
    Thanks received
    133
    Rep Power
    53
    Y
    Quote Originally Posted by herpityderp View Post
    this is what I have so far. doesn't work.
    Code:
    			} else if(c.dialogueAction == 23) {
    					if(!c.getItems().playerHasItem(995,25000000));
    					c.sendMessage("You don't have enough money!");
    					c.getPA().removeAllWindows();
    					c.getItems().addItem(14484,1); 
    					c.getItems().deleteItem(995,
    					c.getItems().getItemSlot(995), 25000000);	
    					c.nextChat = 23;
    Lol...

    [code]
    } else if(c.dialogueAction == 23) {
    if(c.getItems().playerHasItem(995,25000000)) {
    c.getPA().removeAllWindows();
    c.getItems().addItem(14484,1);
    c.getItems().deleteItem(995,
    c.getItems().getItemSlot(995), 25000000);
    c.nextChat = 23;
    } else {
    c.sendMessage("You need to suck a penis");
    }
    If only I hadn't given you up, my life could've been different.
    Reply With Quote  
     

  5. #5  
    The Meme God

    4DFo's Avatar
    Join Date
    Dec 2013
    Age
    26
    Posts
    616
    Thanks given
    54
    Thanks received
    81
    Rep Power
    185
    Code:
    } else if(c.dialogueAction == 23) {
    
    					if (c.getItems().playerHasItem(995,25000000));
                                            c.getItems().addItem(14484,1); 
    					c.getItems().getItemSlot(995), 25000000);	
    					c.getItems().deleteItem(995, 25000000)
    					} else {
                                            if (!c.getItems().playerHasItem(995,25000000));
    					c.sendMessage("You don't have enough money!");
    					c.getPA().removeAllWindows();
    }
    ****

    First of all. Your method was mixed up x500000.
    You had it set to if the player does not have 25000000gp then it'll give the claws either way.
    You need to pay attention to what you've coded imo.

    EDIT: DAMMMIT. I'm lazy at coding.
    So excuse my mistakes.
    Also, i probably just fked that code up too. Hold on.

    Attached image
    Attached image
    Rest easy, Brian x2. Suicide is never the answer.
    Reply With Quote  
     

  6. #6  
    The Meme God

    4DFo's Avatar
    Join Date
    Dec 2013
    Age
    26
    Posts
    616
    Thanks given
    54
    Thanks received
    81
    Rep Power
    185
    Quote Originally Posted by Menthol View Post
    Code:
    } else if(c.dialogueAction == 23) {
    
    					if (c.getItems().playerHasItem(995,25000000));
                                            c.getItems().addItem(14484,1); 
    					c.getItems().getItemSlot(995), 25000000);	
    					c.getItems().deleteItem(995, 25000000)
    					} else {
                                            if (!c.getItems().playerHasItem(995,25000000));
    					c.sendMessage("You don't have enough money!");
    					c.getPA().removeAllWindows();
    }
    ****

    First of all. Your method was mixed up x500000.
    You had it set to if the player does not have 25000000gp then it'll give the claws either way.
    You need to pay attention to what you've coded imo.

    EDIT: DAMMMIT. I'm lazy at coding.
    So excuse my mistakes.
    Also, i probably just fked that code up too. Hold on.
    Or you could add a requirement. like req(int);
    or some sht like that.

    Attached image
    Attached image
    Rest easy, Brian x2. Suicide is never the answer.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Aug 2013
    Posts
    112
    Thanks given
    12
    Thanks received
    3
    Rep Power
    11
    Quote Originally Posted by Menthol View Post
    Or you could add a requirement. like req(int);
    or some sht like that.
    thanks, that helped but now I get an "else without if" error for the seperate code below-_-
    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] Dialogue help please....?
    By xxcodyxxfish in forum Help
    Replies: 10
    Last Post: 08-04-2011, 08:53 PM
  2. [PI] Dialogue help please....
    By xxcodyxxfish in forum Help
    Replies: 3
    Last Post: 08-03-2011, 09:37 PM
  3. [PI] SendQuest Help Please!
    By klearn1994 in forum Help
    Replies: 3
    Last Post: 10-23-2010, 11:00 PM
  4. [PI]Little help please
    By Richie in forum Help
    Replies: 2
    Last Post: 08-04-2010, 04:42 PM
  5. PI/riotscape help please.
    By Genc in forum Help
    Replies: 3
    Last Post: 06-09-2010, 02:49 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
  •