[Tutorial] Fast change backpack one click all srcs

🚫
Exiled
Joined
Jan 19, 2014
Messages
162
Reaction score
145
HI!!! RAGEZONE

Excuse my English ... As you know all the srcs posted here comes full of errors and bugs, and nothing better than picking up what matters and editing in your pet src ... This code speeds the exchange of bags inside the Game with just 1 click, functional in any src currently I tested it in education and it worked.


Search function
Code:
void HUDPause::eventBackpackDrop(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
{
}


Add above
Code:
void HUDPause::ChangePlayerBackpackFast(int ItemID) // jailson mendes
{
      obj_Player* plr = gClientLogic().localPlayer_;
      r3d_assert(plr);
      wiCharDataFull& slot = plr->CurLoadout;
 
      // find inventory slot
      int slotFrom = -1;
      for(int i=0; i<slot.BackpackSize; ++i)
      {
            if(slot.Items[i].itemID == ItemID)
            {
                  slotFrom = i;
                  break;
            }
      }
      if(slotFrom == -1)
            return;
 
      if(plr->ChangeBackpack(slotFrom))
      {
            {
                  Scaleform::GFx::Value var[10];
                  char tmpGamertag[128];
                  if(plr->ClanID != 0)
                        sprintf(tmpGamertag, "[%s] %s", plr->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.Alive);
                  var[5].SetNumber(slot.Hunger);
                  var[6].SetNumber(slot.Thirst);
                  var[7].SetNumber(slot.Toxic);
                  var[8].SetNumber(slot.BackpackID);
                  var[9].SetNumber(slot.BackpackSize);
                  gfxMovie.Invoke("_root.api.updateClientSurvivor", var, 10);
 
                  if (gClientLogic().localPlayer_)
                        SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/UI Events/User_Action/User_Action_Swap_Backpack"), gClientLogic().localPlayer_->GetPosition());
 
            }
            reloadBackpackInfo();
            updateSurvivorTotalWeight();
            gfxMovie.Invoke("_root.api.changeBackpackSuccess", "");
      }     
      else
      {
            UnlockUI(); // Comment this line if you use a src v1
            Scaleform::GFx::Value var[3];
            var[0].SetStringW(gLangMngr.getString("FailedToChangeBackpack"));
            var[1].SetBoolean(true);
            var[2].SetString("$ERROR");
            gfxMovie.Invoke("_root.api.showInfoMsg", var, 3);
      }
}

Now search for
Code:
void HUDPause::eventContextMenu_Action(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)

And in case 6, make it look like this.
Code:
case 6:
                  if(bc)
                  {
                        ChangePlayerBackpackFast(wi.itemID);
                        //gfxMovie.Invoke("_root.api.Main.showChangeBackpack", "");
                        return;
                  }
            break;


Finally search for this
Code:
void  eventBackpackGridSwap(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);

Add above
Code:
void  ChangePlayerBackpackFast(int ItemID);

Warz_server.sln

Search for:

Code:
void obj_ServerPlayer::OnNetPacket(const PKT_C2S_PlayerChangeBackpack_s& n)


Add after this:
Code:
OnLoadoutChanged();


Code:
[COLOR=#ff0000]PKT_S2C_BackpackUnlock_s n3;    gServerLogic.p2pSendToPeer(peerId_, this, &n3, sizeof(n3));[/COLOR]


Add after this:
Code:
void	eventBackpackGridSwap(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);

This↓
Code:
void	ChangePlayerBackpackFast(int ItemID);

Have FUN!!!
 
Last edited:
fix to fast change backpack (tested in untouched source)
open the warz_server
###LOOK FOR THIS###

void obj_ServerPlayer::RepairItemWithKit(int slot, bool isPremium)


###ADD THIS ABOVE###

OnLoadoutChanged();

//changebackpackfast
PKT_S2C_BackpackUnlock_s n3;
gServerLogic.p2pSendToPeer(peerId_, this, &n3, sizeof(n3));

return;
}


####I GO TO MAKE THE COMPLETE TUTORIAL SOON####
 
Last edited:
Back