Forum

> > CS2D > Scripts > Remove all items on ground
Forums overviewCS2D overview Scripts overviewLog in to reply

English Remove all items on ground

12 replies
To the start Previous 1 Next To the start

old Remove all items on ground

HESY
User Off Offline

Quote
I found this topic: http://unrealsoftware.de/forum_posts.php?post=294172&start=260#post378119

And take advantage of this function:
Spoiler >


But it does not work correctly.
Every minute I call a function claims and immediately spawn new items.
Spoiler >

Result: Things are removed, and new ones are not spawn

Help me

old Re: Remove all items on ground

Yates
Reviewer Off Offline

Quote
I have already tried to create a way to trigger the spawning of an item on a specific x and y. Sadly, I did not succeed. I'll see if I can make a spawnitem function for you tonight if no one else does.

old Re: Remove all items on ground

VADemon
User Off Offline

Quote
@user HESY: I think if you put spawnitems in a timer function (try 1, 15, 20, 25, 50ms delay) it might fix the issue.

Another way: add a blacklist to cleanitems() so certain items/items on a specific tile will not be removed at all

old Re: Remove all items on ground

HESY
User Off Offline

Quote
@user VADemon: With the delay was a good idea, but unfortunately does not work.
The second method not fit...

My script is not associated with the project Tibia, maybe that's the problem?

old Re: Remove all items on ground

VADemon
User Off Offline

Quote
user HESY has written
My script is not associated with the project Tibia, maybe that's the problem?

I thought I had given a misleading advice after I checked the linked thread. Because in that case GROUNDITEMS is not defined and must give you an error.
So are we talking about regular cs2d items now?

old Re: Remove all items on ground

HESY
User Off Offline

Quote
user HESY has written
So are we talking about regular cs2d items now?


Yes. About AK-47, M4A1, HE and etc..

In this case I understand that it will be impossible to remove the items?

old Re: Remove all items on ground

Cure Pikachu
User Off Offline

Quote
Nope, removing all CS2D items from the map would be like so:
1
2
3
4
5
function clearitems()
	for _, i in pairs(item(0,"table")) do -- LOL I forgot
		parse("removeitem "..i)
	end
end
How on earth did the Tibia code work anyway?
edited 1×, last 09.12.15 01:41:01 am

old Re: Remove all items on ground

Yates
Reviewer Off Offline

Quote
user HESY has written
My script is not associated with the project Tibia, maybe that's the problem?

Here I am trying to make the bloody thing work in Tibia, was about to say it might take a bit longer and you will get it tomorrow then I read this

old Re: Remove all items on ground

HESY
User Off Offline

Quote
user Cure Pikachu has written
Nope, removing all CS2D items from the map would be like so:
1
2
3
4
5
function clearitems()
	for _, i in item(0,"table") do
		parse("removeitem "..i)
	end
end
How on earth did the Tibia code work anyway?


It work, thank you!

True, I added one line, because code did not worked :
1
2
3
4
5
6
function clearitems()
	local itemlist=item(0,"table")
		for _,i in pairs(itemlist) do
          parse ("removeitem "..i)
	end
end

user Yates has written
Here I am trying to make the bloody thing work in Tibia, was about to say it might take a bit longer and you will get it tomorrow then I read this


In any case, thank you for your attention
edited 1×, last 09.12.15 12:41:44 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview