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

Solved Walk through people at depot

Imfreezing

Krossa Kapitalismen
Joined
Jun 7, 2012
Messages
1,009
Solutions
1
Reaction score
88
Location
Edron
Hello, what should i edit, in source in order to make so people can't walk through each other in depot!
0.4 3777!
Thanks alot in advance!
 
No you should modify it.

See? as i said yesterday, normal people are not webmasters, super coders programmers, and can not understand the codes u guys pass us.

Please, if u guys dont wanna TEACH us, please, send us MADED CODE because we are noob, not professional, and do not understand and do not know what need to be donne in the scripts.
 
Last edited:
See? as i said yesterday, normal people are not webmasters, super coders programmers, and can not understand the codes u guys pass us.

Please, if u guys dont wanna TEACH us, please, send us MADED CODE because we are noob, not professional, and do not understand and do not know what need to be donne in the scripts.
da bomb <:
 
See? as i said yesterday, normal people are not webmasters, super coders programmers, and can not understand the codes u guys pass us.

Please, if u guys dont wanna TEACH us, please, send us MADED CODE because we are noob, not professional, and do not understand and do not know what need to be donne in the scripts.
At least it should be in the interest to learn and try to collect information.
This function is very useful for such things:
HERE

https://otland.net/threads/windows-7-walking-through-players-in-pz.141314/#post1361483
11063 should be the id on the tile in front of the depot (glowing switch).
 
See? as i said yesterday, normal people are not webmasters, super coders programmers, and can not understand the codes u guys pass us.

Please, if u guys dont wanna TEACH us, please, send us MADED CODE because we are noob, not professional, and do not understand and do not know what need to be donne in the scripts.

Wut? I atleast never learn if someone does it for me, I learn by reading up on things and seeing how they work.
That is the reason why I try to spend alot of time with the TFS source code, to learn.
Aswell as reading books.

If people wanted it like you seem to do, then we would have over a billion threads here on OTLand asking for the solution with no people to help or guide them to the solution.

Ex. https://github.com/otland/forgottenserver/blob/master/src/player.cpp#L825-L859
Look at the function, read it: https://github.com/otland/forgottenserver/blob/master/src/player.cpp#L827-L829
In this case, if the object we are trying to enter has a group access(gm, god etc) it will send the return value error(can't remember the string).
 
Would be good if you posted the solution. So if other people serach for this can find this.
Quoting @heba

Code:
change
bool Player::canWalkthrough(const Creature* creature) const
{
    if(creature == this || hasCustomFlag(PlayerCustomFlag_CanWalkthrough) || creature->isWalkable() ||
        (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster())))
        return true;

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

    if((((g_game.getWorldType() == WORLDTYPE_OPTIONAL &&
#ifdef __WAR_SYSTEM__
        !player->isEnemy(this, true) &&
#endif
        player->getVocation()->isAttackable()) || (player->getVocation()->isAttackable() &&
        player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && player->getTile()->ground &&
        Item::items[player->getTile()->ground->getID()].walkStack) && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
        || player->getAccess() <= getAccess()))
        return true;

    return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
        || (isGhost() && getGhostAccess() > player->getGhostAccess());
}
________________________________________________________________________________
to                          to                             to
________________________________________________________________________________
bool Player::canWalkthrough(const Creature* creature) const
{
if(creature == this || creature->isWalkable() ||
(creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster())))
return true;

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

if(
(
(
(
(
player->getVocation()->isAttackable() &&
player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::pROTECTION_LEVEL)
)
|| (
player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) &&
!player->getTile()->hasFlag(TILESTATE_HOUSE)
)
)
) && player->getTile()->ground &&
player->getTile()->ground->getID() != 11063
) && (
!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
|| player->getAccess() <= getAccess()
)
) return true;

return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
|| (isGhost() && getGhostAccess() > player->getGhostAccess());
}
in player.cpp
 
In player.cpp
Change

Code:
bool Player::canWalkthrough(const Creature* creature) const
{
if(creature == this || hasCustomFlag(PlayerCustomFlag_CanWalkthrough) || creature->isWalkable() ||
(creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster())))
return true;

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

if((((g_game.getWorldType() == WORLDTYPE_OPTIONAL &&
#ifdef __WAR_SYSTEM__
!player->isEnemy(this, true) &&
#endif
player->getVocation()->isAttackable()) || (player->getVocation()->isAttackable() &&
player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && player->getTile()->ground &&
Item::items[player->getTile()->ground->getID()].walkStack) && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
|| player->getAccess() <= getAccess()))
return true;

return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
|| (isGhost() && getGhostAccess() > player->getGhostAccess());
}

To
Code:
bool Player::canWalkthrough(const Creature* creature) const
{
if(creature == this || creature->isWalkable() ||
(creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster())))
return true;

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

if(
(
(
(
(
player->getVocation()->isAttackable() &&
player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::pROTECTION_LEVEL)
)
|| (
player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) &&
!player->getTile()->hasFlag(TILESTATE_HOUSE)
)
)
) && player->getTile()->ground &&
player->getTile()->ground->getID() != 11063
) && (
!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
|| player->getAccess() <= getAccess()
)
) return true;

return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
|| (isGhost() && getGhostAccess() > player->getGhostAccess());
}
 
In player.cpp
Change

Code:
bool Player::canWalkthrough(const Creature* creature) const
{
if(creature == this || hasCustomFlag(PlayerCustomFlag_CanWalkthrough) || creature->isWalkable() ||
(creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster())))
return true;

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

if((((g_game.getWorldType() == WORLDTYPE_OPTIONAL &&
#ifdef __WAR_SYSTEM__
!player->isEnemy(this, true) &&
#endif
player->getVocation()->isAttackable()) || (player->getVocation()->isAttackable() &&
player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))) && player->getTile()->ground &&
Item::items[player->getTile()->ground->getID()].walkStack) && (!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
|| player->getAccess() <= getAccess()))
return true;

return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
|| (isGhost() && getGhostAccess() > player->getGhostAccess());
}

To
Code:
bool Player::canWalkthrough(const Creature* creature) const
{
if(creature == this || creature->isWalkable() ||
(creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster())))
return true;

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

if(
(
(
(
(
player->getVocation()->isAttackable() &&
player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::pROTECTION_LEVEL)
)
|| (
player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) &&
!player->getTile()->hasFlag(TILESTATE_HOUSE)
)
)
) && player->getTile()->ground &&
player->getTile()->ground->getID() != 11063
) && (
!player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
|| player->getAccess() <= getAccess()
)
) return true;

return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
|| (isGhost() && getGhostAccess() > player->getGhostAccess());
}
@heba
im gettinng this error:

player.cpp: In member function 'virtual bool Player::canWalkthrough(const Creature*) const':
player.cpp:897:51: error: 'pROTECTION_LEVEL' is not a member of 'ConfigManager'
CXX protocolgame.o
make[1]: *** [player.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/otserver/trunk'
make: *** [all] Error 2
 
Last edited:
@heba
im gettinng this error:

player.cpp: In member function 'virtual bool Player::canWalkthrough(const Creature*) const':
player.cpp:897:51: error: 'pROTECTION_LEVEL' is not a member of 'ConfigManager'
CXX protocolgame.o
make[1]: *** [player.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/otserver/trunk'
make: *** [all] Error 2
Yep you need to change to PROTECTION_LEVEL
Its currently pROTECTION_LEVEL


Code:
player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::pROTECTION_LEVEL)
to
Code:
player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL)
 
Back
Top