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

Compiling HP BAR display in % help

shivaria

Active Member
Joined
Sep 2, 2009
Messages
158
Reaction score
36
TFS 1.X, works just fine displaying "100" but theres 2 changes I need to figure out how to make. I need ot to show 100% instead of just 100, and I also need for it to still show the players HP as its original value on the skill window, because there it only shows 100 as well.

Code:
msg->put<uint16_t>(uint16_t(player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH)));
msg->put<uint16_t>(100);

Code:
msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MANA) * 100 / player->getPlayerInfo(PLAYERINFO_MAXMANA));
msg->put<uint16_t>(100);

I'm thinking it might be as simple as adding " %" somewhere in that code, but im not sure how to do that.
Probably in this line here
Code:
msg->put<uint16_t>(100);
 
Last edited:
Back
Top