gmsv_include - Include files with a new function using C++
37 replies, posted
Due to the highly successful release of gmcl_msg ([url]http://www.facepunch.com/showthread.php?t=928768[/url]), I now present to you gmsv_include!
Source:
[code]
#include "GMLuaModule.h"
GMOD_MODULE(Open, Close);
ILuaInterface *gLua = NULL;
LUA_FUNCTION( gInclude )
{
gLua->CheckType(1, GLua::TYPE_STRING);
bool cl = gLua->IsClient();
if(cl)
{
gLua->Msg("BOOM! POW! THIS ADDON IS FOR SERVERSIDE ONLY! BROOOOOOOM!");
return 0;
}
gLua->FindAndRunScript( gLua->GetString(1), true, true );
return 0;
}
int Open(lua_State *L)
{
gLua = Lua();
gLua->SetGlobal("gInclude", gInclude );
return 0;
}
int Close(lua_State *L)
{
return 0;
}
[/code]
Download:
[url=http://solidfiles.com/d/T9fn][img]http://solidfiles.com/info_imgs/T9fn.jpg[/img][/url]
Enjoy :3
This looks really good could we see some examples of usage
[QUOTE=|King Flawless|;21547421]This looks really good could we see some examples of usage[/QUOTE]
Hello Flawless,
An example for using this module would be:
[lua]
require("include")
gInclude("my_lua/lua_script.lua")
[/lua]
Thanks
Good its just what I was looking for
Amazing, thanks for adding a function we didn't have yet.
Could you also compile a linux version of this? Thanks in advance!
[QUOTE=AzuiSleet;21547686]Could you also compile a linux version of this? Thanks in advance![/QUOTE]
Hello AzuiSleet,
There are currently no Linux binaries for Garry's Mod.
This module will work perfectly under WINE.
Thanks
[editline]03:37PM[/editline]
rated dumb
[QUOTE=Paulo_Barboso;21547702]Hello AzuiSleet,
There are currently no Linux binaries for Garry's Mod.
This module will work perfectly under WINE.
Thanks
[editline]03:37PM[/editline]
rated dumb[/QUOTE]
[img]http://dl.dropbox.com/u/759758/invalidelves.jpg[/img]
:iceburn:
Thanks for the module, should help a ton in the future! Rated useful.
Hello AzuiSleet,
Please send me an example of a linux-compatible Garry's Mod module, and I'll see what I can do :wink:
Thanks,
Paul
Best module ever!
Very useful.
This is the best thing since the Source engine!
Garry please add this in vanilla Gmod 14.
Can you please make a function to run a console command? I've been needing one of those...
I'd love a module that can make cereal come out of my cd drive. Someone made it for GMOD 9 but it doesn't work anymore :(
[editline]08:29PM[/editline]
rated useful!
Ah, I've always wanted to place code from one file into another file at runtime, this will come in as extremely useful to me :)
[editline]10:41PM[/editline]
Holy hell, 568 downloads and only 16 posts? Indignant bastards...
Uhh... A troll? WTF is this?
[lua]function gInclude(fn)
if CLIENT then return MsgN("bullshit") end
include(fn)
end[/lua]
If someone knows what was in first post before that Lua code - please tell us.
Lua code? In first post?
This Lua code does the same as C++ code in first post. No need for C++.
Stop trolling kna_rus, this is awesome.
[QUOTE=kna_rus;21567166]This Lua code does the same as C++ code in first post. No need for C++.[/QUOTE]
Someone's obviously jealous at OP's superior C++ skills!
I will get flamed to death for not following the bandwagon, but I can't find it funny no matter how hard I try. :effort:
I usually respect successful trolls, but this is more pathetic than funny. Bah, I guess it's just me, good show guys. :saddowns:
[QUOTE=_Kilburn;21570413]I will get flamed to death for not following the bandwagon, but I can't find it funny no matter how hard I try. :effort:
I usually respect successful trolls, but this is more pathetic than funny. Bah, I guess it's just me, good show guys. :saddowns:[/QUOTE]
You're more of a buzz kill than buzz killington.
[editline]08:04PM[/editline]
[img]http://hfboards.com/image.php?u=62151&dateline=1205520035[/img]
Ya but 600+ downloads?!
I've been looking for a way to do this for months now, thanks!!
OP is permabanned, GMod will never have any more great modules!
Oh no! what are we going to do?
Why add a function garry already made?
Include() == Ginclude() ?
Obviously not, this is far better than the include we've been using all along, without the OP we'd never have the abilities we have now! :science:
Linux binary, hot off the presses.
[b]Download:[/b] [url]http://dl.dropbox.com/u/4266088/facepunch/gmsv_include_i486.dll[/url]
[img]http://i39.tinypic.com/2lj55zs.png[/img]
Greatest module ever!
Sorry, you need to Log In to post a reply to this thread.