[QUOTE=ComWalk;22611158] Grabbing the cvar export shouldn't be a huge hassle.[/QUOTE]
Should be as easy as this.
[cpp]...
ICvar* cvar = NULL;
...
int Init( lua_State* L )
{
if( !Sys_LoadInterface( "vstdlib", CVAR_INTERFACE_VERSION, NULL, reinterpret_cast<void**>( &cvar ) ) )
Lua()->Error( "Unable to load ICvar interface." );
}
...[/cpp]
[QUOTE=raBBish;22620095]Should be as easy as this.
[cpp]...
ICvar* cvar = NULL;
...
int Init( lua_State* L )
{
if( !Sys_LoadInterface( "vstdlib", CVAR_INTERFACE_VERSION, NULL, reinterpret_cast<void**>( &cvar ) ) )
Lua()->Error( "Unable to load ICvar interface." );
}
...[/cpp][/QUOTE]
I had a look at Sys_LoadInterface, it seems to cause a memory error when I close the game without unloading the module by disconnecting. Is there an unload function that's supposed to be used with it?
[code]// This is a helper function to load a module, get its factory, and get a specific interface.
// You are expected to free all of these things.
// Returns false and cleans up if any of the steps fail.
bool Sys_LoadInterface(
const char *pModuleName,
const char *pInterfaceVersionName,
CSysModule **pOutModule,
void **pOutInterface );[/code]
Can someone tell me if this still works or another way I can do sv_airaccelerate and sv_accelerate, I really need it.
I'm thinking the flags need to be removed before the engine processes them, because it doesn't add the command back when you reboot the server.
[QUOTE=gotoel;22864632]Can someone tell me if this still works or another way I can do sv_airaccelerate and sv_accelerate, I really need it.[/QUOTE]
The module still works fine.
[lua]for k,v in ipairs( cvar2.GetAll() ) do
if ConVarExists( v ) and GetConVar( v ) and cvar2.IsFlagSet( v, FCVAR_DEVELOPMENTONLY ) then
cvar2.SetFlags( v, cvar2.GetFlags( v ) - FCVAR_DEVELOPMENTONLY )
end
end[/lua]
Removes all of the dev flags from any convars that have them.
[QUOTE=blackops7799;22893066]The module still works fine.
[lua]for k,v in ipairs( cvar2.GetAll() ) do
if ConVarExists( v ) and GetConVar( v ) and cvar2.IsFlagSet( v, FCVAR_DEVELOPMENTONLY ) then
cvar2.SetFlags( v, cvar2.GetFlags( v ) - FCVAR_DEVELOPMENTONLY )
end
end[/lua]
Removes all of the dev flags from any convars that have them.[/QUOTE]
What is that? Where do I put it? And wasn't I supposed to put require("modulename") before it?
EDIT: Worked great with this! Thank you sooo much!
Broken, could you please fix this for the latest version of gmod?
As of this version, on loading there appears to be an access violation reading some apparently arbitrary location. More than that I have no idea on what to say other than "It's broken!"
This will be fixed soon.
[editline]02:20AM[/editline]
Updated. Download in first post.
I removed 3 functions, which I will re-add later.
Just going to throw out there that commands such as sv_airaccel don't require this module to work anymore.
[CODE]
[b]REMOVED[/b]cvar2.ReplicateData(playerid, cvarName, datastr) // Doesn't seem to work with things like mat_fullbright sadly, just left it here for others to try out.
FCVAR_DEVELOPMENTONLY
[/CODE]
Damnit, This command was nice for replicating sv_cheats on clients without actually allowing serverside stuff like ent_fire. mat_fullbright and such work after making sv_cheats to appear to be 1 by the way.
[QUOTE=Python1320;23004525][CODE]
[b]REMOVED[/b]cvar2.ReplicateData(playerid, cvarName, datastr) // Doesn't seem to work with things like mat_fullbright sadly, just left it here for others to try out.
FCVAR_DEVELOPMENTONLY
[/CODE]
Damnit, This command was nice for replicating sv_cheats on clients without actually allowing serverside stuff like ent_fire. mat_fullbright and such work after making sv_cheats to appear to be 1 by the way.[/QUOTE]
I'm bringing it back. Just wanted to get the update out as fast as possible.
Oh and another request. Could you, in future, compile cvar2 without external dll deps (msvc) since WINE servers really don't like that.
Is cvar2.ReplicateData the only way I can let other clients modify fog commands such as fog_override?
If so, when do you think the update will be out?
Soon, on the top of my list once I get some work done.
Any luck with porting this on linux/getting the ReplicateData to work?
It's been almost a month, I would really like to use it :C
Why did you remove ExecuteCommandOnClient(), could it execute any command or something?
[QUOTE=COBRAa;23797149]Why did you remove ExecuteCommandOnClient(), could it execute any command or something?[/QUOTE]
It broke due to the engine update. Updates to the SDK haven't been released and something changed so it couldn't work without reverse engineering the new code.
[QUOTE=Python1320;23730088]Any luck with porting this on linux/getting the ReplicateData to work?[/QUOTE]
Bump; looking to move to Linux based servers and this is a module holding me up, slightly. =p
Sorry to bump such an old thread... But i am wondering if this is being worked on at all.
Is this being worked on anymore?
Haza is on "vacation" from GMod or something, so apparently not :(
Damn.. I really wanted the updated version of this and his clientside weather dll!
Wow, so this can allow admins to access server cvars without rcon or a lua interface. That is sweet.
I am taking a guess that using this now is a [b]VERY[/b] bad idea?
[QUOTE=benjojo;25709810]I am taking a guess that using this now is a [b]VERY[/b] bad idea?[/QUOTE]
Wrong.
[QUOTE=benjojo;25709810]I am taking a guess that using this now is a [b]VERY[/b] bad idea?[/QUOTE]
Why would this developer tool be a bad idea? I don't understand you...
- snip -
Sorry, you need to Log In to post a reply to this thread.