Solved gmod how to run lua console commands

Hexui Undetected CSGO Cheats PUBG Accounts

Helios

Coder
Meme Tier VIP
May 24, 2012
207
1,113
4
Game Name
Garry's Mod
Anticheat
None
Tutorial Link
None
How long you been coding/hacking?
I C++ i'm zero
Coding Language
C++
I've gotten really into doing gmod lua stuff again, because of Dapk1n's post.

I've started on a GUI, but I'm not really sure on the style, so far I've got two. You can see them underneath this line.

Obviously I can customize pretty much everything in both styles, so which one do you like the most? Or should I think of something else? Please leave a response :)
 
Last edited by a moderator:

nevarB

Dank Tier Donator
Jul 28, 2018
4
2,083
1
Not in my system console. In-game console.
Hello,
You should actually take a look at reversing gmod. If you find the tier0 module you can find the exported function "Msg". If you have watched Guidedhacking's calling game functions video you know you can call game functions. Here is a little code snippet you can use though:
Msg:
typedef void(__cdecl* MsgFn)(const char* msg);
void Msg(const char* msg, ...)
{
    if (msg == nullptr)
        return;

    HMODULE MODULEtier0 = GetModuleHandleA("tier0.dll");
    static MsgFn fn = (MsgFn)GetProcAddress(MODULEtier0, "Msg");
    fn(msg);
}
 
  • Like
Reactions: Teuvin and 桜R1

BlackPitchPL

Coder
Full Member
Nobleman
May 24, 2012
166
783
1
I like your in game menu i think it's better than normal menu out of game coz u can select in game what u need and u don't need to alt tab game
 

Helios

Coder
Meme Tier VIP
May 24, 2012
207
1,113
4
I've decided to write a Gmod hack, and everybody will of course be able to use it.

Here's a small feature I added this morning (It's not done yet):
 
Last edited by a moderator:

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,183
19,938
76
Looks really great. Very promising.

As of GUI type, I'd go for the first one. Alot cleaner and more simple. I don't prefer fancy stuff :D
 

桜R1

Full Member
Dec 9, 2018
5
152
0
Hi there. I need some help with: I need to write smth via c++ in game console. Ex: I launched my app and game console runned "echo 1" so I see in console "1".
 

Teuvin

now I am become Death
Dank Tier VIP
Trump Tier Donator
Dec 8, 2016
403
10,388
65
I don't understand what you are saying, you want to simply run console commands on YOUR console? If so you should use system
C++:
int main(){
    system("echo 1"); //yields 1
}
 

桜R1

Full Member
Dec 9, 2018
5
152
0
Hello,
You should actually take a look at reversing gmod. If you find the tier0 module you can find the exported function "Msg". If you have watched Guidedhacking's calling game functions video you know you can call game functions. Here is a little code snippet you can use though:
Msg:
typedef void(__cdecl* MsgFn)(const char* msg);
void Msg(const char* msg, ...)
{
    if (msg == nullptr)
        return;

    HMODULE MODULEtier0 = GetModuleHandleA("tier0.dll");
    static MsgFn fn = (MsgFn)GetProcAddress(MODULEtier0, "Msg");
    fn(msg);
}
Yeah, I know how to call Msg now(I have another code) but can u help me how to call "lua_openscript_cl <name.lua>"?
 

nevarB

Dank Tier Donator
Jul 28, 2018
4
2,083
1
Yeah, I know how to call Msg now(I have another code) but can u help me how to call "lua_openscript_cl <name.lua>"?
I think you have to hook luaL_loadbufferx, not really sure about this and I haven't used it yet, but you can look it up on the internet.
 
  • Like
Reactions: 桜R1

Similar threads

Community Mods