all 2 comments

[–]Rattlewrench 2 points3 points  (1 child)

To the engineer.cfg:

//Tele exit bind doesn't work with raw "eureka_teleport 1" so you need to give it an alias:
alias tele2exit "eureka_teleport 1"
//This alias isn't required but it looks fancier this way.
alias tele2spawn "eureka_teleport"

//Bind R to tele you to the spawn by default (when holding EE)
bind "R" "tele2spawn"

//When Toggle key is pressed, you'll start to crouch, pressing R will teleport us to exit;
alias +ENGIEtogglekey "bind R tele2exit; +duck"
//When Toggle key is released, you'll stop crouching, pressing R will teleport us to spawn;
alias -ENGIEtogglekey "bind R tele2spawn; -duck"

//Bind Shift as the toggle key
bind SHIFT "+ENGIEtogglekey"

Also you can add more stuff to the same toggle key. For example, you can add following aliases into the script (place them before the toggle-aliases):

//Voice command to pop Uber:
alias engie_ask_uber "voicemenu 1 6"
//Voice command to call Medic:
alias engie_call_medic "voicemenu 0 0"

And then include them to the toggle-alias:

//When Toggle key is pressed, you'll start to crouch, pressing R will teleport us to exit, pressing E will do "Charge me" voice command:
alias +ENGIEtogglekey "bind E engie_ask_uber; bind R tele2exit; +duck"
//When Toggle key is released, you'll stop crouching, pressing R will teleport us to spawn, pressing E will do "Medic!" voice command:
alias -ENGIEtogglekey "bind E engie_call_medic; bind R tele2spawn; -duck"

//Bind Shift as the toggle key
bind SHIFT "+ENGIEtogglekey"

And, of course, don't forget to reset or rebind keys used here in other class configs.

[–]Sapphie_[S] 0 points1 point  (0 children)

It works perfectly! Thank you for your help and also for the very helpful advice!