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

[C++] Position.z didn't work

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hello everyone,@SpiderOT tryed helped me with a code but it didn't work position.z and playerPosition.z if use y or X instead z it works. How to fix it?

Code:
if (player->getAccountType() == ACCOUNT_TYPE_NORMAL) {
return;
}

const Position& playerPosition = player->getPosition();
Database* db = Database::getInstance();
std::ostringstream query;
if (category == BUG_CATEGORY_MAP) {
query << "INSERT INTO `player_reports` (`id` , `name` , `account_id` ,`posx` ,`posy` ,`posz` ,`report_description` ,`date`) VALUES ("<< NULL << "," << db->escapeString(player->getName()) << ", " << player->getAccount() << ", " << position.x << ", " << position.y << ", " << position.z << ", " << db->escapeString(message) << ", " << time(nullptr) << ")";
} else {
query << "INSERT INTO `player_reports` (`id` , `name` , `account_id` ,`posx` ,`posy` ,`posz` ,`report_description` ,`date`) VALUES ("<< NULL << "," << db->escapeString(player->getName()) << ", " << player->getAccount() << ", " << playerPosition.x << ", " << playerPosition.y << ", " << playerPosition.z << ", " << db->escapeString(message) << ", " << time(nullptr) << ")";
}
if(!db->executeQuery(query.str())){
player->sendTextMessage(MESSAGE_EVENT_DEFAULT, "There was an error when processing your report, please contact a gamemaster.");
return;
}

1uunIFQKl.png
 
Back
Top