there is way to get multiple items?

Results 1 to 8 of 8
  1. #1
    Account Upgraded | Title Enabled! snow202 is offline
    MemberRank
    Dec 2011 Join Date
    213Posts

    there is way to get multiple items?

    i want to make npc that give more then 1 item(like 3-5 for each selection), but i dont want to write every time "cm.gainItem();".
    so i want to know if there way to do like this one:
    PHP Code:
        var txt "Here your items:\r\n"
        
    for (var i=0;i<set1.length;i++)
        
    txt+= "#i"+set1[i]+"# - #z"+set1[i]+"#\r\n";
        
    cm.sendOk(txt);
        
    cm.gainItem(set1[selection], 1); 
    (it doesnt work)


  2. #2
    Member whichboy is offline
    MemberRank
    Sep 2009 Join Date
    79Posts

    Re: there is way to get multiple items?

    If I'm not wrong, you missed out this..
    #L<number># #l <-- Selections
    PHP Code:
    text += "\r\n#L" "##i"+set1[i]+"# - #z"+set1[i]+"##l"
    Additionally, I think you may need to have a new status for the gainItem, as well as use cm.sendSimple(text); instead of sendOk();

  3. #3
    Account Upgraded | Title Enabled! snow202 is offline
    MemberRank
    Dec 2011 Join Date
    213Posts

    Re: there is way to get multiple items?

    Quote Originally Posted by whichboy View Post
    If I'm not wrong, you missed out this..
    #L<number># #l <-- Selections
    PHP Code:
    text += "\r\n#L" "##i"+set1[i]+"# - #z"+set1[i]+"##l"
    Additionally, I think you may need to have a new status for the gainItem, as well as use cm.sendSimple(text); instead of sendOk();
    yea i know there some things i need add, but im trying fix the gainItem error. And im using a new status O.o. I like more sendOk because it make Ok button down-right. and sendSimple making Next button where the text is(hard to expain..). any way there is a way to do it? :(

  4. #4
    Account Upgraded | Title Enabled! Syre is offline
    MemberRank
    Jan 2013 Join Date
    700Posts

    Re: there is way to get multiple items?

    Yes you can. Post your gainItem function.

  5. #5
    $_SESSION['DEV']; hecari is offline
    MemberRank
    Dec 2008 Join Date
    336Posts

    Re: there is way to get multiple items?

    PHP Code:
    var txt "Here your items:\r\n"
        
    for (var i=0;i<set1.length;i++) {
        
    txt+= "#L"+i+"##i"+set1[i]+"# - #z"+set1[i]+"##l\r\n";
        }
        
    cm.sendOk(txt);
    } else if(
    status == <next status>) {
        
    cm.gainItem(set1[selection], 1);
        
    cm.sendOk("Thank you");


  6. #6
    That one pokemon thing Luxray is offline
    MemberRank
    Apr 2010 Join Date
    2,043Posts

    Re: there is way to get multiple items?

    Quote Originally Posted by hecari View Post
    PHP Code:
    var txt "Here your items:\r\n"
        
    for (var i=0;i<set1.length;i++) {
        
    txt+= "#L"+i+"##i"+set1[i]+"# - #z"+set1[i]+"##l\r\n";
        }
        
    cm.sendOk(txt);
    } else if(
    status == <next status>) {
        
    cm.gainItem(set1[selection], 1);
        
    cm.sendOk("Thank you");

    Way a selection if you use sendok?

    Sent from tapatalk

    Why*
    Tapatalk seems to like to mess with me.

    Sent from tapatalk

  7. #7
    $_SESSION['DEV']; hecari is offline
    MemberRank
    Dec 2008 Join Date
    336Posts

    Re: there is way to get multiple items?

    Quote Originally Posted by The Sharingan View Post
    Way a selection if you use sendok?

    Sent from tapatalk

    Why*
    Tapatalk seems to like to mess with me.

    Sent from tapatalk
    Lithium has a check, if it contain #L# # it will automatically convert to sendSimple.

  8. #8
    Account Upgraded | Title Enabled! snow202 is offline
    MemberRank
    Dec 2011 Join Date
    213Posts

    Re: there is way to get multiple items?

    Quote Originally Posted by hecari View Post
    Lithium has a check, if it contain #L# # it will automatically convert to sendSimple.
    ok can you explain me why i need to do it(and what is it on the red):
    else if(status == <next status>) {



Advertisement