Chat.say doesn't work correctly (C#)
Hi,

i've just added a button and want a command in.

The command name is: /buy 1

chat.say /buy 1 <- wouldn't work not even with console ingame.
chat.say "/buy 1" <- works via console but not via C#, why not??

It would make me life easier if it would work, it should work. Puts() gives me the right in console but not ingame it looks looks always so:
ej6qeWl.png
but it should be "/buy 1" so it will run the my method. It doesnt realize anything after the space thats why i need to put " before and after it.

In console it works EdZrm56.png

Thats the code: 5gNuqvB.png
and if i let it output in the console with Puts() method, it gives me the right out, but not ingame.

Can someone help me please
chat.say "/buy 1"\
In response to ():
chat.say "/buy 1"\
Ehmm. This can't work, with " you end the string. And to show the " symbol you have to do \". 
So: string test = "test"; will outpout -> test
      string test = "\"test\""; will output -> "test"
Rust console is broken in this regard, if you're using quotes in it you have to add an extra character after the last quote or it will be ignored. General consensus for this issue is to add a trailing backslash like Kaniggel said, I assume so it can be ignored by the actual command instead of acting as a parameter.

so in code it would look like this:

GUIElement.Button.Command = "chat.say \"/buy 1\"\\";​
In response to Gachl ():
Rust console is broken in this regard, if you're using quotes in it you have to add an extra charact...
Thanks for that suggestion, but if i use it nothing happens, no errors nothing. It doesn't to anything :/ when i remove the code all works again (rest of code) just found out that the 2nd backtick causes a break in code :/

edit: I've just added it as Console Command its working now but chat.say with space is buggy af :D