• passing a double-quote to a console command in a source engine game
    12 replies, posted
I have a console command in code that needs a double-quote(") passed to it to operate correctly. I can do it in code, or in the console itself, but I have no idea how. right now I have some code set up to replace any <quote> s passed to the command into "s but writing <quote> many times is a big pain in the ass
You could try The following: \" EG echo "Hello, my name is \"Sam\"" Or use '
[QUOTE=geel9;24604003]You could try The following: \" EG echo "Hello, my name is \"Sam\"" Or use '[/QUOTE] escaping doesn't work in console, I've already tried it. and the function I'm using needs a " and using a ' will error it.
bind g "give item_ammo_ar2" Quotes like that?
[QUOTE=gerbile5;24604982]bind g "give item_ammo_ar2" Quotes like that?[/QUOTE] Sort of, but instead of making a string with multiple spaces into one arg I want them to be passed as a arg
You could exec a config file with a line in it, or use an alias or something. Be more specific about the command.
[QUOTE=stinkeee;24605919]You could exec a config file with a line in it, or use an alias or something. Be more specific about the command.[/QUOTE] the command runs a SQLite query for example SQLiteQuery INSERT INTO <quote>main<quote>.<quote>test<quote> (user) VALUES ('MMavipc') The code replaces <quote> with a ", but I would like to avoid that
Well that's beyond anything I've ever scripted, but I think you could do alias main "stuff in quotes here" I don't know anything about SQL though so I'm probably wrong. I thought it was going to be something easy.
[QUOTE=stinkeee;24606229]Well that's beyond anything I've ever scripted, but I think you could do alias main "stuff in quotes here" I don't know anything about SQL though so I'm probably wrong. I thought it was going to be something easy.[/QUOTE] Lets try it with a different command then, lets say you do say " what do you say? nothing. Is there a way to make it so that makes you say " in chat?
Ran a quick test, say """ works for that example. More quotes than that on one line though, I'm not sure.
[QUOTE=stinkeee;24606457]Ran a quick test, say """ works for that example. More quotes than that on one line though, I'm not sure.[/QUOTE] try it with the echo command
Can't seem to do that. I'm lost. I assume it's a sourcemod thing. Did you post in the plugin thread?
[QUOTE=stinkeee;24606742]Can't seem to do that. I'm lost. I assume it's a sourcemod thing. Did you post in the plugin thread?[/QUOTE] It's not a sourcemod thing, it's an entirely new mod.
Sorry, you need to Log In to post a reply to this thread.