Echo on toggle function

Problems that don't fit in other categories.
Post Reply
User avatar
Shocker
User
Posts: 19
Joined: Sun Dec 20, 2015 7:31 pm
Location: Chile
Player profile: Shocker
Clan: pichula

Echo on toggle function

Post by Shocker » Sun Jul 09, 2017 5:43 am

Hey, I'm looking for a way to put an echo message on a toggle, e.g., I want to bind a single key to toggle antiping and recieve a message "antiping on/off"
I can easily bind 2 keys for that:

Code: Select all

bind key1 "cl_antiping 0; echo antiping off"
bind key2 "cl_antiping 1; echo antiping on"
Idk if there's a way to put both binds together on a key, like:

Code: Select all

bind key "toggle cl_antiping 0 1; toggle echo "antiping on" "antiping off" "
I thought it can be done using cfg files, but I don't know if I can call 2 differents cfg files with exec function bounds on a single key.
Any way to do this? Thanks.
pichula > 123wena

User avatar
deen
Retired Administrator
Posts: 3292
Joined: Mon May 05, 2014 2:30 pm
Player profile: deen

Re: Echo on toggle function

Post by deen » Sun Jul 09, 2017 7:53 am

antipingon.cfg:

Code: Select all

cl_antiping 1
echo antiping on
bind v exec antipingoff.cfg
antipingoff.cfg:

Code: Select all

cl_antiping 0
echo antiping off
bind v exec antipingon.cfg
Then just F1, exec antipingon.cfg

User avatar
Shocker
User
Posts: 19
Joined: Sun Dec 20, 2015 7:31 pm
Location: Chile
Player profile: Shocker
Clan: pichula

Re: Echo on toggle function

Post by Shocker » Sun Jul 09, 2017 6:36 pm

Wow nice, thanks deen :D
pichula > 123wena

Index
User
Posts: 1070
Joined: Mon May 05, 2014 7:30 pm
Player profile: ٭ıƞdex'<3
Mapper profile: ٭ıƞdex'<3
Clan: Eagle

Re: Echo on toggle function

Post by Index » Tue Jul 11, 2017 11:55 am

Yeah thanks for the idea :3 That can be added to extend sooo many useful binds.
Maybe I'll someday write a paragraph about it in the Just bind It Tutorial for sure .__.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest