Help with binds
2 posts
• Page 1 of 1
Help with binds
Hi
I am trying to make a name.cfg for myself.
I am adapting simple binds from PS FAQ link (Yvo's script bin).
It looks nice and simple, but it don't work.
(i can choose the names, but i can't change the nick finally)
Console say: unkown comand....
Can someone help me with that?
Orginal file:
// Nick Selector
// This script can hold 6 Nick names. You have to place all your nick names twice.
// Once in the echo name section and once in the setname section
// Binded keys:
// The key to scroll through the names (in echo section)
bind x vstr Nick
//The key with which you set the name
bind y vstr setNick
// Set name section
// Set your nick names here
set Name1 "set name NAME1_HERE"
set Name2 "set name NAME2_HERE"
set Name3 "set name NAME3_HERE"
set Name4 "set name NAME4_HERE
set Name5 "set name NAME5_HERE"
set Name6 "set name NAME6_HERE"
// echo name section
// Set your nick names here again
set echoName1 "echo ^0> ^7Nick^0: NAME1_HERE"
set echoName2 "echo ^0> ^7Nick^0: NAME2_HERE"
set echoName3 "echo ^0> ^7Nick^0: NAME3_HERE"
set echoName4 "echo ^0> ^7Nick^0: NAME4_HERE"
set echoName5 "echo ^0> ^7Nick^0: NAME5_HERE"
set echoName6 "echo ^0> ^7Nick^0: NAME6_HERE"
// Nick changer
set N1 "vstr echoName1; set Nick vstr N2; set setNick vstr Name1"
set N2 "vstr echoName2; set Nick vstr N3; set setNick vstr Name2"
set N3 "vstr echoName3; set Nick vstr N4; set setNick vstr Name3"
set N4 "vstr echoName4; set Nick vstr N5; set setNick vstr Name4"
set N5 "vstr echoName5; set Nick vstr N6; set setNick vstr Name5"
set N6 "vstr echoName6; set Nick vstr N1; set setNick vstr Name6"
set Nick "vstr N1"
set setNick "echo ^0>^7Choose a Nick first!^0<echo> ^7Yvo^0'^7s Name Selector script loaded^0!
I am trying to make a name.cfg for myself.
I am adapting simple binds from PS FAQ link (Yvo's script bin).
It looks nice and simple, but it don't work.
(i can choose the names, but i can't change the nick finally)
Console say: unkown comand....
Can someone help me with that?
Orginal file:
// Nick Selector
// This script can hold 6 Nick names. You have to place all your nick names twice.
// Once in the echo name section and once in the setname section
// Binded keys:
// The key to scroll through the names (in echo section)
bind x vstr Nick
//The key with which you set the name
bind y vstr setNick
// Set name section
// Set your nick names here
set Name1 "set name NAME1_HERE"
set Name2 "set name NAME2_HERE"
set Name3 "set name NAME3_HERE"
set Name4 "set name NAME4_HERE
set Name5 "set name NAME5_HERE"
set Name6 "set name NAME6_HERE"
// echo name section
// Set your nick names here again
set echoName1 "echo ^0> ^7Nick^0: NAME1_HERE"
set echoName2 "echo ^0> ^7Nick^0: NAME2_HERE"
set echoName3 "echo ^0> ^7Nick^0: NAME3_HERE"
set echoName4 "echo ^0> ^7Nick^0: NAME4_HERE"
set echoName5 "echo ^0> ^7Nick^0: NAME5_HERE"
set echoName6 "echo ^0> ^7Nick^0: NAME6_HERE"
// Nick changer
set N1 "vstr echoName1; set Nick vstr N2; set setNick vstr Name1"
set N2 "vstr echoName2; set Nick vstr N3; set setNick vstr Name2"
set N3 "vstr echoName3; set Nick vstr N4; set setNick vstr Name3"
set N4 "vstr echoName4; set Nick vstr N5; set setNick vstr Name4"
set N5 "vstr echoName5; set Nick vstr N6; set setNick vstr Name5"
set N6 "vstr echoName6; set Nick vstr N1; set setNick vstr Name6"
set Nick "vstr N1"
set setNick "echo ^0>^7Choose a Nick first!^0<echo> ^7Yvo^0'^7s Name Selector script loaded^0!
Heres an example
The +vstr command
You can bind a key to do one thing when you press it, and something else when you release it. Here's an example which hides your gun as long as K is held down, and makes it reappear when you let go of K:
set script1 "cg_drawgun 0"
set script2 "cg_drawgun 1"
bind "K" "+vstr script1 script2"
So, hopefully this is pretty obvious. After +vstr, you write the name of 2 scripts that should be run. The first script will be executed on the key press, and the other will be executed on the key release. Here we're using the cg_drawgun cvar which shows the gun if it's set to 1, hides it if it's 0.
You might think that when you press a key, script1 is executed once, and then when you release a key, script2 is executed once. This isn't true. Although the "release" script is always guaranteed to run only once, script1 will keep running again and again while the key is pressed. So, make sure you don't put anything in script1 that can't be run multiple times. For example, putting an echo statement in script1 would be really stupid because then that message might get echo'ed hundreds of times.
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: Majestic-12 [Bot] and 2 guests