What code to use with the "lua_run" entity in order to...
3 replies, posted
What code would I use with the "lua_run" entity on my map if I wanted to have this command entered in the player's console:
cl_detaildist 999999
I was thinking that this would work:
[code]RunConsoleCommand("cl_detaildist", "999999"); end[/code]
but when I link the entity to a logic_auto, and start the map in Garry's Mod, the command does not get executed. I am thinking the code is wrong or something. Does anyone have any experience with the lua_run entity?
If that's the only line you're putting in, why not just use point_clientcommand?
[url]http://developer.valvesoftware.com/wiki/Point_clientcommand[/url]
[QUOTE=Yadda;21357458]If that's the only line you're putting in, why not just use point_clientcommand?
[URL]http://developer.valvesoftware.com/wiki/Point_clientcommand[/URL][/QUOTE]
Because point_clientcommand is disabled in Gmod due to its vulnerability for hackers to use it to control servers' consoles. I've tried using it before.
BUT I have solved my problem and got it working, finally. My original code was just wrong, it should have been:
[code]RunConsoleCommand('cl_detaildist', '999999')[/code]
I removed the "; end" part, and replaced the double-quotes " with single quotes '
Ah, I only tested it on ep2 so I guessed it would work on Garry's Mod.. Sorry aboot that.
Sorry, you need to Log In to post a reply to this thread.