• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Implement on clean?

Piltrafa

Active Member
Joined
Nov 10, 2010
Messages
654
Reaction score
29
Hello

Its possible that clean dosen't remove corpses? Like dead demon, or dead Player?

Here are the script:
Code:
local cleanEvent = 0
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Collected " .. doCleanMap() .. " items.")
return true
end
if(param == 'tile') then
local removeLoaded, t = false, string.explode(param, ",")
if(t[2]) then
removeLoaded = getBooleanFromString(t[2])
end
doCleanTile(getCreaturePosition(cid), removeLoaded)
return true
end
if(not tonumber(param)) then
doPlayerSendCancel(cid, "Command requires numeric param.")
return true
end
stopEvent(cleanEvent)
prepareClean(tonumber(param), cid)
return true
end
function prepareClean(minutes, cid)
if(minutes == 0) then
if(isPlayer(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cleaned " .. doCleanMap() .. " items.")
end
doBroadcastMessage("Game map cleaned.")
elseif(minutes > 0) then
if(minutes == 1) then
doBroadcastMessage("Game map cleaning in " .. minutes .. " minute, please pick up all your items.")
else
doBroadcastMessage("Game map cleaning in " .. minutes .. " minutes.")
end
cleanEvent = addEvent(prepareClean, 60000, minutes - 1, cid)
end
end

Thanks and rep++ if help.
 
you'll need to add an array with each item ID or item NAME, every single one... is it really worth the effort? it'll only remove the un-owned ones (i.e. after 10 seconds) anyway, so ones that were -just- killed won't be removed

another possible way is to make it search the item name for "corpse" or "body"... hmmm
 
Everything is possible.
You can also add that it won't clean if you are on toilett, but that is harder to do..

You need to source edit void Game::cleanMapEx(uint32_t& count)
 
Last edited:
Back
Top