Jump to content
  • 0

Remove multiple item quest problem


lovekilz

Question

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
  • Answers 5
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

5 answers to this question

Recommended Posts

  • 0

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

one more thing tho, do u have any ideea how can i select items that are already equiped ? im using 2089, tryed with mysql , it deletes it from db, but still remains ingame.

Link to comment
  • 0
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

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.