Postado Junho 25, 2018 7 anos Boa noite galerinha do tk estou com um problema na hora de compilar minha mana e hp para colocar em % olhei os topicos aqui e minha o meu protcolgame.cpp esta diferente dos daqui o meu e asim void ProtocolGame::AddPlayerStats(OutputMessage_ptr msg) { msg->addByte(0xA0); msg->add<uint16_t>(player->getHealth()); msg->add<uint16_t>(player->getPlayerInfo(PLAYERINFO_MAXHEALTH)); msg->add<uint32_t>(uint32_t(player->getFreeCapacity() * 100)); uint64_t experience = player->getExperience(); if(experience > 0x7FFFFFFF) msg->add<uint32_t>(0x7FFFFFFF); else msg->add<uint32_t>(experience); msg->add<uint16_t>(player->getPlayerInfo(PLAYERINFO_LEVEL)); msg->addByte(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT)); msg->add<uint16_t>(player->getPlayerInfo(PLAYERINFO_MANA)); msg->add<uint16_t>(player->getPlayerInfo(PLAYERINFO_MAXMANA)); msg->addByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL)); msg->addByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT)); msg->addByte(player->getPlayerInfo(PLAYERINFO_SOUL)); msg->add<uint16_t>(player->getStaminaMinutes()); } e o topico que vi ta asim protocolgame.cpp, procure por: msg->put<uint16_t>(player->getHealth()); msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MAXHEALTH)); troque por: 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); } procure por: msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MANA)); msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MAXMANA)); troque por: if (player->getPlayerInfo(PLAYERINFO_MAXMANA) > 0) { msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MANA) * 100 / player->getPlayerInfo(PLAYERINFO_MAXMANA)); msg->put<uint16_t>(100); } else { msg->put<uint16_t>(0); msg->put<uint16_t>(0); } ja tentei substituir so as funçoes que pede ae mas esta diferente e da erro na hora de compilar alguem ajuda?
Postado Junho 25, 2018 7 anos Autor 6 minutos atrás, KotZletY disse: @mullino e qual erro está dando ? O quê ocorre durante a compilação ? entao o problema que nao consigo colocar as funçoes que esta para colocar porque comprei essa source ela e boa mas nao consigo colocar o hp e mana por porcentagem pq onde manda modificar e completamente diferente.. tentei ate 3 horas da madruga ontem e nao consegui vou refazer aki e mandar o erro pra vcs olha a diferença o meu ta asim msg->add<uint16_t>(player->getHealth()); msg->add<uint16_t>(player->getPlayerInfo(PLAYERINFO_MAXHEALTH)); ja no que pedee pra modificar ta asim msg->put<uint16_t>(player->getHealth()); msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MAXHEALTH)); ontem eu fiz asim 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); } troquei o put por add ficando asim if (player->getPlayerInfo(PLAYERINFO_MAXHEALTH) > 0) { msg->add<uint16_t>(uint16_t(player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH))); msg->add<uint16_t>(100); } else { msg->add<uint16_t>(0); msg->add<uint16_t>(0); } fiz issu na mana tbm ate compilou mas na hora que eu entrava no ot com qualquer conta ate no account manangem tomava debug 5 minutos atrás, mullino disse: entao o problema que nao consigo colocar as funçoes que esta para colocar porque comprei essa source ela e boa mas nao consigo colocar o hp e mana por porcentagem pq onde manda modificar e completamente diferente.. tentei ate 3 horas da madruga ontem e nao consegui vou refazer aki e mandar o erro pra vcs olha a diferença o meu ta asim msg->add<uint16_t>(player->getHealth()); msg->add<uint16_t>(player->getPlayerInfo(PLAYERINFO_MAXHEALTH)); ja no que pedee pra modificar ta asim msg->put<uint16_t>(player->getHealth()); msg->put<uint16_t>(player->getPlayerInfo(PLAYERINFO_MAXHEALTH)); ontem eu fiz asim 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); } troquei o put por add ficando asim if (player->getPlayerInfo(PLAYERINFO_MAXHEALTH) > 0) { msg->add<uint16_t>(uint16_t(player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH))); msg->add<uint16_t>(100); } else { msg->add<uint16_t>(0); msg->add<uint16_t>(0); } fiz issu na mana tbm ate compilou mas na hora que eu entrava no ot com qualquer conta ate no account manangem tomava debug @KotZletY Editado Junho 25, 2018 7 anos por mullino (veja o histórico de edições)
Postado Junho 25, 2018 7 anos Solução @mullino há sim lamento, tava ouvindo um áudio aqui e acabei não prestando atenção: Spoiler void ProtocolGame::AddPlayerStats(OutputMessage_ptr msg) { msg->addByte(0xA0); if (player->getPlayerInfo(PLAYERINFO_MAXHEALTH) > 0) { msg->add<uint16_t>((player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH))); msg->add<uint16_t>(100); } else { msg->add<uint16_t>(0); msg->add<uint16_t>(0); } msg->add<uint32_t>(uint32_t(player->getFreeCapacity() * 100)); uint64_t experience = player->getExperience(); if(experience > 0x7FFFFFFF) msg->add<uint32_t>(0x7FFFFFFF); else msg->add<uint32_t>(experience); msg->add<uint16_t>(player->getPlayerInfo(PLAYERINFO_LEVEL)); msg->addByte(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT)); if (player->getPlayerInfo(PLAYERINFO_MAXMANA) > 0) { msg->add<uint16_t>((player->getPlayerInfo(PLAYERINFO_MANA) * 100 / player->getPlayerInfo(PLAYERINFO_MAXMANA))); msg->add<uint16_t>(100); } else { msg->add<uint16_t>(0); msg->add<uint16_t>(0); } msg->addByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL)); msg->addByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT)); msg->addByte(player->getPlayerInfo(PLAYERINFO_SOUL)); msg->add<uint16_t>(player->getStaminaMinutes()); }
Postado Junho 25, 2018 7 anos Autor 3 minutos atrás, KotZletY disse: @mullino há sim lamento, tava ouvindo um áudio aqui e acabei não prestando atenção: Ocultar conteúdo void ProtocolGame::AddPlayerStats(OutputMessage_ptr msg) { msg->addByte(0xA0); if (player->getPlayerInfo(PLAYERINFO_MAXHEALTH) > 0) { msg->add<uint16_t>((player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH))); msg->add<uint16_t>(100); } else { msg->add<uint16_t>(0); msg->add<uint16_t>(0); } msg->add<uint32_t>(uint32_t(player->getFreeCapacity() * 100)); uint64_t experience = player->getExperience(); if(experience > 0x7FFFFFFF) msg->add<uint32_t>(0x7FFFFFFF); else msg->add<uint32_t>(experience); msg->add<uint16_t>(player->getPlayerInfo(PLAYERINFO_LEVEL)); msg->addByte(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT)); if (player->getPlayerInfo(PLAYERINFO_MAXMANA) > 0) { msg->add<uint16_t>((player->getPlayerInfo(PLAYERINFO_MANA) * 100 / player->getPlayerInfo(PLAYERINFO_MAXMANA))); msg->add<uint16_t>(100); } else { msg->add<uint16_t>(0); msg->add<uint16_t>(0); } msg->addByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL)); msg->addByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT)); msg->addByte(player->getPlayerInfo(PLAYERINFO_SOUL)); msg->add<uint16_t>(player->getStaminaMinutes()); } vou compilar aki 20 minutos atrás, KotZletY disse: @mullino há sim lamento, tava ouvindo um áudio aqui e acabei não prestando atenção: Mostrar conteúdo oculto void ProtocolGame::AddPlayerStats(OutputMessage_ptr msg) { msg->addByte(0xA0); if (player->getPlayerInfo(PLAYERINFO_MAXHEALTH) > 0) { msg->add<uint16_t>((player->getHealth() * 100 / player->getPlayerInfo(PLAYERINFO_MAXHEALTH))); msg->add<uint16_t>(100); } else { msg->add<uint16_t>(0); msg->add<uint16_t>(0); } msg->add<uint32_t>(uint32_t(player->getFreeCapacity() * 100)); uint64_t experience = player->getExperience(); if(experience > 0x7FFFFFFF) msg->add<uint32_t>(0x7FFFFFFF); else msg->add<uint32_t>(experience); msg->add<uint16_t>(player->getPlayerInfo(PLAYERINFO_LEVEL)); msg->addByte(player->getPlayerInfo(PLAYERINFO_LEVELPERCENT)); if (player->getPlayerInfo(PLAYERINFO_MAXMANA) > 0) { msg->add<uint16_t>((player->getPlayerInfo(PLAYERINFO_MANA) * 100 / player->getPlayerInfo(PLAYERINFO_MAXMANA))); msg->add<uint16_t>(100); } else { msg->add<uint16_t>(0); msg->add<uint16_t>(0); } msg->addByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVEL)); msg->addByte(player->getPlayerInfo(PLAYERINFO_MAGICLEVELPERCENT)); msg->addByte(player->getPlayerInfo(PLAYERINFO_SOUL)); msg->add<uint16_t>(player->getStaminaMinutes()); } Funcionou Perfeito cara VC E milll 1000000 +Rep
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.