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

Players with mounts on Proctetion Zone

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hi my dear friends,

Could someone tell me why players still can use mounts on Proctetion Zone? I don't find any solution for this problem, also, I'm currentlying using tfs 1.2

Thanks.
 
1. Maybe there is no PZ?
2 Wrong access group?
3. Do you have dismount in your sources?
Code:
void Player::dismount()
{
   Mount* mount = g_game.mounts.getMountByID(getCurrentMount());
   if (mount && mount->speed > 0) {
     g_game.changeSpeed(this, -mount->speed);
   }

   defaultOutfit.lookMount = 0;
}
This is the part to dismount on entering into pz:
Code:
void Player::onChangeZone(ZoneType_t zone)
{
   if (zone == ZONE_PROTECTION) {
     if (attackedCreature && !hasFlag(PlayerFlag_IgnoreProtectionZone)) {
       setAttackedCreature(nullptr);
       onAttackedCreatureDisappear(false);
     }

     if (!group->access && isMounted()) {
       dismount();
       g_game.internalCreatureChangeOutfit(this, defaultOutfit);
       wasMounted = true;
     }
   } else {
     if (wasMounted) {
       toggleMount(true);
       wasMounted = false;
     }
   }

   g_game.updateCreatureWalkthrough(this);
   sendIcons();
}

Using latest tfs 1.2, works fine to me.
 
Seems the problem as with this script below, could someone try help me figure out how to fix it? Thanks.

Code:
function Creature:onChangeOutfit(outfit)
    if self:isPlayer() then
        local storage = 61500
        local every = 5 -- Change outfit once every 100 seconds

        if self:getStorageValue(storage) + every > os.time() then
            self:sendCancelMessage("You cannot change your outfit for 5 seconds.")
            return false
        end

        self:setStorageValue(storage, os.time())
    end
    return true
end
 
Back
Top