Jump to content
  • 0

This error keep appear at my putty...


joyy95

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.09
  • Content Count:  51
  • Reputation:   0
  • Joined:  06/28/23
  • Last Seen:  

[Error]: builtin_npcshopitem: Item ID 0 does not exist.
This error keep appear at my putty... only i solved the script it will sell the orange potion at my shop too.



-    shop    dynamicshop    -1,502:-1
lasa_fild01,197,211,4    script    Usable Shop    10057,{

    callshop "dynamicshop",1;
    npcshopattach "dynamicshop";
    end;
    
    OnBuyItem:
        for ( set .@j, 0; .@j < getarraysize(.items); set .@j, .@j + 2 ) {
            for ( set .@k, 0; .@k < getarraysize(@bought_nameid); set .@k, .@k + 1 ) {
                if ( @bought_nameid[.@k] == .items[.@j] ) {
                    if ( checkweight( @bought_nameid[.@k], @bought_quantity[.@k] ) ) {
                        if ( countitem(.currency) < .items[.@j+1] || countitem(.currency) < ( .items[.@j+1] * @bought_quantity[.@k] ) )
                            dispbottom "You don't have enough " +getitemname(.currency)+ " to purchase this item.";
                        else {
                            delitem .currency, .items[.@j+1] * @bought_quantity[.@k];
                            getitem @bought_nameid[.@k], @bought_quantity[.@k];
                        }
                    } else dispbottom "You cannot carry out more items with you";
                }
            }
        }
        deletearray @bought_quantity, getarraysize(@bought_quantity);
        deletearray @bought_nameid, getarraysize(@bought_nameid);
        end;

    OnInit:
        set .currency, 7420; // Skull is used to buy items
        setarray .items, 13550,10,7776,50,12020,5,12118,5,12119,5,12120,5,12121,5,13891,20,13892,20,13893,20,13894,20,12114,3,12115,3,12116,3,12117,3,12210,50,13604,150,13592,150,13578,150,13596,150,13572,150,13574,150,12214,10,12031,5,12029,5,12030,5,12033,5,12028,5; // Usage : <item id>,<price>
       npcshopitem "dynamicshop",0,0;
        for ( set .@i, 0; .@i < getarraysize(.items); set .@i, .@i + 2 ) {
            if (.items[.@i] != 0) { // Check if item ID is not 0
                npcshopadditem "dynamicshop",.items[.@i],.items[.@i+1];
            }
        }
        end;
}

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  898
  • Reputation:   119
  • Joined:  05/23/12
  • Last Seen:  

Try change

setarray .items

 

To

setarray .items[0]

 

Rynbef~

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...