• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

C++ tfs 1.2 change code part

jackl90

Member
Joined
Jul 25, 2017
Messages
249
Reaction score
12
C++:
        health = healthMax;  
        mana = manaMax;      
        g_game.internalTeleport(this, getTemplePosition(), true);
        g_game.addCreatureHealth(this);
        onThink(EVENT_CREATURE_THINK_INTERVAL);
        onIdleStatus();
        sendStats();
    }
}

getTemplePosition how can i change this part of code the for a specifc x,y,z place?
For example: {x = 33489, y = 31784, z = 7}
 
Last edited:
Like this, maybe?
Code:
 health = healthMax; 
        mana = manaMax;     
        templePosition = Position(33489, 31784, 7)
        g_game.internalTeleport(this, templePosition, true);
        g_game.addCreatureHealth(this);
        onThink(EVENT_CREATURE_THINK_INTERVAL);
        onIdleStatus();
        sendStats();
    }
}
I have used the coords from your example.
 
Used code.
C++:
        health = healthMax;
        mana = manaMax;   
        templePosition = Position(33489, 31784, 7)
        g_game.internalTeleport(this, templePosition, true);
        g_game.addCreatureHealth(this);
        onThink(EVENT_CREATURE_THINK_INTERVAL);
        onIdleStatus();
        sendStats();
    }
}

I got error on compilation...

Code:
1>..\src\player.cpp(1873): error C2065: 'templePosition': undeclared identifier
1>..\src\player.cpp(1874): error C2146: syntax error: missing ';' before identifier 'g_game'
1>..\src\player.cpp(1874): error C2065: 'templePosition': undeclared identifier

But i found this function on sources
C++:
g_game.internalTeleport(player, pos);
g_game.internalTeleport(creature, position, pushMovement)

but idk how to apply in my case...
 
Back
Top