Author Topic: Binds won't work properly!  (Read 4534 times)

Offline deXterous | KaB00M!

  • Gold Member
  • *
  • Posts: 328
    • View Profile
    • Awards
Binds won't work properly!
« on: August 11, 2011, 10:31:17 AM »
Hey sexy guys!

The problem I've encountered is: Whenever I have to make a bind, let's say: bind ''n'' ''say Hello!'' it says something like bind <key> [command], eventhough I've done it correctly and without problems.. The weird thing is that if I ask a Steam-friend (Thanks Mart and Johan :*) to write it/copy it into the chat for me, it works. I just have to copy the bind my friend wrote, paste it into my console, and it works perfectly. But when I do it, it fucks up. Everytime - I've binded my keys before without problems, so I don't know what caused this fatal error.

Again, thank you good looking men :)
« Last Edit: August 13, 2011, 12:53:48 PM by KaB00M? »

Re: Binds won't work properly!
« Reply #1 on: August 11, 2011, 11:06:13 AM »
Go to;
C:\Program Files\Steam\steamapps\<name>\garrysmod\garrysmod\cfg\

Open the config.cfg
Edit the binds to your liking, do not change the default ones without backing it up,
If that doesn't work try changing all buttons to default.

Offline Dordan

  • Gold Member
  • *
  • Posts: 227
  • Awards [OCRP Award] Social Player [OCRP Award] Comrades
    • View Profile
    • Awards
Re: Binds won't work properly!
« Reply #2 on: August 12, 2011, 03:17:05 PM »
its not
bind ''n'' ''/say Hello!''
its
bind n "say Hello!"

Re: Binds won't work properly!
« Reply #3 on: August 12, 2011, 03:27:37 PM »
its not
bind ''n'' ''/say Hello!''
its
bind n "say Hello!"
Doesn't matter.
<command> <string> <string2>

Offline AcornMan

  • Gold Member
  • *
  • Posts: 311
  • Awards [OCRP Award] Secret Phrase [OCRP Award] You Own The Mall [OCRP Award] Comrades
    • View Profile
    • Awards
Re: Binds won't work properly!
« Reply #4 on: August 12, 2011, 03:34:16 PM »
its not
bind ''n'' ''/say Hello!''
its
bind n "say Hello!"
Pretty sure it's bind n say "Hello!" without the "say" in ""
"Groovy", "This, is my Boom stick".
"RoflWaffle: Servers are going to be down for at least 12 hours as I locked myself out of the box again"."RoflWaffle: :c I need to stop doing that".Justin Newton AKA Jay killed RTLK using "weapon_copgun_ocrp "I've now killed all the admins and dev's at least once."- Justin Newton AKA Jay".
For funny billboards: http://majormike.us/?p=128

Re: Binds won't work properly!
« Reply #5 on: August 12, 2011, 03:35:57 PM »
its not
bind ''n'' ''/say Hello!''
its
bind n "say Hello!"
Pretty sure it's bind n say "Hello!" without the "say" in ""
No that would fail, since "Hello!" is not a 'default' registered command.

Exclusive1

  • Guest
Re: Binds won't work properly!
« Reply #6 on: August 13, 2011, 10:33:07 AM »
Either way it should work, like its been suggested change the binds in the cfg file, and that should work.

Offline Nicknero

  • Hatsune Miku
  • Gold Member
  • *
  • Posts: 5,032
  • Awards [OCRP Award] Millionaire [OCRP Award] Evo City Marathon [OCRP Award] Social Player [GMR2 Award] 100 MPH
    • View Profile
    • Awards
Re: Binds won't work properly!
« Reply #7 on: August 13, 2011, 12:49:48 PM »
its not
bind ''n'' ''/say Hello!''
its
bind n "say Hello!"
Doesn't matter.
<command> <string> <string2>

Yes it does matter.

Lets take the command step by step to make you understand what I mean.
The correct console command to bind keys is: <command> <string> <string2>
<command> will be replaced by: bind
<string> will be replaced by whatever key you want: n
<string2> will be replaced with the console command you wish to run by pressing the button: "........"

All that "" does is making everything between it as 1 command. If you leave them away, it would take "say" and "Hello!" as a seperate command as a spacebar breaks it apart, which results in an invalid console command.
The command you use in console to chat is: say Hello! Put it as one string by adding "" ->  "say Hello!"
Now all you have to do is binding that string to a button using the command "bind <button> <string>"
So the correct way of binding everything is this:
Code: [Select]
bind n "say Hello!"
Say you don't want to bind anything, but you just want to use the say command in console to say something. In this case, the correct format is: <command> <string>
The command in this case is "say"
Now EVERYTHING you want to say (which will be <string>) has to be put in "" to make it 1 string. Results in the correct command:
Code: [Select]
say "Hello, this is an example of how to use these characters to combine this load of text in just one string."
Now you have that working. Say if you want to say multiple lines, or do multiple things with only one bind, you can use ; within a string to separate it as well. Here is a good example:
Important note: Don't use a space between the string and ; or else it would take the space within the string, hence not work.[/color]
Code: [Select]
bind n "say Hello!; say My name is Nick.; say And my special talent is coding."
« Last Edit: August 13, 2011, 12:58:40 PM by Nicknero1405 »
Check out my Youtube channel with all kinds of cool videos including LP's which I'm currently working at. Don't forget to give feedback as well. ;)


