• 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++ ForYourInformation (FYI) - Add OTX 2

potinho

Intermediate OT User
Joined
Oct 11, 2009
Messages
1,397
Solutions
17
Reaction score
148
Location
Brazil
Hello everybody, how are you guys?

I want to add on my sources FYI (that box who came with text, my old engine and protocol dont have). I've look to new protocol to copy, but gotting errors. Can u guys show me how to put FYI into my server?


Have coppied those functions bellow:
1655506405637.png
 
C++:
  CXX      protocollogin.o
protocolgame.cpp: In member function ‘void ProtocolGame::sendFYIBox(const string&)’:
protocolgame.cpp:1888:7: error: ‘class OutputMessage’ has no member named ‘addByte’
  msg->addByte(0x15);
       ^~~~~~~
protocolgame.cpp:1889:7: error: ‘class OutputMessage’ has no member named ‘addString’; did you mean ‘getString’?
  msg->addString(message);
       ^~~~~~~~~
       getString
Makefile:553: recipe for target 'protocolgame.o' failed

I just put this:

C++:
void ProtocolGame::sendFYIBox(const std::string& message)
{
    if(message.empty() || message.length() > 1018) //Prevent client debug when message is empty or length is > 1018 (not confirmed)
    {
        std::clog << "[Warning - ProtocolGame::sendFYIBox] Trying to send an empty or too huge message." << std::endl;
        return;
    }

    OutputMessage_ptr msg = getOutputBuffer();
    if(!msg)
        return;

    TRACK_MESSAGE(msg);
    msg->addByte(0x15);
    msg->addString(message);
}

C++:
  CXX      protocollogin.o
protocolgame.cpp: In member function ‘void ProtocolGame::sendFYIBox(const string&)’:
protocolgame.cpp:1888:7: error: ‘class OutputMessage’ has no member named ‘addByte’
  msg->addByte(0x15);
       ^~~~~~~
protocolgame.cpp:1889:7: error: ‘class OutputMessage’ has no member named ‘addString’; did you mean ‘getString’?
  msg->addString(message);
       ^~~~~~~~~
       getString
Makefile:553: recipe for target 'protocolgame.o' failed

I just put this:

C++:
void ProtocolGame::sendFYIBox(const std::string& message)
{
    if(message.empty() || message.length() > 1018) //Prevent client debug when message is empty or length is > 1018 (not confirmed)
    {
        std::clog << "[Warning - ProtocolGame::sendFYIBox] Trying to send an empty or too huge message." << std::endl;
        return;
    }

    OutputMessage_ptr msg = getOutputBuffer();
    if(!msg)
        return;

    TRACK_MESSAGE(msg);
    msg->addByte(0x15);
    msg->addString(message);
}
i already changed to

C++:
void ProtocolGame::sendFYIBox(const std::string& message)
{
    if(message.empty() || message.length() > 1018) //Prevent client debug when message is empty or length is > 1018 (not confirmed)
    {
        std::clog << "[Warning - ProtocolGame::sendFYIBox] Trying to send an empty or too huge message." << std::endl;
        return;
    }

    OutputMessage_ptr msg = getOutputBuffer();
    if(!msg)
        return;

    TRACK_MESSAGE(msg);
    msg->put<char>(0xDD);
    msg->putString(message);
}

I can compile but nothing appears on game, no information on screen or errors on console.

Trying to use here

Lua:
function ShowItemsTabble(cid)
    local autolootItems  = getItensFromAutoloot(cid)
    local n,content = 0,"[+] Auto Loot Commands [+]\n\n!autoloot item name --> To add ou Remove item from list.\n!autoloot money --> To collect crystal coin automatically.\n!autoloot clear --> To clear the list.\n!autoloot on/off --> To enable or disable the collecting of items in the system.\n!autoloot message --> To enable or disable message from Collect items.\n!autoloot color --> To change Color message in Auto Loot Collect.\n!autoloot warn --> To enable or disable message warning of "..info.Warn_Bp_Slots.." or less slots in the backpack.\n\n[+] Auto Loot Info [+]\n\nSystem: "..(getPlayerStorageValue(cid, info.Storages[1]) <= 0 and "Activated" or "Disabled")..".\nCrystal Coin Collecting: "..(getPlayerStorageValue(cid, info.Storages[2]) > 0 and "Activated" or "Disabled")..".\nMessage: "..(getPlayerStorageValue(cid, info.Storages[6]) <= 0 and "Activated" or "Disabled")..".\nColor Message: "..Color_Loot[getPlayerColorLootMessage(cid)][2]..".\nWarn Backpack: "..(getPlayerStorageValue(cid, info.Storages[3]) <= 0 and "Activated" or "Disabled")..".\nMaximum Slots: ["..#autolootItems.."/"..(isVIP(cid) and info.Max_Slots.premium or info.Max_Slots.free).."]\n\n[+] Auto Loot Slots [+]\n\n"
    if #autolootItems  > 0 then
        for index, itemid in pairs(autolootItems) do
            local it = getItemInfo(itemid)
            content = string.format("%s %c %s\n", content, 155, it.name)
        end
    end
    return doPlayerPopupFYI(cid, content)
end
 
Last edited:
Back
Top