Bindtoggle for First/Thirdperson (1 Viewer)

moonsic

Well-Known Member
Joined
Mar 19, 2021
Messages
175
So, I spent a little time trying out to bind Leftclick (mouse1) to switch between First/Thirdperson, but I didn't really came to a satisfying result.

This is what I did:

alias "view" "sm_firstperson"
alias "sm_thirdperson" "sm_thirdperson; alias view sm_firstperson"
alias "sm_firstperson" "sm_firstperson; alias view sm_thirdperson"
bind mouse1 "+attack; view"

I don't understand how the 2nd and 3rd lines function, and if you Leftclick (mouse1) it crashes your game (can't even stop the tf2 application with the Task-Manager, so you must restart your pc)

I build the "Game-Crasher" using 2 bindtoggles, I found while browsing, as examples:

alias reload_state reload_on
alias reload_on "+reload; alias reload_state reload_off"
alias reload_off "-reload; alias reload_state reload_on"
bind <key> reload_state

and

bind mouse4 "my_hand"
alias "my_hand" "my_right_hand"
alias "my_left_hand" "cl_righthand 0; alias my_hand my_right_hand"
alias "my_right_hand" "cl_righthand 1; alias my_hand my_left_hand"

I'd love receiving some ideas from you. Thanks.
 
Put this in your autoexec:
Code:
alias togglefp "+attack;firstperson;bind mouse1 toggletp"
alias toggletp "+attack;thirdperson; bind mouse1 togglefp"
bind mouse1 "+attack;toggletp"
 
  • Useful
  • Like
Reactions: moonsic and fanthom
I am very grateful to you for taking your time and giving me a working bindtoggle, however it's not flawless...
 

Attachments

  • db.mp4
    38.7 MB
  • k.mp4
    35.3 MB
What I can gather from your videos is that you keep firing? I suppose the problem is with having to include +attack since it doesn't automatically fire -attack anymore.
Try this:

Code:
alias +togglefp "+attack;firstperson"
alias -togglefp "-attack;bind mouse1 +toggletp"
alias +toggletp "+attack;thirdperson"
alias -toggletp "-attack;bind mouse1 +toggelfp"
bind mouse1 +toggletp
 
  • Useful
Reactions: fanthom
Your new code neither works for me so I've modified it (and the one before), multiple times until my brain melted down, without any sign of sucess. I'll call it a day and try again tomorrow. But still I appreciate your helpfulness and wish you a good night.
 
Your new code neither works for me so I've modified it (and the one before), multiple times until my brain melted down, without any sign of sucess. I'll call it a day and try again tomorrow. But still I appreciate your helpfulness and wish you a good night.
My bad, I wasn't paying as much attention as I should've.
There's a typo in my previous response and the commands are incorrect.
This one is fixed and guaranteed to work.

Code:
alias +togglefp "+attack;fp"
alias -togglefp "-attack;bind mouse1 +toggletp"
alias +toggletp "+attack;tp"
alias -toggletp "-attack;bind mouse1 +togglefp"
bind mouse1 +toggletp
 
Like you said it works fine. Again there are no words to describe my appreciation for helping me and also teaching me because I've learned a lot since yesterday. I hope you continue to help other people who are stuck with a problem.
 

Users who are viewing this thread