• 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 0.X Changing the level display

Aquan

New Member
Joined
Jan 27, 2021
Messages
7
Reaction score
1
Hello
I'm having trouble setting up a feature to display levels in the chat and statistics in thousands. For example, if a player has a level of 100,000, I'd like it to appear as 100 next to their nickname in the chat and in the stats. Is there anyone who can help me with this?
Thanks in advance
 
Currently, I display the level within the experience; the level bar reads as 0, and in the chat next to the nickname, there are random numbers. Here's my code.

Code:
if (player->getLevel() >= 0xFFFF) {
        msg->add<uint32_t>(player->getPlayerInfo(PLAYERINFO_LEVEL));
        msg->add<uint16_t>(0);
    } else {
        if(player->getExperience() > 0x7FFFFFFF) {
            msg->add<uint32_t>(0x7FFFFFFF);
        } else {
            msg->add<uint32_t>(player->getExperience());
        }
        msg->add<uint16_t>(player->getPlayerInfo(PLAYERINFO_LEVEL));
    }

1703241368930.png
 
Back
Top