• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

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

Initiate Mage
Joined
Feb 17, 2014
Messages
4
Reaction score
6
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
 
Initiate Mage
Joined
Aug 25, 2016
Messages
4
Reaction score
1
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
 
Back
Top