[Tutorial] Vault activation

Page 1 of 6 123456 LastLast
Results 1 to 15 of 86
  1. #1
    Member renildomarcio is offline
    MemberRank
    Mar 2013 Join Date
    BR, USALocation
    57Posts

    thumbs up [Tutorial] Vault activation

    Let her staff ragezone.com
    Let's activate the Vault


    1st fetch the file HUDVault.cpp and delete all the code it.
    And add this code in place.

    Code:
    #pragma region VAULT_IS_WORKING
    #include "r3dPCH.h"
    #include "r3d.h"
    
    
    #include "r3dDebug.h"
    
    
    #include "HUDVault.h"
    
    
    #include "../ObjectsCode/weapons/WeaponArmory.h"
    #include "../ObjectsCode/ai/AI_Player.h"
    
    
    #include "../multiplayer/MasterServerLogic.h"
    #include "../multiplayer/ClientGameLogic.h"
    
    
    extern const wchar_t* getReputationString(int Reputation);
    
    
    HUDVault::HUDVault() :
    isActive_(false),
    isInit_(false),
    prevKeyboardCaptureMovie(NULL)
    {
    }
    
    
    HUDVault::~HUDVault()
    {
    }
    
    
    void HUDVault::addClientSurvivor(const wiCharDataFull& slot)
    {
        Scaleform::GFx::Value var[22];
        char tmpGamertag[128];
        if(slot.ClanID != 0)
            sprintf(tmpGamertag, "[%s] %s", slot.ClanTag, slot.Gamertag);
        else
            r3dscpy(tmpGamertag, slot.Gamertag);
        var[0].SetString(tmpGamertag);
        var[1].SetNumber(slot.Health);
        var[2].SetNumber(slot.Stats.XP);
        var[3].SetNumber(slot.Stats.TimePlayed);
        var[4].SetNumber(slot.Hardcore);
        var[5].SetNumber(slot.HeroItemID);
        var[6].SetNumber(slot.HeadIdx);
        var[7].SetNumber(slot.BodyIdx);
        var[8].SetNumber(slot.LegsIdx);
        var[9].SetNumber(slot.Alive);
        var[10].SetNumber(slot.Hunger);
        var[11].SetNumber(slot.Thirst);
        var[12].SetNumber(slot.Toxic);
        var[13].SetNumber(slot.BackpackID);
        var[14].SetNumber(slot.BackpackSize);
        var[15].SetNumber(0);        // weight
        var[16].SetNumber(slot.Stats.KilledZombies);        // zombies Killed
        var[17].SetNumber(slot.Stats.KilledBandits);        // bandits killed
        var[18].SetNumber(slot.Stats.KilledSurvivors);        // civilians killed
        var[19].SetStringW(getReputationString(slot.Stats.Reputation));    // alignment
        var[20].SetString("COLORADO");    // last Map
        var[21].SetBoolean(slot.GameFlags & wiCharDataFull::GAMEFLAG_NearPostBox);
    
    
        gfxMovie.Invoke("_root.api.addClientSurvivor", var, 22);
    
    
        gfxMovie.Invoke("_root.api.clearBackpack", NULL, 0);
    
    
        addBackpackItems(slot);
    
    
        
    }
    void HUDVault::addBackpackItems(const wiCharDataFull& slot)
    {
        Scaleform::GFx::Value var[7];
        r3dOutToLog("AddBackPackItems\n");
        for (int a = 0; a < slot.BackpackSize; a++)
        {
            if (slot.Items[a].InventoryID != 0)
            {
                var[0].SetInt(a);
                var[1].SetUInt(uint32_t(slot.Items[a].InventoryID));
                var[2].SetUInt(slot.Items[a].itemID);
                var[3].SetInt(slot.Items[a].quantity);
                var[4].SetInt(slot.Items[a].Var1);
                var[5].SetInt(slot.Items[a].Var2);
                char tmpStr[128] = {0};
                getAdditionalDescForItem(slot.Items[a].itemID, slot.Items[a].Var1, slot.Items[a].Var2, tmpStr);
                var[6].SetString(tmpStr);
                gfxMovie.Invoke("_root.api.addBackpackItem", var, 7);
            }
        }
    }
    void HUDVault::updateInventoryAndSkillItems()
    {
        Scaleform::GFx::Value var[7];
        // clear inventory DB
        gfxMovie.Invoke("_root.api.clearInventory", NULL, 0);
        
        // add all items
        for(uint32_t i=0; i<gUserProfile.ProfileData.NumItems; ++i)
        {
            var[0].SetUInt(uint32_t(gUserProfile.ProfileData.Inventory[i].InventoryID));
            var[1].SetUInt(gUserProfile.ProfileData.Inventory[i].itemID);
            var[2].SetNumber(gUserProfile.ProfileData.Inventory[i].quantity);
            var[3].SetNumber(gUserProfile.ProfileData.Inventory[i].Var1);
            var[4].SetNumber(gUserProfile.ProfileData.Inventory[i].Var2);
            bool isConsumable = false;
            {
                const WeaponConfig* wc = g_pWeaponArmory->getWeaponConfig(gUserProfile.ProfileData.Inventory[i].itemID);
                if(wc && wc->category == storecat_UsableItem && wc->m_isConsumable)
                    isConsumable = true;
            }
            var[5].SetBoolean(isConsumable);
            char tmpStr[128] = {0};
            getAdditionalDescForItem(gUserProfile.ProfileData.Inventory[i].itemID, gUserProfile.ProfileData.Inventory[i].Var1, gUserProfile.ProfileData.Inventory[i].Var2, tmpStr);
            var[6].SetString(tmpStr);
            gfxMovie.Invoke("_root.api.addInventoryItem", var, 7);
        }
    }
    
    
    void HUDVault::updateSurvivorTotalWeight(const wiCharDataFull& slot)
    {
        float totalWeight = slot.getTotalWeight();
    
    
        Scaleform::GFx::Value var[2];
        var[0].SetString(slot.Gamertag);
        var[1].SetNumber(totalWeight);
        gfxMovie.Invoke("_root.api.updateClientSurvivorWeight", var, 2);
    }
    
    
    void HUDVault::eventReturnToGame(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
    {
        Deactivate();
    }
    
    
    void HUDVault::eventBackpackFromInventory(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
    {
        const wiCharDataFull& slot = gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID];
        if(!(slot.GameFlags & wiCharDataFull::GAMEFLAG_NearPostBox))
            return;
    
    
        m_inventoryID = args[0].GetUInt();
        m_gridTo = args[1].GetInt();
        m_Amount = args[2].GetInt();
    
    
        Scaleform::GFx::Value var[2];
        var[0].SetStringW(gLangMngr.getString("OneMomentPlease"));
        var[1].SetBoolean(false);
        gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
    
    
        uint32_t itemID = 0;
        for(uint32_t i=0; i<gUserProfile.ProfileData.NumItems; ++i)
        {
            if(gUserProfile.ProfileData.Inventory[i].InventoryID == m_inventoryID)
            {
                itemID = gUserProfile.ProfileData.Inventory[i].itemID;
                break;
            }
        }
    
    
        // check to see if there is anything in backpack, and if there is, then we need to firstly move that item to inventory
        if(slot.Items[m_gridTo].itemID != 0 && slot.Items[m_gridTo].itemID!=itemID)
        {
            m_gridFrom = m_gridTo;
            m_Amount2 = slot.Items[m_gridTo].quantity;
    
    
            // check weight
            float totalWeight = gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID].getTotalWeight();
    
    
        
    
    
            const BaseItemConfig* bic = g_pWeaponArmory->getConfig(slot.Items[m_gridTo].itemID);
            if(bic)
                totalWeight -= bic->m_Weight*slot.Items[m_gridTo].quantity;
        
            bic = g_pWeaponArmory->getConfig(itemID);
            if(bic)
                totalWeight += bic->m_Weight*m_Amount;
            // Skillsystem
            
            if(slot.Stats.skillid2 == 1)
                totalWeight *= 0.9f;
            
    
    
            const BackpackConfig* bc = g_pWeaponArmory->getBackpackConfig(gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID].BackpackID);
            r3d_assert(bc);
            if(totalWeight > bc->m_maxWeight)
            {
                Scaleform::GFx::Value var[2];
                var[0].SetStringW(gLangMngr.getString("FR_PAUSE_TOO_MUCH_WEIGHT"));
                var[1].SetBoolean(true);
                var[2].SetString("");
                gfxMovie.Invoke("_root.api.showInfoMsg", var, 3);
                return;
            }
    
    
            async_.StartAsyncOperation(this, &HUDVault::as_BackpackFromInventorySwapThread, &HUDVault::OnBackpackFromInventorySuccess);
        }
        else
        {
            // check weight
            float totalWeight = gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID].getTotalWeight();
    
    
            const BaseItemConfig* bic = g_pWeaponArmory->getConfig(itemID);
            if(bic)
                totalWeight += bic->m_Weight*m_Amount;
            // Skillsystem
            r3dOutToLog("Player %s TotalWeight is: %f \n", slot.Gamertag, totalWeight);
            if(slot.Stats.skillid2 == 1)
                totalWeight *= 0.9f;
            r3dOutToLog("Player %s adjusted Totalweight is: %f \n", slot.Gamertag, totalWeight);
    
    
            const BackpackConfig* bc = g_pWeaponArmory->getBackpackConfig(gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID].BackpackID);
            r3d_assert(bc);
            if(totalWeight > bc->m_maxWeight)
            {
                Scaleform::GFx::Value var[2];
                var[0].SetStringW(gLangMngr.getString("FR_PAUSE_TOO_MUCH_WEIGHT"));
                var[1].SetBoolean(true);
                var[2].SetString("");
                gfxMovie.Invoke("_root.api.showInfoMsg", var, 3);
                return;
            }
    
    
            async_.StartAsyncOperation(this, &HUDVault::as_BackpackFromInventoryThread, &HUDVault::OnBackpackFromInventorySuccess);
        }
    }
    
    
    unsigned int WINAPI HUDVault::as_BackpackFromInventorySwapThread(void* in_data)
    {
        r3dThreadAutoInstallCrashHelper crashHelper;
        HUDVault* This = (HUDVault*)in_data;
    
    
        This->async_.DelayServerRequest();
    
    
        // move item in backpack to inventory
        int apiCode = gUserProfile.ApiBackpackToInventory(This->m_gridFrom, This->m_Amount2);
        r3dOutToLog("GridFrom: %d, Amount: %d\n", This->m_gridFrom, This->m_Amount);
        if(apiCode != 0)
        {
            if(apiCode==7)
                This->async_.SetAsyncError(0, gLangMngr.getString("GameSessionHasNotClosedYet"));
            else
                This->async_.SetAsyncError(apiCode, gLangMngr.getString("BackpackToInventoryFail"));
            return 0;
        }
    
    
        apiCode = gUserProfile.ApiBackpackFromInventory(This->m_inventoryID, This->m_gridTo, This->m_Amount);
        r3dOutToLog("InventoryID: %d, GridTo: %d, Amount: %d\n", This->m_inventoryID, This->m_gridTo, This->m_Amount);
        if(apiCode != 0)
        {
            if(apiCode==7)
                This->async_.SetAsyncError(0, gLangMngr.getString("GameSessionHasNotClosedYet"));
            else
                This->async_.SetAsyncError(apiCode, gLangMngr.getString("FailedToFindBackpack"));
            return 0;
        }
    
    
        return 1;
    }
    
    
    void HUDVault::OnBackpackFromInventorySwapSuccess()
    {
        obj_Player* plr = gClientLogic().localPlayer_;
    
    
        plr->CurLoadout = gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID];
    
    
        PKT_C2S_InventoryOp_s n;
        n.op = n.OP_TOINV;
        n.Slot = m_gridFrom;
        n.Quantity = m_Amount2;
        p2pSendToHost(plr, &n, sizeof(n));
    
    
        n.op = n.OP_FROMINV;
        n.InventoryID = m_inventoryID;
        n.Slot = m_gridTo;
        n.Quantity = m_Amount;
        p2pSendToHost(plr, &n, sizeof(n));
    
    
        plr->OnBackpackChanged(m_gridTo);
    
    
        Scaleform::GFx::Value var[8];
        gfxMovie.Invoke("_root.api.clearBackpack", NULL, 0);
        
    
    
            addBackpackItems(plr->CurLoadout);
        
    
    
        updateInventoryAndSkillItems();
    
    
        updateSurvivorTotalWeight(plr->CurLoadout);
    
    
        gfxMovie.Invoke("_root.api.hideInfoMsg", NULL, 0);
        gfxMovie.Invoke("_root.api.backpackFromInventorySuccess", NULL, 0);
        return;
    }
    
    
    unsigned int WINAPI HUDVault::as_BackpackFromInventoryThread(void* in_data)
    {
        r3dThreadAutoInstallCrashHelper crashHelper;
        HUDVault* This = (HUDVault*)in_data;
    
    
        This->async_.DelayServerRequest();
        
        int apiCode = gUserProfile.ApiBackpackFromInventory(This->m_inventoryID, This->m_gridTo, This->m_Amount);
        if(apiCode != 0)
        {
            if(apiCode==7)
                This->async_.SetAsyncError(0, gLangMngr.getString("GameSessionHasNotClosedYet"));
            else
                This->async_.SetAsyncError(apiCode, gLangMngr.getString("BackpackFromInventoryFail"));
            return 0;
        }
    
    
        return 1;
    }
    
    
    void HUDVault::OnBackpackFromInventorySuccess()
    {
        obj_Player* plr = gClientLogic().localPlayer_;
    
    
        plr->CurLoadout = gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID];
    
    
        PKT_C2S_InventoryOp_s n;
        n.op = n.OP_FROMINV;
        n.InventoryID = m_inventoryID;
        n.Slot = m_gridTo;
        n.Quantity = m_Amount;
        p2pSendToHost(plr, &n, sizeof(n));
    
    
        plr->OnBackpackChanged(m_gridTo);
    
    
        Scaleform::GFx::Value var[8];
        gfxMovie.Invoke("_root.api.clearBackpack", NULL, 0);
    
    
    
    
            addBackpackItems(plr->CurLoadout);
        
    
    
        updateInventoryAndSkillItems();
    
    
        updateSurvivorTotalWeight(plr->CurLoadout);
    
    
        gfxMovie.Invoke("_root.api.hideInfoMsg", NULL, 0);
        gfxMovie.Invoke("_root.api.backpackFromInventorySuccess", NULL, 0);
        return;
    }
    
    
    void HUDVault::eventBackpackToInventory(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
    {
        const wiCharDataFull& slot = gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID];
        if(!(slot.GameFlags & wiCharDataFull::GAMEFLAG_NearPostBox))
            return;
    
    
        m_gridFrom = args[0].GetInt();
        m_Amount = args[1].GetInt();
        r3dOutToLog("GridFrom: %d, Amount: %d\n", m_gridFrom, m_Amount);
        Scaleform::GFx::Value var[3];
        var[0].SetStringW(gLangMngr.getString("OneMomentPlease"));
        var[1].SetBoolean(false);
        var[2].SetString("");
        gfxMovie.Invoke("_root.api.showInfoMsg", var, 3);
    
    
        async_.StartAsyncOperation(this, &HUDVault::as_BackpackToInventoryThread, &HUDVault::OnBackpackToInventorySuccess);
    }
    
    
    unsigned int WINAPI HUDVault::as_BackpackToInventoryThread(void* in_data)
    {
        r3dThreadAutoInstallCrashHelper crashHelper;
        HUDVault* This = (HUDVault*)in_data;
    
    
        This->async_.DelayServerRequest();
        r3dOutToLog("Inventory from: %d, Amount: %d\n", This->m_gridFrom, This->m_Amount);
        int apiCode = gUserProfile.ApiBackpackToInventory(This->m_gridFrom, This->m_Amount);
        if(apiCode != 0)
        {
            if(apiCode==7)
                This->async_.SetAsyncError(0, gLangMngr.getString("GameSessionHasNotClosedYet"));
            else
                This->async_.SetAsyncError(apiCode, gLangMngr.getString("BackpackToInventoryFail"));
            return 0;
        }
    
    
        return 1;
    }
    
    
    void HUDVault::OnBackpackToInventorySuccess()
    {
        obj_Player* plr = gClientLogic().localPlayer_;
    
    
        plr->CurLoadout = gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID];
    
    
        PKT_C2S_InventoryOp_s n;
        n.op = n.OP_TOINV;
        n.Slot = m_gridFrom;
        n.Quantity = m_Amount;
        p2pSendToHost(plr, &n, sizeof(n));
    
    
        plr->OnBackpackChanged(m_gridFrom);
    
    
        Scaleform::GFx::Value var[8];
        gfxMovie.Invoke("_root.api.clearBackpack", NULL, 0);
    
    
        
            addBackpackItems(plr->CurLoadout);
        
    
    
        updateInventoryAndSkillItems ();
    
    
        updateSurvivorTotalWeight(plr->CurLoadout);
    
    
        gfxMovie.Invoke("_root.api.hideInfoMsg", NULL, 0);
        gfxMovie.Invoke("_root.api.backpackToInventorySuccess", NULL, 0);
    
    
        return;
    }
    
    
    void HUDVault::eventBackpackGridSwap(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
    {
        m_gridFrom = args[0].GetInt();
        m_gridTo = args[1].GetInt();
    
    
        Scaleform::GFx::Value var[3];
        var[0].SetStringW(gLangMngr.getString("OneMomentPlease"));
        var[1].SetBoolean(false);
        var[2].SetString("");
        gfxMovie.Invoke("_root.api.showInfoMsg", var, 3);
    
    
        async_.StartAsyncOperation(this, &HUDVault::as_BackpackGridSwapThread, &HUDVault::OnBackpackGridSwapSuccess);
    }
    
    
    unsigned int WINAPI HUDVault::as_BackpackGridSwapThread(void* in_data)
    {
        r3dThreadAutoInstallCrashHelper crashHelper;
        HUDVault* This = (HUDVault*)in_data;
    
    
        This->async_.DelayServerRequest();
        
        int apiCode = gUserProfile.ApiBackpackGridSwap(This->m_gridFrom, This->m_gridTo);
        if(apiCode != 0)
        {
            if(apiCode==7)
                This->async_.SetAsyncError(0, gLangMngr.getString("GameSessionHasNotClosedYet"));
            else
                This->async_.SetAsyncError(apiCode, gLangMngr.getString("SwitchBackpackSameBackpacks"));
            return 0;
        }
    
    
        return 1;
    }
    
    
    void HUDVault::OnBackpackGridSwapSuccess()
    {
        obj_Player* plr = gClientLogic().localPlayer_;
    
    
        plr->CurLoadout = gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID];
    
    
        PKT_C2S_BackpackSwap_s n;
        n.SlotFrom = m_gridFrom;
        n.SlotTo   = m_gridTo;
        p2pSendToHost(plr, &n, sizeof(n));
    
    
        plr->OnBackpackChanged(m_gridFrom);
        plr->OnBackpackChanged(m_gridTo);
    
    
        Scaleform::GFx::Value var[8];
        gfxMovie.Invoke("_root.api.clearBackpack", NULL, 0);
    
    
        
            addBackpackItems(plr->CurLoadout);
        
    
    
        updateSurvivorTotalWeight(plr->CurLoadout);
    
    
        gfxMovie.Invoke("_root.api.hideInfoMsg", NULL, 0);
        gfxMovie.Invoke("_root.api.backpackGridSwapSuccess", NULL, 0);
        return;
    }
    
    
    bool HUDVault::Init()
    {
         if(!gfxMovie.Load("Data\\Menu\\WarZ_HUD_PostOffice.swf", false)) 
        {
             return false;
        }
    
    
    #define MAKE_CALLBACK(FUNC) new r3dScaleformMovie::TGFxEICallback<HUDVault>(this, &HUDVault::FUNC)
         gfxMovie.RegisterEventHandler("eventBackpackFromInventory", MAKE_CALLBACK(eventBackpackFromInventory));
        gfxMovie.RegisterEventHandler("eventBackpackToInventory", MAKE_CALLBACK(eventBackpackToInventory));
        gfxMovie.RegisterEventHandler("eventBackpackGridSwap", MAKE_CALLBACK(eventBackpackGridSwap));
        gfxMovie.RegisterEventHandler("eventReturnToGame", MAKE_CALLBACK(eventReturnToGame));
    
    
        gfxMovie.SetCurentRTViewport(Scaleform::GFx::Movie::SM_ExactFit);
        itemInventory_.initialize(&gfxMovie);
        isActive_ = false;
        isInit_ = true;
        return true;
    }
    
    
    bool HUDVault::Unload()
    {
         gfxMovie.Unload();
        isActive_ = false;
        isInit_ = false;
        return true;
    }
    
    
    void HUDVault::Update()
    {
        async_.ProcessAsyncOperation(this, gfxMovie);
    }
    
    
    void HUDVault::Draw()
    {
         gfxMovie.UpdateAndDraw();
    }
    
    
    void HUDVault::Deactivate()
    {
        if (async_.Processing())
        {
            return;
        }
    
    
        Scaleform::GFx::Value var[1];
        var[0].SetString("menu_close");
        gfxMovie.OnCommandCallback("eventSoundPlay", var, 1);
    
    
        if(prevKeyboardCaptureMovie)
        {
            prevKeyboardCaptureMovie->SetKeyboardCapture();
            prevKeyboardCaptureMovie = NULL;
        }
    
    
        if(!g_cursor_mode->GetInt())
        {
            r3dMouse::Hide();
        }
    
    
        isActive_ = false;
    }
    
    
    void HUDVault::Activate()
    {
        prevKeyboardCaptureMovie = gfxMovie.SetKeyboardCapture(); // for mouse scroll events
        
        r3d_assert(!isActive_);
        r3dMouse::Show();
        isActive_ = true;
        addClientSurvivor(gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID]);
        updateInventoryAndSkillItems();
        updateSurvivorTotalWeight(gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID]);
    
    
        reloadBackpackInfo();
        //updateSurvivorTotalWeight(gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID]);
        
        gfxMovie.Invoke("_root.api.showInventoryScreen", NULL, 0);
    
    
        Scaleform::GFx::Value var[1];
        var[0].SetString("menu_open");
        gfxMovie.OnCommandCallback("eventSoundPlay", var, 1);
    }
    void HUDVault::reloadBackpackInfo()
    {
        // reset backpack
        {
            gfxMovie.Invoke("_root.api.clearBackpack", "");
            gfxMovie.Invoke("_root.api.clearBackpacks", "");
        }
    
    
        std::vector<uint32_t> uniqueBackpacks; // to filter identical backpack
        int backpackSlotIDInc = 0;
        // add backpack content info
        {
            obj_Player* plr = gClientLogic().localPlayer_;
            r3d_assert(plr);
            wiCharDataFull& slot = plr->CurLoadout;
    
    
            Scaleform::GFx::Value var[7];
            for (int a = 0; a < slot.BackpackSize; a++)
            {
                if (slot.Items[a].itemID != 0)
                {
                    var[0].SetInt(a);
                    var[1].SetUInt(0); // not used for game
                    var[2].SetUInt(slot.Items[a].itemID);
                    var[3].SetInt(slot.Items[a].quantity);
                    var[4].SetInt(slot.Items[a].Var1);
                    var[5].SetInt(slot.Items[a].Var2);
                    char tmpStr[128] = {0};
                    getAdditionalDescForItem(slot.Items[a].itemID, slot.Items[a].Var1, slot.Items[a].Var2, tmpStr);
                    var[6].SetString(tmpStr);
                    gfxMovie.Invoke("_root.api.addBackpackItem", var, 7);
    
    
                    const BackpackConfig* bpc = g_pWeaponArmory->getBackpackConfig(slot.Items[a].itemID);
                    if(bpc)
                    {
                        if(std::find<std::vector<uint32_t>::iterator, uint32_t>(uniqueBackpacks.begin(), uniqueBackpacks.end(), slot.Items[a].itemID) != uniqueBackpacks.end())
                            continue;
    
    
                        // add backpack info
                        var[0].SetInt(backpackSlotIDInc++);
                        var[1].SetUInt(slot.Items[a].itemID);
                        gfxMovie.Invoke("_root.api.addBackpack", var, 2);
    
    
                        uniqueBackpacks.push_back(slot.Items[a].itemID);
                    }
                }
            }
        }
    
    
        gfxMovie.Invoke("_root.api.Main.Inventory.showBackpack", "");
    }
    
    
    #pragma endregion VAULT_IS_WORKING
    2º codigo e em HUDVault.h
    Delete tudo la e adicione este.

    Code:
    #pragma once
    
    
    #include "APIScaleformGfx.h"
    #include "UIItemInventory.h"
    
    
    #include "FrontEndShared.h"
    #include "../GameCode/UserProfile.h"
    
    
    #include "UIAsync.h"
    
    
    class HUDVault
    {
        bool    isActive_;
        bool    isInit_;
    
    
    public: 
        HUDVault();
        ~HUDVault();
    
    
        bool Init();
        bool Unload();
    
    
        bool IsInited() const { return isInit_; }
    
    
        void Update();
        void Draw();
    
    
        bool isActive() const { return isActive_; }
        void Activate();
        void Deactivate();
    
    
        void addCategories();
        void addTabTypes();
        void addItems();
    
    
        void eventReturnToGame(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
        void eventBackpackFromInventory(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
        void eventBackpackToInventory(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
        void eventBackpackGridSwap(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
    
    
    private:
        UIAsync<HUDVault> async_;
        r3dScaleformMovie gfxMovie;
        r3dScaleformMovie* prevKeyboardCaptureMovie;
    
    
        __int64    m_inventoryID;
        int        m_gridTo;
        int        m_gridFrom;
        int        m_Amount;
        int        m_Amount2;
    
    
        void    addClientSurvivor(const wiCharDataFull& slot);
        void    addBackpackItems(const wiCharDataFull& slot);
        void    updateInventoryAndSkillItems();
        void    updateSurvivorTotalWeight(const wiCharDataFull& slot);
        void    reloadBackpackInfo();
    
    
        static    unsigned int WINAPI as_BackpackFromInventoryThread(void* in_data);
        void        OnBackpackFromInventorySuccess();
        static    unsigned int WINAPI as_BackpackFromInventorySwapThread(void* in_data);
        void        OnBackpackFromInventorySwapSuccess();
        static    unsigned int WINAPI as_BackpackToInventoryThread(void* in_data);
        void        OnBackpackToInventorySuccess();
        static    unsigned int WINAPI as_BackpackGridSwapThread(void* in_data);
        void        OnBackpackGridSwapSuccess();
    
    
        UIItemInventory itemInventory_;
    };
    after doing this should already be running your Vault.
    I have helped the community here!



    Code By: RenildoMarcio
    Last edited by renildomarcio; 16-10-13 at 01:17 PM.


  2. #2
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Vault activation

    it was Hud Vault??

  3. #3
    Member renildomarcio is offline
    MemberRank
    Mar 2013 Join Date
    BR, USALocation
    57Posts

    Re: [Tutorial] Vault activation

    Quote Originally Posted by CodexPo View Post
    it was Hud Vault??
    this and the Vault without bugs friend!

  4. #4
    Apprentice xgaah is offline
    MemberRank
    May 2013 Join Date
    13Posts

    Re: [Tutorial] Vault activation

    Hi renildo , you have skype ? , Add me gabriel.520 :)

  5. #5
    Account Upgraded | Title Enabled! Poster13 is offline
    MemberRank
    Jun 2013 Join Date
    395Posts

    Re: [Tutorial] Vault activation

    Thank you) nice work))

  6. #6
    f793 eXtremousZ is offline
    MemberRank
    May 2013 Join Date
    Planet ShearLocation
    857Posts

    Re: [Tutorial] Vault activation

    Wow no bugs? Nice!

  7. #7
    Member steventhedon187 is offline
    MemberRank
    Jul 2013 Join Date
    -> Your RAM <-Location
    59Posts

    Re: [Tutorial] Vault activation

    nice work !

  8. #8
    Breshit bara Elohim loveomg is offline
    MemberRank
    Mar 2007 Join Date
    642Posts

    Re: [Tutorial] Vault activation

    ^^ it works good!!
    thank you friend

  9. #9
    Proficient Member Lewis Caddick is offline
    MemberRank
    May 2013 Join Date
    Casa Del LewisLocation
    160Posts

    Re: [Tutorial] Vault activation

    doesnt work for me i just get this.

    000057.799| Player SexiGirl TotalWeight is: 4.000000
    000057.799| Player SexiGirl adjusted Totalweight is: 4.000000
    000057.961| WO_API: failed with error code 5 ResultCode not set
    000057.961| ApiBackpackFromInventory failed: 5000061.737| Player SexiGirl TotalWeight is: 4.000000
    000061.737| Player SexiGirl adjusted Totalweight is: 4.000000
    000061.807| WO_API: failed with error code 5 ResultCode not set
    000061.807| ApiBackpackFromInventory failed: 5000064.080| Player SexiGirl TotalWeight is: 4.000000
    000064.080| Player SexiGirl adjusted Totalweight is: 4.000000
    000064.170| WO_API: failed with error code 5 ResultCode not set
    000064.170| ApiBackpackFromInventory failed: 5000074.476| AddBackPackItems
    000075.313| GridFrom: 0, Amount: 1
    000075.314| Inventory from: 0, Amount: 1
    000075.314| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 723: wi1->InventoryID > 0
    000075.314| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 724: wi1->quantity >= amount
    000075.414| WO_API: failed with error code 5 ResultCode not set
    000075.414| ApiBackpackToInventory failed: 5000079.707| GridFrom: 0, Amount: 1
    000079.707| Inventory from: 0, Amount: 1
    000079.707| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 723: wi1->InventoryID > 0
    000079.707| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 724: wi1->quantity >= amount
    000079.772| WO_API: failed with error code 5 ResultCode not set
    000079.772| ApiBackpackToInventory failed: 5000084.755| r3dapp: SysCmd: f060

  10. #10
    Apprentice Drejko is offline
    MemberRank
    Oct 2013 Join Date
    13Posts

    Re: [Tutorial] Vault activation

    Yes, it is working very well for me! :)

  11. #11

    Re: [Tutorial] Vault activation

    its for DNC or InvasionMMO Source?

    its for DNC or InvasionMMO Source?

  12. #12
    Member renildomarcio is offline
    MemberRank
    Mar 2013 Join Date
    BR, USALocation
    57Posts

    Re: [Tutorial] Vault activation

    Quote Originally Posted by Lewis Caddick View Post
    doesnt work for me i just get this.

    000057.799| Player SexiGirl TotalWeight is: 4.000000
    000057.799| Player SexiGirl adjusted Totalweight is: 4.000000
    000057.961| WO_API: failed with error code 5 ResultCode not set
    000057.961| ApiBackpackFromInventory failed: 5000061.737| Player SexiGirl TotalWeight is: 4.000000
    000061.737| Player SexiGirl adjusted Totalweight is: 4.000000
    000061.807| WO_API: failed with error code 5 ResultCode not set
    000061.807| ApiBackpackFromInventory failed: 5000064.080| Player SexiGirl TotalWeight is: 4.000000
    000064.080| Player SexiGirl adjusted Totalweight is: 4.000000
    000064.170| WO_API: failed with error code 5 ResultCode not set
    000064.170| ApiBackpackFromInventory failed: 5000074.476| AddBackPackItems
    000075.313| GridFrom: 0, Amount: 1
    000075.314| Inventory from: 0, Amount: 1
    000075.314| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 723: wi1->InventoryID > 0
    000075.314| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 724: wi1->quantity >= amount
    000075.414| WO_API: failed with error code 5 ResultCode not set
    000075.414| ApiBackpackToInventory failed: 5000079.707| GridFrom: 0, Amount: 1
    000079.707| Inventory from: 0, Amount: 1
    000079.707| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 723: wi1->InventoryID > 0
    000079.707| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 724: wi1->quantity >= amount
    000079.772| WO_API: failed with error code 5 ResultCode not set
    000079.772| ApiBackpackToInventory failed: 5000084.755| r3dapp: SysCmd: f060
    the error is in your database friend :D

    Quote Originally Posted by adm-u307 View Post
    its for dnc or invasionmmo source?

    Its for dnc or invasionmmo source?
    dnc :d

    Quote Originally Posted by Drejko View Post
    Yes, it is working very well for me! :)
    could help the one forced me to always put here!

    Quote Originally Posted by loveomg View Post
    ^^ it works good!!
    thank you friend
    thank you friend

    Quote Originally Posted by steventhedon187 View Post
    nice work !
    thanks a lot!
    of a force giving a thank..

    Quote Originally Posted by zh1nt0 View Post
    Wow no bugs? Nice!
    you can see what people are talking about around the can and other errors can hit it

  13. #13
    Valued Member DarkAngelBR is offline
    MemberRank
    Mar 2013 Join Date
    My HouseLocation
    140Posts

    Re: [Tutorial] Vault activation

    Quote Originally Posted by Lewis Caddick View Post
    doesnt work for me i just get this.

    000057.799| Player SexiGirl TotalWeight is: 4.000000
    000057.799| Player SexiGirl adjusted Totalweight is: 4.000000
    000057.961| WO_API: failed with error code 5 ResultCode not set
    000057.961| ApiBackpackFromInventory failed: 5000061.737| Player SexiGirl TotalWeight is: 4.000000
    000061.737| Player SexiGirl adjusted Totalweight is: 4.000000
    000061.807| WO_API: failed with error code 5 ResultCode not set
    000061.807| ApiBackpackFromInventory failed: 5000064.080| Player SexiGirl TotalWeight is: 4.000000
    000064.080| Player SexiGirl adjusted Totalweight is: 4.000000
    000064.170| WO_API: failed with error code 5 ResultCode not set
    000064.170| ApiBackpackFromInventory failed: 5000074.476| AddBackPackItems
    000075.313| GridFrom: 0, Amount: 1
    000075.314| Inventory from: 0, Amount: 1
    000075.314| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 723: wi1->InventoryID > 0
    000075.314| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 724: wi1->quantity >= amount
    000075.414| WO_API: failed with error code 5 ResultCode not set
    000075.414| ApiBackpackToInventory failed: 5000079.707| GridFrom: 0, Amount: 1
    000079.707| Inventory from: 0, Amount: 1
    000079.707| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 723: wi1->InventoryID > 0
    000079.707| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 724: wi1->quantity >= amount
    000079.772| WO_API: failed with error code 5 ResultCode not set
    000079.772| ApiBackpackToInventory failed: 5000084.755| r3dapp: SysCmd: f060
    try to compile you server again

  14. #14
    Account Upgraded | Title Enabled! Poster13 is offline
    MemberRank
    Jun 2013 Join Date
    395Posts

    Re: [Tutorial] Vault activation

    Change your backpack with a small to large they go into the game, nothing has changed Vault refuses to work by changing the backpack)

  15. #15
    Member Kanna56 is offline
    MemberRank
    Jul 2013 Join Date
    79Posts

    Re: [Tutorial] Vault activation

    Quote Originally Posted by Lewis Caddick View Post
    doesnt work for me i just get this.

    000057.799| Player SexiGirl TotalWeight is: 4.000000
    000057.799| Player SexiGirl adjusted Totalweight is: 4.000000
    000057.961| WO_API: failed with error code 5 ResultCode not set
    000057.961| ApiBackpackFromInventory failed: 5000061.737| Player SexiGirl TotalWeight is: 4.000000
    000061.737| Player SexiGirl adjusted Totalweight is: 4.000000
    000061.807| WO_API: failed with error code 5 ResultCode not set
    000061.807| ApiBackpackFromInventory failed: 5000064.080| Player SexiGirl TotalWeight is: 4.000000
    000064.080| Player SexiGirl adjusted Totalweight is: 4.000000
    000064.170| WO_API: failed with error code 5 ResultCode not set
    000064.170| ApiBackpackFromInventory failed: 5000074.476| AddBackPackItems
    000075.313| GridFrom: 0, Amount: 1
    000075.314| Inventory from: 0, Amount: 1
    000075.314| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 723: wi1->InventoryID > 0
    000075.314| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 724: wi1->quantity >= amount
    000075.414| WO_API: failed with error code 5 ResultCode not set
    000075.414| ApiBackpackToInventory failed: 5000079.707| GridFrom: 0, Amount: 1
    000079.707| Inventory from: 0, Amount: 1
    000079.707| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 723: wi1->InventoryID > 0
    000079.707| ASSERT at file .\Sources\GameCode\UserProfile.cpp, line 724: wi1->quantity >= amount
    000079.772| WO_API: failed with error code 5 ResultCode not set
    000079.772| ApiBackpackToInventory failed: 5000084.755| r3dapp: SysCmd: f060
    same problem with rebuild server...



Page 1 of 6 123456 LastLast

Advertisement