• 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!

Lua [SOLVED][HELP] /Clean command doesn't clear protect zones

Boush

New Member
Joined
Apr 8, 2015
Messages
10
Reaction score
0
The title say whats my problem, somebody can help me? here is my code.

Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    local itemCount = cleanMap()
    if itemCount > 0 then
        player:sendTextMessage(MESSAGE_STATUS_WARNING, "Cleaned " .. itemCount .. " item" .. (itemCount > 1 and "s" or "") .. " from the map.")
    end
    return false
end
 
Where is the function cleanMap defined? You have to post that too if you want people to help you.
 
First of all thanks for the help

Lines 1000+
C++:
                        if (!tile || tile->hasFlag(TILESTATE_PROTECTIONZONE)) {
                            continue;
                        }

change to:
C++:
                        if (!tile) {
                            continue;
                        }

compile
enjoy

When I use /clean it is also cleaning the player's houses,


I tried using this command, but failed to compile map.cpp
C++:
if (!tile || tile->hasFlag(TILESTATE_HOUSE)) {
                           continue;
                      }
Do you have any idea how to proceed?


EIS5Mk3.png

I know it is written "TILESTATE_HOUSES" but i have tried with "TILESTATE_HOUSE" too
 
Last edited:
Heey! I can't solve your problem, but let me give you a tip!
There is 'cleanProtectedZones = true' in config.lua!
Maybe it could help you! Good Luck!
 
C++:
Tile* tile = floor->tiles[x][y];

if (!tile || dynamic_cast<HouseTile*>(tile) || tile->hasFlag(TILESTATE_PROTECTIONZONE))
    continue;
make sure to #include "housetile.h"
 
C++:
if (!tile || tile->hasFlag(TILESTATE_NOLOGOUT) || dynamic_cast<HouseTile*>(tile)) {
change where have locker in depot for nologout
 
@adrcrv my config.lua doesn't have this option, but thx for try to help.
@StreamSide i havent tried this, but thx for the help btw
@Xeraphus i have tried this and was appearing this error
AK44dtH.png
thx for the help.
@_M4G0_ i have tried this and works fine thx for the help.

Thx for you all guys who tried to help me.
 
Back
Top