[TUT] Allow Player Movement While In Pause

Newbie Spellweaver
Joined
Sep 11, 2014
Messages
21
Reaction score
19
Quick tutorial on how to allow for player movement and rotation while in the Pause screen.
The pause screen includes, Backpack, Options, Player Tab, While Disconnecting from server, etc etc..

Open HUD_TPSGame.cpp


Inside ProcessPlayerMovement();
Search for:
Mouse->GetMouseVisibility()||(hudMain &&(hudMain->isChatInputActive()|| hudMain->isPlayersListVisible())))// do not update player if we are in menu control mode!
{
disablePlayerMovement =true;
disablePlayerRotation =true;
}
Add Below:
if(hudPause && hudPause->isActive()){//SP 303
disablePlayerMovement =false;
disablePlayerRotation =false;
}

if(hudPause && hudPause->isActive()&&InputMappingMngr->isPressed(r3dInputMappingMngr::KS_CROUCH)){//SP 303
disablePlayerMovement =true;
disablePlayerRotation =true;
}
----
Inside SetCameraPure();
Search for:
if(pl->bDead && hudAttm->isActive())
hudAttm->Deactivate();
Below Find:
if(hudPause->isActive())return;
Replace with:
//if(hudPause->isActive()) return;
Hope this helps
Credits: GetRektBami (Dont remove this pls mods is make this)
 
Last edited:
Also this allows you to movement while using Locker box (personal locker), crafting items, repairing items, etc. To me this isn't a good thing, for example Locker box, if you're using it in an long range so this player is cheating or something, right? you need to make an condition like:

Code:
if(... !hudCraft->isActive() || !hudRepair->isActive() || ...

hudSafelock is the Personal locker so you can check, if player is using it with:

Code:
 hudSafelock->isActive()

Doing it so players can't move while doing those things :) Just a tip.
 
Last edited:
how to disable mouse rotation ?

disablePlayerMovement = just keyboard player movement
disablePlayerRotation = just mouse rotation


All checks.

Code:
		hudPause->isActive() // Pause Menu "ESC"
		hudMain->isPlayersListVisible() // PlayerList "TAB"
		hudAttm->isActive() // Attachment Menu
		hudCraft->isActive() // Craft Menu
		hudSafelock->isActive() // Personal Locker
		hudStore->isActive() // "F10" Store in-game
		hudRepair->isActive() // Hepair Item Menu
		hudTrade->isActive() // Trade menu
		hudVault->isActive() // NPC
 
Last edited:
Back