Lua refrash

There is any option to make the Lua refrash system only in server protected with password?


if ( GetConVar( "sv_password" ):GetString() ~= "" ) then
   RunConsoleCommand( "sv_autorefresh", "1" )
else
   RunConsoleCommand( "sv_autorefresh", "0" )
end

You can execute that serverside, run it on startup, or put it in a ConVar changed hook.

Thanks!

[editline]22nd August 2015[/editline]

I added this

to the server side and I get this error :

put sv_password in "

Oops, forgot the quotes; fixed.

The sv_autorefresh does not work in linux servers.
Unknown command “sv_autorefresh”

With the latest update it should work, the linux server I work on DOES have auto refresh for lua files.

Read the wiki about the command you are using:

game.ConsoleCommand

You either need to run


game.ConsoleCommand("sv_autorefresh 0
")


RunConsoleCommand("sv_autorefresh", "0")

Yeah I can confirm too that auto refresh does work on linux.

I am talking about the server commands, does it work when you put

inside the server cfg?
does it disable the auto lua refresh?

Yes

sv_autorefresh is not a valid convar. You have to set it manually through your launch options with


-disableluarefresh

.
Just add that after your servers that aren’t password protected and you’ll be good to go.

http://forum.facepunch.com/showthread.php?t=1228732

rip

When I try to use : sv_autorefresh 0
it says to me there is no command…
Unknown command “sv_autorefresh”

be sure you run it in the console, not as an normal user, might be an Console only thing.

100% in the server console,

then you should stick to the commandline. http://wiki.garrysmod.com/page/Auto_Refresh

Simplest solution as the wiki says:


 -disableluarefresh