Pivity

Gamemode specific .cfg settings?

Last read Never
#1

Hello.

I'm looking for a way to be able to check for the currently running gamemode of the server once the map/gamemode loads and execute a config file to match the gamemode and inputs settings specific to said gamemode (i.e: loading prop hunt will set the servername to have Prop Hunt in it and adjust all of the prop hunt specific settings which do not save for some odd reason), as I am intending to have a server that runs multiple gamemodes for friends to come and go and change settings around, etc.

I thought I had found a solution, but it turns out that Ulib bans the use of the "exec" and "servercfgfile" commands.

hook.Add( "OnGamemodeLoaded", "refresh_servercfgfile", function()
 gamemodecfg = (GAMEMODE_NAME .. ".cfg")
 RunConsoleCommand("exec", gamemodecfg)
end )

No, I do not know what I'm doing with lua at all, I have just looked over Steam forms a bunch and found someone used this and it apparently worked for them a few years ago. That is obviously not the case anymore, so I am a bit stumped on what to do if I want to achieve a similar result.

Is there no way to achieve what I'm looking for? Thanks in advance.

Users viewing this thread
Nobody