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

Stay Mounted In PZ!

Smokiee Jo

Website Scripter
Joined
Nov 8, 2012
Messages
217
Solutions
1
Reaction score
16
Location
Ireland
hey guys im looking for some help on letting normal players stay mounted when entering protection zone, like GM's can..

iv'e looked through protocolgame.cpp but i cant seem to find anything and im sure it's something to do with that CPP

im using OTX v 3.10 (10.98-11.47)


Thanks
SJ
 
@2Rec what part of the string would i change on

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;
        }
    }

Thanks
SJ
 
Code:
void Player::onChangeZone(ZoneType_t zone)
{
    if (zone == ZONE_PROTECTION) {
        if (attackedCreature && !hasFlag(PlayerFlag_IgnoreProtectionZone)) {
            setAttackedCreature(nullptr);
            onAttackedCreatureDisappear(false);
        }
    }
 
Last edited:
Remove:
C++:
        if (!group->access && isMounted()) {
            dismount();
            g_game.internalCreatureChangeOutfit(this, defaultOutfit);
            wasMounted = true;
        }
    } else {
        if (wasMounted) {
            toggleMount(true);
            wasMounted = false;
        }
Should work.

@Thexamx he didnt paste the whole code, so you closed the whole function too early.

@Smokiee Jo
Did you recompile?
 
Imgur this is how my Player.cpp now looks, but still no luck with staying mounted in protection zone :/

@2Rec i thought that and i did just keep his string and removed the rest as common knowledge but i have no idea why this wont work :/
 
Imgur this is how my Player.cpp now looks, but still no luck with staying mounted in protection zone :/

@2Rec i thought that and i did just keep his string and removed the rest as common knowledge but i have no idea why this wont work :/

Your code is wrong

You have additional "}" in middle of the function.

@2Rec
About the code I assumed he can see what is removed and what not, braces shouldnt matter in this case, but I'm gonna remove it if it need to be removed. XD
 
Imgur this is how my Player.cpp now looks, but still no luck with staying mounted in protection zone :/

@2Rec i thought that and i did just keep his string and removed the rest as common knowledge but i have no idea why this wont work :/

Remove one "}" from the middle and recompile.
And next time don't do pictures, just paste the code.
 
Back
Top