• 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++ Reset In Name C++

gabrielks1996

New Member
Joined
Feb 27, 2024
Messages
17
Reaction score
4
I modified ProtocolGame::AddCreature to show my storage which is the number of resets next to the player name. But when a person goes to add VIP or send a message it says that the player does not exist because it changes the person's name too. Any solution?
TFS 1.5

Lua:
const Player* otherPlayer = creature->getPlayer();
if (known) {
    msg.add<uint16_t>(0x62);
    msg.add<uint32_t>(creature->getID());
} else {
    msg.add<uint16_t>(0x61);
    msg.add<uint32_t>(remove);
    msg.add<uint32_t>(creature->getID());
   if (const Player* player = dynamic_cast<const Player*>(creature)) {
    int storageValue;
    if (player->getStorageValue(500, storageValue)) {
        std::string storageString = "[" + std::to_string(storageValue) + "]";
        std::stringstream ss;
        ss << player->getName() << " " << storageString;
        msg.addString(ss.str());
    } else {
       
        std::string storageString = "[0]";
      
        std::stringstream ss;
        ss << player->getName() << " " << storageString;
        msg.addString(ss.str());
    }
} else {
    msg.addString(creature->getName());
}

}


 
Last edited:
i use TFS 1.5, My reset system uses storage, can you make this modification for me? @Albert José
Sorry bro, I can't, but you can use my example as a guide to change yours, I think the difference will be the value sent by server, mine use a attribute from player class, yours should send the storage value
 
Back
Top