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

Solved Health/Mana Percentages

Infernum

Senator
Joined
Feb 14, 2015
Messages
5,643
Solutions
559
Reaction score
3,949
Everywhere I look on this forum, the thread always directs you to https://otland.net/threads/jak-wysylac-hp-i-mane-w-procentach.181560/
I'm using 0.3.6 V8 and my protocolgame.cpp has
Code:
msg->AddU16(player->getHealth());
msg->AddU16(player->getPlayerInfo(PLAYERINFO_MAXHEALTH));
instead of
Code:
msg->put<uint16_t>(player->getHealth());
msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MAXHEALTH));
I've tried putting in
Code:
if (player->getPlayerInfo(PLAYERINFO_MAXHEALTH) > 0)
{
msg->put<uint16_t>(uint16_t(player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH)));
msg->put<uint16_t>(100);
}
else
{
msg->put<uint16_t>(0);
msg->put<uint16_t>(0);
}
and replacing put<uint16_t> with AddU16 but my server still won't start, can anyone help?

EDIT: Replacing <uint16_t> with AddU16 works perfectly, windows just wouldn't notify me to allow TFS on public servers/private servers until 2 days later for some reason. That's why
I couldn't connect.
 
Last edited:
Jesus christ you are childish xD Abstain from posting at all please instead of telling him that you dont want to help. Seems to me like you are just trying to boost your post count
Unlike yourself 95% of my posts is code, helping others with their script issues or sharing code I've constructed from scratch to the public so they can use it on their servers or portions of it in their scripts.

Yes sharing... :)
 
Unlike yourself 95% of my posts is code, helping others with their script issues or sharing code I've constructed from scratch to the public so they can use it on their servers or portions of it in their scripts.

Yes sharing... :)
You mean 1%? 99% of your posts consists of you insulting others or trying degrade everyone that does not have the same "skill set" of scripting like you do.
 
I love how you bring up my server cause you know im right about you. Either way, I'll entertain my bots tonight :) What about your server? Oh wait.. the one that never went live :/
Yep too busy with real life, work takes up most of my time... bet you wouldn't know anything about that tho... having a life ;)
 
Yep too busy with real life, work takes up most of my time... bet you wouldn't know anything about that tho... having a life ;)
I'd rather sit on my ass 24/7 and play tibia rather than having your life. You literally get on to insult people or to degrade them and if you act like that IRL aswell there is no actual way that you do have a job.
 
I'd rather sit on my ass 24/7 and play tibia rather than having your life. You literally get on to insult people or to degrade them and if you act like that IRL aswell there is no actual way that you do have a job.
Your right I do act like this is real life, I insult others and it pays :)
I also help others and that pays too. :)
 
Indeed, I work for criminal justice system.. where do you work Mc'Donalds?
Yes ofcourse, mcdonalds pays really good you see lmao xD

Either way, imma just stop commenting cause you won't stop quoting and replying back to me.. Someones gotta be the adult around here
 
Yes ofcourse, mcdonalds pays really good you see lmao xD

Either way, imma just stop commenting cause you won't stop quoting and replying back to me.. Someones gotta be the adult around here
If you were the adult in this back and forth you wouldn't have replied or justified your reply... just saying :rolleyes:
 
Back
Top