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

TFS 1.X+ HELP PK

Mateus Robeerto

Excellent OT User
Joined
Jun 5, 2016
Messages
1,337
Solutions
71
Reaction score
697
Location
ლ(ಠ益ಠლ)
Can someone explain to me where I can change the setting to allow player to player attacks? I put level 1, but it didn't work.

i cant attack this player why?
how to solve it?
worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 1
killsToRedSkull = 15
pzLocked = 60000
removeChargesFromRunes = false
removeWeaponAmmunition = false
timeToDecreaseFrags = 24 * 60 * 60 * 1000
whiteSkullTime = 15 * 60 * 1000
stairJumpExhaustion = 200000
experienceByKillingPlayers = true
expFromPlayersLevelRange = 75
allowFightBack = true
stopAttackingAtExit = "false"

XML:
<?xml version="1.0" encoding="UTF-8"?>
<groups>



    <group id="1" name="player" flags="0" maxdepotitems="0" maxvipentries="0" access="0" />

  <group id="2" name="gamemaster" flags="412316860415" maxdeoptitems="0" maxvipentries="0" access="1" />

  <group id="5" name="god" flags="547608305658" maxdepotitems="0" maxvipentries="0" access="1" />
 <group id="6" name="GameMaster" flags="3845069447162" customFlags="2097151" access="5" violationReasons="23" nameViolationFlags="426" statementViolationFlags="469" depotLimit="5000" maxVips="500" outfit="302"/>
</groups>
 
Last edited:
I found out that it was the source I added. It prevents the player from attacking the player of the same guild.


I created a different account and not both in the same guild. They are guildless and still cannot attack this player. If I remove this code they attack each other normally. I would like to add a code to prevent players from attacking each other through the guild. They can attack another player who is not in the same guild, you see?

C++:
// Verify if the player has the same guild
        if (player->getPlayer() && player->getPlayer()->getGuild() == target->getPlayer()->getGuild()) {
            return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER;
        }
Post automatically merged:

I managed to fix the code myself. Players can now attack each other if they are not in the same guild, which is working correctly. Also, I did the test between players who are in the same guild and they can't attack each other. It's all working perfectly. Thank God!

C++:
if (target->getPlayer()) {
        // Verify if the player has the same guild
        if (player->getPlayer()->getGuild() != nullptr && target->getPlayer()->getGuild() != nullptr) {
            if (player->getPlayer()->getGuild() == target->getPlayer()->getGuild()) {
                return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER;
            }
        }
 
Last edited:
Back
Top