Thought I would use this thread instead of creating a new one.
I'm trying to bind a key so it will execute multiple commands, just like:
Example:
Code:
bind m "+scores;say A;"
This can be done easily if you were to type that command manually into console.
However I need the server to bind the key instead of every user having to bind the key themselves.
The normal way of doing this would be using something like "execClientCommand" or "setClientCvar" but none work in my situation.
With "execClientCommand", you can't use double quotes in a string. Example:
Code:
self execClientCommand("bind m "+scores;say test;"");
//Won't work.
I also tried using escape sequence's;
Code:
self execClientCommand("bind m \"+scores;say test;\"");
But for some strange reason it will use single quotations instead of double:
Code:
//Output:
bind m '+scores;say test;'
//Won't work.
Which won't work.
With "setClientCvar", I am able to do this;
Code:
self setClientCvar("scorebind", "+scores;say A;");
self execClientCommand("bind m vstr scorebind");
However, using vstr will allow +scores to open normally, but it will not close normally (-scores) upon releasing the key. If I don't use vstr and manually type "bind m "+scores;say A;"" into console, it does open and close +scores correctly which is what I need.
So, any ideas on how can I do it?