Remove all items on ground
12 replies



08.12.15 04:45:31 pm
I found this topic: http://unrealsoftware.de/forum_posts.php?post=294172&start=260#post378119
And take advantage of this function:
But it does not work correctly.
Every minute I call a function claims and immediately spawn new items.
Result: Things are removed, and new ones are not spawn
Help me
And take advantage of this function:
But it does not work correctly.
Every minute I call a function claims and immediately spawn new items.
Result: Things are removed, and new ones are not spawn
Help me

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.
@
Yates: Thanks, I'll wait.
(Function "Cleanitems" and Spawnitems work correctly if they are individually.)

(Function "Cleanitems" and Spawnitems work correctly if they are individually.)
@
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

Another way: add a blacklist to cleanitems() so certain items/items on a specific tile will not be removed at all
@
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?

The second method not fit...
My script is not associated with the project Tibia, maybe that's the problem?

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?

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?
Nope, removing all CS2D items from the map would be like so:
How on earth did the Tibia code work anyway?
Code:
1
2
3
4
5
2
3
4
5
function clearitems()
for _, i in pairs(item(0,"table")) do -- LOL I forgot
parse("removeitem "..i)
end
end
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



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


Nope, removing all CS2D items from the map would be like so:
How on earth did the Tibia code work anyway?
Code:
1
2
3
4
5
2
3
4
5
function clearitems()
for _, i in item(0,"table") do
parse("removeitem "..i)
end
end
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

Code:
1
2
3
4
5
6
2
3
4
5
6
function clearitems()
local itemlist=item(0,"table")
for _,i in pairs(itemlist) do
parse ("removeitem "..i)
end
end
local itemlist=item(0,"table")
for _,i in pairs(itemlist) do
parse ("removeitem "..i)
end
end

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
@
HESY: it should work exactly the same, without explicitly defining a local ...=table. Whatever.

@
VADemon: in pairs


True, I added one line, because code did not worked
:

Careless mistake, happens sometimes.






