❓ [Help] GMod game is crashing
Hey guys, I'm working on a hack and its crashing my game. And it's quite frustrating when I do lua_openscript_cl module.lua.
Heres my code.
I put the dll in lua/bin. All help's appreciated, thanks. Also, please forgive me for my ignorance, as I'm quite new to hacking.
Heres my code.
Code:
#define GMMODULE
#include "GarrysMod\Lua\Interface.h"
#include "GarrysMod\Lua\UserData.h"
#include "mathlib/vector.h"
#include <string>
#include <chrono>
#include "basehandle.h"
#include "GarrysMod/Lua/Interface.h"
#include "CMoveData.h"
#include "CUserCmd.h"
#include <Windows.h>
#include "convar.h"
#include <iostream>
#include <fstream>
#include <string>
#include<cstdio>
using namespace GarrysMod::Lua;
CUserCmd* userCmd;
CMoveData* moveData;
ConVar* convar;
ICvar* GModCheck;
std::string stringVar = "Hello world!";
HWND gmod = FindWindow(NULL, TEXT("Garry's Mod"));
int VeriCheckProcess(lua_State* state) {
if (!gmod) {
GModCheck->ConsolePrintf("GMod not found");
}
else if (gmod) {
GModCheck->ConsolePrintf("GMod found!");
}
return 0;
}
int VeriSVCheatsBP(lua_State* state) {
convar->GetName();
if (convar->GetName() == "sv_cheats") {
convar->SetValue("sv_cheats 1");
if (convar->IsRegistered) {
GModCheck->ConsolePrintf("sv_cheats set to one!");
}
}
return 0;
}
GMOD_MODULE_OPEN() {
LUA->PushSpecial(SPECIAL_GLOB);
LUA->PushCFunction(VeriSVCheatsBP);
LUA->SetField(-2, "VeriSVCheatsBP");
LUA->PushCFunction(VeriCheckProcess);
LUA->SetField(-2, "VeriCheckProcess");
LUA->Pop();
return 0;
}
GMOD_MODULE_CLOSE() {
return 0;
}