[url=http://www.garrysmod.org/downloads/?a=view&id=63151][img]http://www.garrysmod.org/img/?t=dll&id=63151[/img][/url]
Source included.
Usage: command.ServerCommand("command arg arg arg\n")
Credits:
Making it - Deco (Da Man) (me)
Handy functions - Jinto
What?
This is only the unblocked game.ConsoleCommand one.
Not the unblocked Player:ConCommand one.
Fucking WIN!
I don't get this. Can you explain what it does?
[QUOTE=Unib5;13855874]I don't get this. Can you explain what it does?[/QUOTE]
Let's your lua script's execute whatever command you'd like on the server console without restrictions.
Which is hella useful.
[QUOTE=kp3;13855909]Let's your lua script's execute whatever command you'd like on the server console without restrictions.[/QUOTE]
Oh goodie :3
Useful for sv_cheats 1 mess arounds...
[QUOTE=iRzilla;13803475]Ah so clients are safe good :P
Edit: Ooo 200th post :P[/QUOTE]
You really thought this would be used with clients and stuff?..
Anyways good job, I will be using this.
How exactly do I use this to get around the
"ConCommand blocked!" ?
[lua]
require"command"
command.ServerCommand("sv_cheats 1\n")
[/lua]
Surprisingly, command.ServerCommands executes commands on your client when installed on the client.
You mean:
require("command")
?
[quote=Lua Manual, Chapter 2, Unit 5, Section 8 - Function Calls]
...
A call of the form f{fields} is syntactic sugar for f({fields}); that is, the argument list is a single new table. A call of the form f'string' (or f"string" or f[[string]]) is syntactic sugar for f('string'); that is, the argument list is a single literal string.
...
[/quote]
Oh wow, did not know that. I thought lua would be far stricter.
Good to know, thanks.
I'm surprised at how many people haven't read the Lua Manual.
I haven't, but I did know about that... I just prefer normal syntax containing the (). It seems to keep my code neater...
[QUOTE=Levybreak;14041225]I haven't, but I did know about that... I just prefer normal syntax containing the (). It seems to keep my code neater...[/QUOTE]
Entirely opinion. There has been forever the argument on the best way to write languages (both languages such as English and programming languages), but in the end it almost always comes down to opinion, which can never be resolved perfectly.
Can you use this to get around something like
ConCommand blocked! (gmod_tool gravtogglecontroller)
[QUOTE=Sodisna;14110435]Can you use this to get around something like
ConCommand blocked! (gmod_tool gravtogglecontroller)[/QUOTE]
Try
RunConsoleCommand( "gmod_tool", "gravtogglecontroller" )
Edit: Ah, Thanks garry.
Edit: Says unknown command.
Tried with lua run and still says it's blocked.
lua_run RunConsoleCommand( "gmod_tool", "gravtogglecontroller" )
> RunConsoleCommand( "gmod_tool", "gravtogglecontroller" )...
ConCommand blocked! (gmod_toolmode gravtogglecontroller)
] RunConsoleCommand( "gmod_tool", "gravtogglecontroller" )
Unknown command: RunConsoleCommand
Any concommand that has "toggle" in the name is being blocked.
[QUOTE=Sodisna;14110460]Edit: Ah, Thanks garry.
Edit: Says unknown command.
Tried with lua run and still says it's blocked.
lua_run RunConsoleCommand( "gmod_tool", "gravtogglecontroller" )
> RunConsoleCommand( "gmod_tool", "gravtogglecontroller" )...
ConCommand blocked! (gmod_toolmode gravtogglecontroller)
] RunConsoleCommand( "gmod_tool", "gravtogglecontroller" )
Unknown command: RunConsoleCommand[/QUOTE]
lua_run_cl?
[QUOTE=Deco Da Man;14024432][/QUOTE]
So why can't I just use f if f is a function with no args? Inconsistancies are annoying.
Wasn't blocked before update 57.
This just recently stopped working for me.
Getting this error on my server.
[code]A dynamic link library (DLL) initialization routine failed.[/code]
[QUOTE=Lexi;14117763]So why can't I just use f if f is a function with no args? Inconsistancies are annoying.[/QUOTE]
Because there's no way to differentiate between the function object and the result of the function when called.
[lua]local function f() return "Hello World!" end
print(type(f))
-- Outputs 'function'
print(type(f()))
-- Outputs 'string'[/lua]
I like to think of it as saving you a pair of brackets with single argument functions.
I don't suppose someone could create a linux version?.. Sorry for the bump, but it's kind of needed.
[QUOTE=phoenixftb;27968926]I don't suppose someone could create a linux version?.. Sorry for the bump, but it's kind of needed.[/QUOTE]
just take teh source code and change where it says "os = "Windows";" to "os = "Linux";"
I'm too lazy to try to write a linux version so here's a quick and dirty solution for everyone for the CURRENT version of gmod (only):
[code]
me: Find hex pattern 75 1B 89 74 24 04 8D 83 10 A4 D2 FF 89 04 from server.so and replace the first byte with EB so it becomes EB 1B 89 74 24 04 8D 83 10 A4 D2 FF 89 04
me: We can patch it on windows too but this is for the linux server
phoenixftb: im on win7, but servers linux
me: Download your server.so
me: Get this http://mh-nexus.de/en/downloads.php?product=HxD
phoenixftb: got
me:
1. Open server.so with HxD.
2. Ctrl+f
3. Choose Byte pattern. Search for 75 1B 89 74 24 04 8D 83 10 A4 D2 FF 89 04 It should find that pattern and highlight it.
4. Choose the first byte (75) and write EB.
5. Save and upload.
[/code]
Yup, worked for me on Linux.
[url]http://dl.dropbox.com/u/7745323/gm_command_f1.rar[/url]
Includes a Linux build.
Sorry, you need to Log In to post a reply to this thread.