• 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++ Advanced loot system error

Zombiegod

Member
Joined
Oct 22, 2009
Messages
198
Solutions
1
Reaction score
24

i get the error in player.cpp

Code:
dentifier "StringVector" is undefined
 
This is the missing commit I believe:
To fix the error preventing building of that branch as-is on VS 2019 (for me at-least).

If you're getting other errors you've messed with something.
I assume you didn't merge the branch in git you copied and pasted the file changes? is that why? you've stuffed up a copy or missed something?
 
Last edited:
This is the missing commit I believe:
It's not, this guy has some problems cause he tries to add it idk what. StringVector is typedef class std::vector<std::string>, you dont have it obviously in your source (but tfs has it), so fix your sources.
 
It's not, this guy has some problems cause he tries to add it idk what. StringVector is typedef class std::vector<std::string>, you dont have it obviously in your source (but tfs has it), so fix your sources.

Ohhh I see now.


i get the error in player.cpp

Code:
dentifier "StringVector" is undefined

You haven't copied the code over properly.
Probably something here:

Try copying it over again:
 
It's not, this guy has some problems cause he tries to add it idk what. StringVector is typedef class std::vector<std::string>, you dont have it obviously in your source (but tfs has it), so fix your sources.
this is where i got my source

if i am missing it then its not my fault. it might be my fault for using a different source version though. As this one has been weird af, as not everything 1.2 works and not everything 1.3 works smh.
Post automatically merged:

okay so took a look at the master and my version

the master has

C++:
using StringVector = std::vector<std::string>;

in tool.h mine does not

also i had to make DB changes due to the different versions

From
C++:
Database& db = Database::getInstance();

too
C++:
Database* db = Database::getInstance();

and from
C++:
if (DBResult_ptr result = db.storeQuery(query.str())) {

too

C++:
if (DBResult_ptr result = db->storeQuery(query.str())) {

was able to compile successfully after
 
Last edited:
I use TFS 1.3 and client 12.30
How to fix this error?

when I enter the command !autoloot
I get this error
Bez tytułu.png

my autoloot.lua
Lua:
function onSay(player, words, param)
    local lootlist, sum = player:getAutoLootList(), 1
    if lootlist then
        player:registerEvent('autoloot')
        local title = "Autoloot Helper!"
        local message = "You are currently looting the following items:"
        local window = ModalWindow(1000, title, message)
        table.sort(lootlist, function(a, b) return ItemType(a):getName() < ItemType(b):getName() end)
        for _, item in ipairs(lootlist) do
        local resultId = db.storeQuery('SELECT `cont_id` FROM `player_autoloot_persist` WHERE `player_guid` = ' .. getPlayerGUID(player) .. ' AND `item_id` = ' .. ItemType(item):getId() .. '')
                if resultId then
                    local bp_id = result.getNumber(resultId, 'cont_id')
                end
                local backvinculo
                if result.getNumber(resultId, 'cont_id') and result.getNumber(resultId, 'cont_id') > 0 then
                    backvinculo = '| '..ItemType(result.getNumber(resultId, 'cont_id')):getName()..''
                    else
                    backvinculo = ''
                end

            window:addChoice(sum, "".. string.gsub(" "..(ItemType(item)):getName(), "%W%l", string.upper):sub(2, 21) .." "..string.gsub(" "..string.lower(backvinculo), "%W%l", string.upper):sub(2).."")
            sum = sum + 1
        end
        window:addButton(106, "Backpack")
        window:addButton(100, "Confirm")
        window:addButton(102, "Remove")
        if autolootBP == 1 then
        window:setDefaultEnterButton(106, "Backpack")
        end
        window:sendToPlayer(player)
        return true
    else
        player:sendCancelMessage("The list is empty.")
        return false
    end
end
 
Back
Top