Jump to content

guildstorage 40k help


Recommended Posts

Help me please!!!!

		function insert_item(cell,slot,tab)
			item.select_cell(cell)
			local attr = {{item.get_attr_type(0),item.attr_value(0)}, {item.get_attr_type(1),item.attr_value(1)}, {item.get_attr_type(2),item.attr_value(2)}, {item.get_attr_type(3),item.attr_value(3)},{item.get_attr_type(4),item.attr_value(4)},{item.get_attr_type(5),item.attr_value(5)},{item.get_attr_type(6),item.attr_value(6)}}
			local socket, itemVnum, itemCount = {item.get_socket(0), item.get_socket(1), item.get_socket(2),item.get_socket(3),item.get_socket(4),item.get_socket(5)}, item.get_vnum(), item.get_count()     
			if not guildstorage.item_can_store(itemVnum) then syschat'Dieses Item kann nicht gelagert werden.' return end
			guildstorage.add_log(pc.get_name(),'Item','einlagern',item_name(itemVnum)..' ('..itemCount..')')
			local guildstorage = io.open("/".."Guildstorage/"..pc.get_guild().."/storage.txt", "a+")
			if not pc.can_warp() then return end
			item.select(cell)
			if item.vnum == 0 then return end
			--if item.rem(item.get_count()) then
			item.remove()
			guildstorage:write(itemVnum.."#"..itemCount.."#"..(slot+120*tab).."#"..socket[1].."#"..socket[2].."#"..socket[3].."#"..socket[4].."#"..socket[5].."#"..socket[6].."#"..attr[1][1].."#"..attr[1][2].."#"..attr[2][1].."#"..attr[2][2].."#"..attr[3][1].."#"..attr[3][2].."#"..attr[4][1].."#"..attr[4][2].."#"..attr[5][1].."#"..attr[5][2].."#"..attr[6][1].."#"..attr[6][2].."#"..attr[7][1].."#"..attr[7][2].."n")
			guildstorage:flush()
			guildstorage:close()
			cmdchat('GUILDSTORAGE_ADDITEMSLOT '..slot..' '..tab..' '..itemVnum..' '..itemCount..' '..socket[1]..' '..socket[2]..' '..socket[3]..' '..socket[4]..' '..socket[5]..' '..socket[6]..' '..attr[1][1]..' '..attr[1][2]..' '..attr[2][1]..' '..attr[2][2]..' '..attr[3][1]..' '..attr[3][2]..' '..attr[4][1]..' '..attr[4][2]..' '..attr[5][1]..' '..attr[5][2]..' '..attr[6][1]..' '..attr[6][2]..' '..attr[7][1]..' '..attr[7][2])
			--else
				--syschat("Du hast das Item nicht mehr")
			--end
		end

works, but, he doubles stacked item...

 

--if item.rem(item.get_count()) then << no works.

help me '-'

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 13

      Metin2 Closed Beta Content (2003-2004)

    2. 25

      [SRC] Metin2 on LINUX - The Old Metin2 Project

    3. 2

      United/Club/Midgard serverfiles?

    4. 13

      Metin2 Closed Beta Content (2003-2004)

    5. 13

      Metin2 Closed Beta Content (2003-2004)

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.