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

C++ PLAYERS CAN WALK THROUGH EACH OTHER IN DEPOT TFS 1.2

Mister Budex

BudexOT.com
Joined
Jun 22, 2016
Messages
1,547
Solutions
18
Reaction score
378
Actually I have a problem, my players while playing a server two can go to one depot tile, I do not know how to fix this, couple of scripters tried to help me but seems nothing, They tried with editing tiles.lua in the movements folder but this did not help. I tried to put the tiles in RME Editor no-pvp + pvp + pz, and even a couple of combinations but not working again, I think this is work in C ++ and I hope some of you will help me, I use TFS 1.2 Tibia 8.60 from Ninja.
Warm Regards!
 
Actually I have a problem, my players while playing a server two can go to one depot tile, I do not know how to fix this, couple of scripters tried to help me but seems nothing, They tried with editing tiles.lua in the movements folder but this did not help. I tried to put the tiles in RME Editor no-pvp + pvp + pz, and even a couple of combinations but not working again, I think this is work in C ++ and I hope some of you will help me, I use TFS 1.2 Tibia 8.60 from Ninja.
Warm Regards!
you need the orange tile
 
C++:
bool Player::canWalkthroughEx(const Creature* creature) const
{
    if (group->access) {
        return true;
    }

    const Player* player = creature->getPlayer();
    if (!player) {
        return false;
    }

    const Tile* playerTile = player->getTile();
    return playerTile && playerTile->hasFlag(TILESTATE_PROTECTIONZONE);
}

void Player::onReceiveMail() const
{
    if (isNearDepotBox()) {
        sendTextMessage(MESSAGE_EVENT_ADVANCE, "New mail has arrived.");
    }
}
 
Last edited by a moderator:
C++:
bool Player::canWalkthroughEx(const Creature* creature) const
{
    if (group->access) {
        return true;
    }

    const Player* player = creature->getPlayer();
    if (!player) {
        return false;
    }
    const Tile* playerTile = player->getTile();
    return playerTile && playerTile->hasFlag(TILESTATE_PROTECTIONZONE) && !playerTile->hasFlag(TILESTATE_DEPOT);
}

dunno if will work, u sent me canWalkthroughEx instead of canWalkThrough aswell, dunno the differences between those two, if someone doesn't mind explaining
 
Last edited by a moderator:
C++:
bool Player::canWalkthroughEx(const Creature* creature) const
{
    if (group->access) {
        return true;
    }

    const Player* player = creature->getPlayer();
    if (!player) {
        return false;
    }
    const Tile* playerTile = player->getTile();
    return playerTile && playerTile->hasFlag(TILESTATE_PROTECTIONZONE) && !playerTile->hasFlag(TILESTATE_DEPOT);
}

dunno if will work, u sent me canWalkthroughEx instead of canWalkThrough aswell, dunno the differences between those two, if someone doesn't mind explaining
I just noticed today that i dont have registerd glowing switch in my items.xml ! I added them, I will restart OT probably within 3 days so I will give u results.
 
If it still doesn't work add this into your moveevent scripts

Lua:
function onStepIn(creature, item, target, fromPosition, toPosition)
    if isPlayer(toPosition:getThing()) then
        creature:teleportTo(fromPosition)
        return player:sendCancelMessage("You cannot walk here.")
    end
return true
end

and dont forget to add in the xml code
Code:
<moveevent itemid="11062" event="script" value="depot_tile.lua"/>
 
Itutorial thanks for you reply. I fixed it , the problem was I used items.xml from tfs 0.4 and it hasnt got registerd glowing switch tile, So I just took that part from tfs 1.2 and its working ! ;)
 
Back
Top