[Tutorial]Switching Weapons while running & place old ammo back in backpack

Results 1 to 3 of 3
  1. #1
    Novice TH4D3U5 is offline
    MemberRank
    Feb 2014 Join Date
    Köhra, SachsenLocation
    4Posts

    smile [Tutorial]Switching Weapons while running & place old ammo back in backpack

    Heya,

    first of all, i dont know if something like this already exists

    Switch Weapons while running:
    Search in WarZ.sln in AI_Player.cpp for:
    Code:
    else if(InputMappingMngr->wasPressed(r3dInputMappingMngr::KS_NEXTITEM))
    and scroll up until u see something like that:
    Code:
    if(PlayerState != PLAYER_MOVE_SPRINT )
    and remove that check and the else (there r 2 of that (for final & release))

    place old ammo in backpack instead of dropping it:
    in WarZ_Server.sln in obj_ServerPlayer.cpp search for:
    Code:
    void obj_ServerPlayer::OnNetPacket(const PKT_C2C_PlayerReload_s& n)
    and scroll down until u see something like that:
    Code:
        if(wpn->getPlayerItem().Var1 > 0 && wpn->getPlayerItem().Var2 > 0)
        {
            obj_DroppedItem* obj = (obj_DroppedItem*)srv_CreateGameObject("obj_DroppedItem", "obj_DroppedItem", GetRandomPosForItemDrop());
            obj->SetNetworkID(gServerLogic.GetFreeNetId());
            obj->NetworkLocal = true;
            // vars
            obj->m_Item.itemID   = wpn->getPlayerItem().Var2;
            obj->m_Item.quantity = 1;
            obj->m_Item.Var1     = wpn->getPlayerItem().Var1;
        }
    and change it to:
    Code:
        if(wpn->getPlayerItem().Var1 > 0 && wpn->getPlayerItem().Var2 > 0)
        {
            wiInventoryItem wi;
            wi.itemID   = wpn->getPlayerItem().Var2;
            wi.quantity = 1;
            wi.Var1     = wpn->getPlayerItem().Var1;
            BackpackAddItem(wi);
        }
    Have fun, TH4D3U5


  2. #2
    Account Upgraded | Title Enabled! KlausVander is offline
    MemberRank
    May 2013 Join Date
    BrasilLocation
    240Posts

    Re: [Tutorial]Switching Weapons while running & place old ammo back in backpack

    Thanks u man,

  3. #3
    Novice WarZLover is offline
    MemberRank
    Aug 2016 Join Date
    4Posts

    Re: [Tutorial]Switching Weapons while running & place old ammo back in backpack

    I have absolutely no clue what i should change to fix this. can someone please send me the code?
    for fixing the switch while sprinting. TY



Advertisement