So im currently making a module but i need to access ILuaInterface i dont know much of modules and this is currently my first module
#include "main.h"
typedef void(*MsgFn)(const char*, ...);
MsgFn Msg;
//ILuaInterface* pLua = NULL;
GMOD_MODULE_OPEN() {
Msg = (MsgFn)GetProcAddress(GetModuleHandleA("tier0.dll"), "Msg");
client = GrabInterface<CHLClient>("client.dll", "VClient");
Msg("Hello World");
return 0;
}
GMOD_MODULE_CLOSE() {
return 0;
}
i got msg and shiz but i need to access ILuaInterface Anyone know how?
[code]
#define GMOD_MODULE_OPEN() GMOD_DLL_EXPORT int gmod13_open( lua_State* state )
[/code]
Already given to you in disguise.
how do i get the iluainterface from the lua state?
IIRC, in the official gmod headers, there is a macro that allows you to access ILuaBase from any function that has a valid Lua state named "L". I think it's "Lua()".
The real question is, why are you so interested in ILuaInterface instead of ILuaBase? ILuaInterface is the interface that gmod used to give you, before gmod 13. Now, all you get is ILuaBase.
But I'll let you in on a little secret. ILuaInterface still exists. In fact, ILuaBase is now the base class of ILuaInterface. Unfortunately, this also means that you can't use old headers to access it. If you are that desperate for ILuaInterface, you will have to reverse engineer it and write the header yourself. Note that this is a very bad idea. The only thing you can expect to not change in future gmod updates is ILuaBase. Writing your module to use functions from ILuaInterface could result in your module breaking after those updates.
i just found out ILuaBase Had RunString xDD thats all i need
For example
https://github.com/FredyH/MySQLOO/blob/master/GmodLUA/include/GarrysMod/Lua/LuaBase.h
https://github.com/FredyH/MySQLOO/blob/c54ed5a13d4ffa35c7661d3483dc1df2c2f3cb0d/MySQLOO/source/LuaObjectBase.cpp#L90
Sorry, you need to Log In to post a reply to this thread.