[QUOTE=Teddi Orange;17425240]You need to require it in your script.[/QUOTE]
[QUOTE=bradmcco;18014102]How do you do that?[/QUOTE]
require"modulename"
Where do i put the code
[editline]05:20AM[/editline]
Also can u set sv_airaccelerate
-snip, didn't know this at time, now I do-
[QUOTE=Helix Alioth;18210954]require("modulename")[/QUOTE]
There isn't anything wrong with Python1320's syntax. Either way works.
Ok guys, I don't know why, but this just isn't working for my server. Here's my code (very simple):
[lua]
require("cvar2")
cvar2.SetFlags("sv_airaccelerate", cvar2.GetFlags("sv_airaccelerate") - FCVAR_DEVELOPMENTONLY)
[/lua]
And I have that code saved in its own LUA file in lua/autorun/server and it's not working. At some points I can see the convar (I used this for sv_airaccelerate which is defaulty 10), but I can't change it to something else. Every other time it will just say unknown command...
Help?
I don't see how asking for help is dumb, but hey, it's facepunch.
sadly if you dont give us any more information you are going to keep getting rated dumb
did you download GM_cvar2?
have you extracted the zip file?
Where have you place GM_cvar2?
[QUOTE=*Fish*;18348596]sadly if you dont give us any more information you are going to keep getting rated dumb
did you download GM_cvar2?
have you extracted the zip file?
Where have you place GM_cvar2?[/QUOTE]
I'm not a total idiot. I have a commercially hosted server and they have it on their mods list (because they're bitchy and won't let you upload dlls), and YES I have checked and it IS installed properly. For those of you that just HAVE to have the directory it's in, it's located in "lua/includes/modules" and for added obviousness is named "gm_cvar2.dll"
That good enough for ya?
I can't seem to get cvar2.ReplicateData() to work properly (it could be that I'm not using it right)
Here's what I'm trying to do:
[code]function sendPlayerCVARFlags(ply)
require("cvar2")
cvar2.ReplicateData(player.GetByID(ply), mat_yuv, 1)
ply:PrintMessage(HUD_PRINTCENTER,"Test")
end
hook.Add( "PlayerSpawn", "playerSpawn", sendPlayerCVARFlags )[/code]
Error:
[code]
ERROR: Hook 'playerSpawn' Failed: autorun/server/cvar_unlock.lua:26: attempt to call field 'ReplicateData' (a nil value)
Removing Hook 'playerSpawn'[/code]
mat_yuv should be in quotes and player.GetByID(ply) should just be ply I think. That's all I see that's wrong.
Wee, finally got it to work. Downloaded the wrong module at the middle of the first page and it had this bind removed.
[QUOTE=aualin;19606370][lua]cvar2.SetFlags("sv_cheats", cvar2.GetFlags("sv_cheats") - FCVAR_CHEAT)[/lua]
Win?[/QUOTE]
If you're using that on the client, No.
Thanks, can't wait to use this :)
Sorry for the bump but cvar2.GetAll seems to return concommands too, can you please add cvar2.Exists(name) or cvar2.IsCvar(name) ?
[b][url=http://wiki.garrysmod.com/?title=G.ConVarExists]G.ConVarExists [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
stupid wiki search...
Any chance of a linux version?
Linux version please.
Is this DLL binary compatible with a linux server?
if it is then someone please confirm it.
im running a linux server and this DLL is required to run the gamemode im using.
No linux binaries so far.
[QUOTE=Python1320;22577932]No linux binaries so far.[/QUOTE]
If someone reads this post and knows how to make modules, is anyone interested in making this module compatible with linux binaries?
If you are then pm me on forums.
[editline]12:44PM[/editline]
[QUOTE=CapsAdmin;22062102]Linux version please.[/QUOTE]
Yes please!
Okay I'll do this tomoz.
This module seems to crash on load in my gamemode, didnt before the update. but then it went like... shorter between every crash, now i nailed out that it was cvar2 that crashed server on startup...
This module alters around 200 cvars on load on my server and not a single startcrash has been detected. It must be something you're doing.
And thanks haza55!
Mine alters about 300 cvars, it worked just fine untill a few hours ago when it started crashing the server
Sigh Linux is going to be a bitch.
[QUOTE=haza55;22601172]Sigh Linux is going to be a bitch.[/QUOTE]
Taking a look at the least portable code in gm_cvar2, you can eliminate the sigscan by switching to how the new version of gatekeeper deals with getting clients. The way I scanned for them before (which is the way it still did it when you wrote this) was really messy, and it's a lot better now. Grabbing the cvar export shouldn't be a huge hassle.
Copy the gatekeeper code for getting CBaseServer, use that instead of directly accessing the client list, and then the worst of it will be grabbing the export (which shouldn't be too bad).
Sorry, you need to Log In to post a reply to this thread.