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

Compiling [WINDOWS 7] Walking through players in PZ

Galaxy

New Member
Joined
Feb 24, 2011
Messages
108
Reaction score
1
Location
Ireland/Carlow
Hello,

I have ots for tibia 8.6 but i dont know how to set up so that players can walk through each other in protection zones... At the moment i have it set so that players can walk through others if they are under certain level (i have it set to level 50 - like, pvp set from level 50).

I heard that u need a file called players.cpp but i dont have it in my ots folder. If i need it can oyu please tell me where i can find it and tell me where to put it and which line is responsible for what i want...

Thanks :)
 
Last edited:
use search....

you need too source edit (#C) thats why you cant find players.cpp ....
 
Well, how do i edit what ever source (#C)? :D Im kind of stupid when it comes to those things :) Thats why i asked in my first post if any1 could explain that to me...
 
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());
}
 
Last edited by a moderator:
but, where do i find this file? sorry for my "stupidness" but u see, this was a problem that i had since i started the adventure with my ots...

@Cykotitan,
is that in the players.cpp? i dont have this file ;( I heard that this file has something to do with compiling (not sure)... But i have no idea how to do that... ;(

And I searched for it in google and in otland but couldnt find any solution to my problem... :(

EDIT:
Im just gonna tell u my tfs version. maybe this will help u :p
TFS 0.4_DEV
Compiled with GNU C++ version 4.4.0
 
Cykotitan, ok. I got the sources...

Lots of files omg xD And I have players.cpp... But I dont have program that could open them ;/ Do I open them with wordpad? or something like that??
 
How I can do it?

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());
}
 
[cpp]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->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) || (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;[/cpp]
 
[cpp]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->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) || (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;[/cpp]
where can i put files like this? i mean the position of it?
 
question
TILESTATE_OPTIONALZONE is this for NONPVP zones? ( i want to use over rookgaard

here is how i pasted it:

Code:
bool Player::canWalkthrough(const Creature* creature) const
{
    if(creature == this || hasFlag(PlayerFlag_CanPassThroughAllCreatures) || 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)
                    )
|| ( //TILESTATE_OPTIONALZONE(testnonpvp?)
                        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());
}

tfs 0.4 wish me luck @@update compiled with no errors gonna test it! :)
 
Last edited:
Back
Top