Joe Rod
Discord: joerod1
Hi again . With this code all the players from your account can enter to your house (they become owners too)
house.h
find
add below
find:
add below:
house.cpp
find
add below:
find
add below:
find
add this below:
That's all
house.h
find
Code:
uint32_t owner = 0;
add below
Code:
uint32_t ownerAcc = 0;
find:
Code:
uint32_t getOwner() const {
return owner;
}
add below:
Code:
void setOwnerAcc(uint32_t accId)
{
this->ownerAcc = accId;
}
uint32_t getOwnerAcc() const {
return ownerAcc;
}
house.cpp
find
Code:
owner = 0;
add below:
Code:
ownerAcc = 0;
find
Code:
if (guid != 0) {
std::string name = IOLoginData::getNameByGuid(guid);
if (!name.empty()) {
owner = guid;
ownerName = name;
add below:
Code:
Database& db1 = Database::getInstance();
std::ostringstream query1;
query1 << "SELECT `account_id` FROM `players` WHERE `id` = " << guid;
DBResult_ptr result = db1.storeQuery(query1.str());
ownerAcc = result->getNumber<uint32_t>("account_id");
find
Code:
if (player->getGUID() == owner) {
return HOUSE_OWNER;
}
add this below:
Code:
if (player->getAccount() == ownerAcc)
{
return HOUSE_OWNER;
}
That's all