Re: Binds won't work properly!
« Reply #8 on: August 13, 2011, 12:58:24 PM »
its not
bind ''n'' ''/say Hello!''
its
bind n "say Hello!"
Doesn't matter.
<command> <string> <string2>

Yes it does matter. All that "" does is making everything between it as 1 string. If you leave them away, it would take "say" and "Hello!" as a seperate string as a spacebar breaks strings apart.
The command you use in console to chat is: say Hello!      put it as one string by adding "" ->  "say Hello!"
Now all you have to do is binding that string to a button using the command "bind <button> <string>"
So the correct way of binding everything is this:
Code: [Select]
bind n "say Hello!"
Now you have that working. Say if you want to say multiple lines, or do multiple things with only one bind, you can use ; within a string to separate it as well. Here is a good example:
Important note: Don't use a space between the string and ; or else it would take the space within the string, hence not work.[/color]
Code: [Select]
bind n "say Hello!; say My name is Nick.; say And my special talent is coding."
I love how you tried to be a smart ass on me.
I mean the <key> can also be used as a string.
It doesn't matter if you make <key> as a string or not.
It does not require to have quotes because it is not two or more words, it is only one: n

Funny thing is,
Code: [Select]
bind n "say Hello!; say My name is Nick.; say And my special talent is coding."That will not work because of two reasons. It should be.
Code: [Select]
bind n "say Hello!";"say My name is Nick.";"say And my special talent is not LUA coding."And source will not allow the same commands to be seperated, due to fair reasons and spam.

Offline Nicknero

  • Hatsune Miku
  • Gold Member
  • *
  • Posts: 5,032
  • Awards [OCRP Award] Millionaire [OCRP Award] Evo City Marathon [OCRP Award] Social Player [GMR2 Award] 100 MPH
    • View Profile
    • Awards
Re: Binds won't work properly!
« Reply #9 on: August 13, 2011, 01:04:13 PM »
I love how you tried to be a smart ass on me.
I mean the <key> can also be used as a string.
It doesn't matter if you make <key> as a string or not.
It does not require to have quotes because it is not two or more words, it is only one: n

Funny thing is,
Code: [Select]
bind n "say Hello!; say My name is Nick.; say And my special talent is coding."That will not work because of two reasons. It should be.
Code: [Select]
bind n "say Hello!";"say My name is Nick.";"say And my special talent is not LUA coding."And source will not allow the same commands to be seperated, due to fair reasons and spam.

Why do you think I'm trying to be a smart ass? Someone requires help here, and I'm more liking to help him understanding console commands which you can see as little pieces of coding.

Why don't you just take my example of using ; and try it out before you come up with stuff that won't work.
Code: [Select]
[code]bind n "say Hello!";"say My name is Nick.";"say And my special talent is not LUA coding."[/code]
This will run the following commands:
bind n "say Hello!"
say My name is Nick.
say And my special talent is not LUA coding.

Result: You just binded "say Hello!" to a key, and you say the other two things right away without binding it. It fails. Put everything within one single quote ("") as I did and it will work. Don't believe me? Try it.
Check out my Youtube channel with all kinds of cool videos including LP's which I'm currently working at. Don't forget to give feedback as well. ;)


Re: Binds won't work properly!
« Reply #10 on: August 13, 2011, 01:10:40 PM »
I love how you tried to be a smart ass on me.
I mean the <key> can also be used as a string.
It doesn't matter if you make <key> as a string or not.
It does not require to have quotes because it is not two or more words, it is only one: n

Funny thing is,
Code: [Select]
bind n "say Hello!; say My name is Nick.; say And my special talent is coding."That will not work because of two reasons. It should be.
Code: [Select]
bind n "say Hello!";"say My name is Nick.";"say And my special talent is not LUA coding."And source will not allow the same commands to be seperated, due to fair reasons and spam.

Why do you think I'm trying to be a smart ass? Someone requires help here, and I'm more liking to help him understanding console commands which you can see as little pieces of coding.

Try it.
I said that the first one was a string that didn't require quotes, you start saying it does matter. That's why you tried to be smart on me.
Code: [Select]
bind "n"
or
bind n
That doesn't matter.

Lazy, will do later
Doubt it though, since strings should almost always be quoted, string;string;string is what it is.
And source will block it, to stop spam.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal