Jump to content

Recommended Posts

Here`s the thing , i made a system that remove some items that has the timestamp < then get_date()

the thing is it dosen`t remove the item.. i burned my brains out but no succes.

Heres my code

 

GAME 2089

when login  begin
        local getCostume = {
                41003,
                41004,
                41005,
                41006,             
            }
        for i = 1,table.getn(getCostume),1 do
            if(pc.count_item(getCostume[i]) >= 1 ) then
                    item.select(getCostume[i])
                    if item.get_socket(0) <= get_time() then
                    pc.remove_item()
                    end
            end
        end
    end

how can i make it remove the items that got socket0 < get_time() ? tyvm.

Link to comment
https://metin2.dev/topic/1858-remove-multiple-item-quest-problem/
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

try this:

when login  begin
    local getCostume = {
            41003,
            41004,
            41005,
            41006,             
        }
    for slot = 0, 90 do
        if item.select_cell(slot) then
            for i = 1,table.getn(getCostume),1 do
                if(pc.count_item(getCostume[i]) >= 1 ) then
                    if item.get_socket(0) <= get_time() then
                        item.remove()
                    end
                end
            end
        end
    end
end
  • 2 weeks later...
quest limitTime begin
	state start begin
		when login or levelup or enter begin
			setskin(NOWINDOW)
			local costumeList = {
				41003,
				41004,
				41005,
				41006,
			}
			for i = 1,table.getn(costumeList),1 do
				if(pc.get_part(19) >= costumeList[i]) then
					syschat("You need to unequip this item from your equipment.")
				else			
					local select = item.select(costumeList[i])				
					if(get_global_time() - pc.getf("limitTime",costumeList[i].."_time") < item.get_socket(0)) then
						pc.remove_item(costumeList[i])
					end
					item.select(select)
				end
			end
		end
		when click with item.vnum >= 41003 and item.vnum <= 41006 begin
			pc.setf("limitTime",item.vnum.."_time",get_global_time())
		end
	end
end

If item is equipped, system warning to him.

 

Best Regards 

Ellie

Do not be sorry, be better.

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.