Forum

> > CS2D > Scripts > Remove all items on ground
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Remove all items on ground

12 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Remove all items on ground

HESY
User Off Offline

Zitieren
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

alt Re: Remove all items on ground

Yates
Reviewer Off Offline

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

alt Re: Remove all items on ground

VADemon
User Off Offline

Zitieren
@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

alt Re: Remove all items on ground

HESY
User Off Offline

Zitieren
@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?

alt Re: Remove all items on ground

VADemon
User Off Offline

Zitieren
user HESY hat geschrieben
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?

alt Re: Remove all items on ground

HESY
User Off Offline

Zitieren
user HESY hat geschrieben
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?

alt Re: Remove all items on ground

Cure Pikachu
User Off Offline

Zitieren
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?
1× editiert, zuletzt 09.12.15 01:41:01

alt Re: Remove all items on ground

Yates
Reviewer Off Offline

Zitieren
user HESY hat geschrieben
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

alt Re: Remove all items on ground

HESY
User Off Offline

Zitieren
user Cure Pikachu hat geschrieben
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 hat geschrieben
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
1× editiert, zuletzt 09.12.15 00:41:44
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht