Jump to content

Remove multiple item quest problem


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
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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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