Jump to content
  • 0

Custom Storage


caspa

Question


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

Can somebody help me on this script?

i would like the script to do when using the cookie bag item...

 

the item 12130 will be ignored coz if i click the
bag, the cookie bag is also shown on the menu... and i'm thinking what
if the player accidentally stores the bag? how will they open the
storage again....


also can somebody point out what's the max item the custom storage can hold? can it hold 600
different items also? if it can hold 600 items can i limit it to 100 or
150 only?

Name :  Bag (SQL)
Creator : Goddameit
Script Details : 

 
function    script    CustomStorage    {
function    clean    {
deletearray @n[0],128;
deletearray @nam[0],128;
deletearray @nid[0],128;
deletearray @inventorylist_id[0],128;
deletearray @inventorylist_amount[0],128;
deletearray @inventorylist_equip[0],128;
deletearray @inventorylist_refine[0],128;
deletearray @inventorylist_identify[0],128;
deletearray @inventorylist_attribute[0],128;
deletearray @inventorylist_card1[0],128;
deletearray @inventorylist_card2[0],128;
deletearray @inventorylist_card3[0],128;
deletearray @inventorylist_card4[0],128;
deletearray @inventorylist_expire[0],128;
set @inventorylist_count,0;
}
if(getarg(1))
{
clean;
query_sql("SELECT nameid,id,amount  FROM `custom_storage` WHERE `account_id` = "+getcharid(3)+"",@n,@nid,@nam);
set @select$,"";
for(set .@i,0;.@i<getarraysize(@n);set .@i,.@i+1)
set @select$,@select$+":[^0000ff"+getitemname(@n[.@i])+"^000000]x[^ff0000"+@nam[.@i]+"^000000]";
message strcharinfo(0),"Input 0 To Pick All";
if(input(@ss,1,@nam[set(@menu,select(@select$)-2)]))
set @ss,@nam[@menu];
getitem @n[@menu],@ss;
if(set(.@zz,@nam[@menu]-@ss)>0)
query_sql "UPDATE `custom_storage` set amount = "+.@zz+" where id = "+@nid[@menu];
else
query_sql "DELETE FROM `custom_storage` WHERE `id` = "+@nid[@menu];
dispbottom "Pick Complete.";
clean;
close;
}
clean;
getinventorylist;
set @select$,"";
for(set .@i,0;.@i<@inventorylist_count;set .@i,.@i+1)
set @select$,@select$+":[^0000ff"+getitemname(@inventorylist_id[.@i])+"^000000]x[^ff0000"+@inventorylist_amount[.@i]+"^000000]";
message strcharinfo(0),"Input 0 To Store All";
if(@inventorylist_equip[set(@menu,select(@select$)-2)]||@inventorylist_expire[@menu])
{
clean;
dispbottom "Store Fail ( Unequipped The Item First )";
close;
}
if(input(@ss,1,@inventorylist_amount[@menu]))
set @ss,@inventorylist_amount[@menu];
query_sql("SELECT nameid,id,amount  FROM `custom_storage` WHERE `account_id` = "+getcharid(3)+"",.@n,.@nid,.@nam);
if(getarg(0)<getarraysize(.@n))
{
clean;
close;
}
for(set .@h,set(.@g,0);.@n[.@h];set .@h,.@h+1)
if(.@n[.@h]==@inventorylist_id[@menu])
{
if(set(.@g,getiteminfo(.@n[.@h],2))>=4&&.@g<=10&&.@g!=6)
set .@g,0;
else
set .@g,.@nam[.@h]+@ss;
break;
}
if(!.@g)
query_sql "INSERT `custom_storage` VALUES ( NULL,"+getcharid(3)+","+@inventorylist_id[@menu]+","+@ss+",0,"+@inventorylist_identify[@menu]+","+@inventorylist_refine[@menu]+","+@inventorylist_attribute[@menu]+","+@inventorylist_card0[@menu]+","+@inventorylist_card1[@menu]+","+@inventorylist_card2[@menu]+","+@inventorylist_card3[@menu]+",0)";
else
query_sql "UPDATE `custom_storage` set amount = "+.@g+" where id = "+.@nid[.@h];
delitem @inventorylist_id[@menu],@ss;
dispbottom "Store Complete.";
clean;
close;
 
inputfail:
dispbottom "Invalid Ammount.";
close;
}
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

@bump

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...