English Remove all items on ground

12 replies
Goto Page
To the start Previous 1 Next To the start
08.12.15 04:45:31 pm
Up
HESY
User
Offline Off
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
08.12.15 05:02:14 pm
Up
Yates
Reviewer
Offline Off
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.
08.12.15 05:14:10 pm
Up
HESY
User
Offline Off
@user Yates: Thanks, I'll wait.
(Function "Cleanitems" and Spawnitems work correctly if they are individually.)
08.12.15 08:30:05 pm
Up
VADemon
User
Offline Off
@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
08.12.15 10:01:26 pm
Up
HESY
User
Offline Off
@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?
08.12.15 11:18:27 pm
Up
VADemon
User
Offline Off
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?
08.12.15 11:40:06 pm
Up
HESY
User
Offline Off
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?
08.12.15 11:57:38 pm
Up
Cure Pikachu
User
Offline Off
Nope, removing all CS2D items from the map would be like so:
Code:
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
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
09.12.15 12:13:01 am
Up
Yates
Reviewer
Offline Off
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
09.12.15 12:29:46 am
Up
HESY
User
Offline Off
user Cure Pikachu has written:
Nope, removing all CS2D items from the map would be like so:
Code:
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 :
Code:
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
09.12.15 01:13:26 am
Up
VADemon
User
Offline Off
@user HESY: it should work exactly the same, without explicitly defining a local ...=table. Whatever.
09.12.15 01:35:53 am
Up
Rainoth
Moderator
Offline Off
@user VADemon: in pairs
09.12.15 01:43:17 am
Up
Cure Pikachu
User
Offline Off
user HESY has written:
True, I added one line, because code did not worked :

Careless mistake, happens sometimes.
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
To the start Previous 1 Next To the start