Ever had someone trash your server's depot? Or trash houses? Well instead of wasting your time by using "/r", you can use this.
There are 2 options within the script.
Which will remove all movable objects on the tile you are looking at.
OR
Which will remove movable objects on the tile you are looking at ONLY if you have specified it within the command.
There is a table in the script called "valubleitems", if you add the valuble items that you do not want to remove at all such as donors, when you use "/trash all" it will not remove any of the items in that table.
Talkactions.XML
trashremove.lua
There are 2 options within the script.
Code:
/trash all
OR
Code:
/trash ids, itemid, itemid2, etc
There is a table in the script called "valubleitems", if you add the valuble items that you do not want to remove at all such as donors, when you use "/trash all" it will not remove any of the items in that table.
Talkactions.XML
Code:
<talkaction log="yes" words="/trash" access="3" event="script" value="trashremove.lua"/>
Code:
function onSay(cid, words, param, channel)
local valubleitems = {
9971, --100gb
8887, --frzoenplate
6527, --frozencoin
6536, --tear of beatrice
6119, -- teleport scroll
9969, -- Skull Remover
7708, -- Manashield Ring
8983, -- Merlin's Deathbook
10223, -- Fishmaster Deluxe c5000
8851, --Immortal Archers Crossbow
4445, --Immortal Archers Legs
4444, --Immortal Archers Armor
4443, --Immortal Archers Helmet
7735, --Immortal Mages Wand
4448, --Immortal Mages Robe
4447, --Immortal Mages Hat
4449, --Immortal Mages Legs
4446, --Immortal Spellbook of Destruction
4442, --Immortal Archers Shield
4450, --Immortal Knights Shield
4451, --Immortal Knights Helmet
4452, --Immortal Knights Armor
4453, --Immortal Knights Legs
7405, --Immortal Knights Longsword
7863, --Immortal Knights Waraxe
7422, --Immortal Knights Warhammer
2196, --Amulet of Never-Ending Loss
10306 --Outfit Doll
}
local t = string.explode(param, ",")
local trashids = {}
pos = getCreatureLookPosition(cid)
if not(t[1] == 'all' or t[1] == 'ids') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Use format: /trash all OR /trash ids, itemid, itemid2, etc.")
return true
end
if(t[1] == 'all') then
if getThingFromPos(pos).uid ~= 0 then
pos.stackpos = 255
while isCreature(getThingFromPos(pos).uid) ~= true and getThingFromPos(pos).itemid > 0 and hasProperty(getThingFromPos(pos).uid, 6) == true and isInArray(valubleitems, getThingFromPos(pos).itemid) == false do
if getThingFromPos(pos).type ~= 0 then
doRemoveItem(getThingFromPos(pos).uid, getThingFromPos(pos).type)
else
doRemoveItem(getThingFromPos(pos).uid, 1)
end
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You removed all the trash items from the tile infront of you.")
elseif(t[1] == 'ids') then
for i = 2, #t do
table.insert(trashids, t[i])
end
if getThingFromPos(pos).uid ~= 0 then
pos.stackpos = 255
while isCreature(getThingFromPos(pos).uid) ~= true and getThingFromPos(pos).itemid > 0 and hasProperty(getThingFromPos(pos).uid, 6) == true and isInArray(trashids, getThingFromPos(pos).itemid) == true do
if getThingFromPos(pos).type ~= 0 then
doRemoveItem(getThingFromPos(pos).uid, getThingFromPos(pos).type)
else
doRemoveItem(getThingFromPos(pos).uid, 1)
end
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You removed the items you specified in the command.")
return true
end
return true
end