Hi people, i need some help to add in those fnctions the option to remove fields ( like fire field, poison field, etc ) and to remove pools of blood( slime, etc)
Because when a player dies, it removes all itens and monster, but the fields and the pools stays there...
thanks!
Because when a player dies, it removes all itens and monster, but the fields and the pools stays there...
Code:
--DEMON OAK CLEANING
local removeCreature = true
local maxStackpos = 255
local minStackpos = 1
function cleanSqm(Itempos) --- By mock the bear
Itempos.stackpos = 255
local Item = getThingfromPos(Itempos,false)
if (removeCreature and isCreature(Item.uid)) then
doSendMagicEffect(Itempos,CONST_ME_POFF)
if Item.uid ~= cid and not isPlayer(Item.uid) or getPlayerGroupId(Item.uid) == 1 then
doRemoveCreature(Item.uid)
end
end
for stack=-maxStackpos,minStackpos do
Itempos.stackpos = stack*-1
if Itempos.stackpos == 0 then break end
local id = getThingfromPos(Itempos)
if id.itemid > 0 and id.uid > 0 and not isCreature(id.uid) then
if isMoveable(id.uid) then
doRemoveItem(id.uid,-1)
end
end
end
end
function executeInArea(pos, area,cmd,...)-
local center = {}
center.y = math.floor(#area/2)+1
for y = 1, #area do
for x = 1, #area[y] do
local number = area[y][x]
if number > 0 then
center.x = math.floor(table.getn(area[y])/2)+1
local pos = {x = pos.x + x - center.x, y = pos.y + y - center.y, z = pos.z}
if type(cmd) == 'string' then
local b = _G
b.pos = pos
local f = assert(loadstring(cmd))
setfenv(f, b)
f(pos,...)
elseif type(cmd) == 'function' then
cmd(pos,...)
end
end
end
end
end
-- end CLEANING
thanks!