Git Product home page Git Product logo

Comments (2)

Soren90 avatar Soren90 commented on August 15, 2024

Hello,

I see that this issue is pretty old, but better late than never, right?

It seems like there is no built in function to do this for now. I think the easiest way for you (without coding) is to wipe the file manage_plugins.sh and build the container from the Dockerfile

If you want to be able to toggle this in the environment variables, I would do something like this in manage_plugins.sh and then set environment variable MODS_ENABLED=0:

export MODS_ENABLED="${MODS_ENABLED:-1}"

if [ "$MODS_ENABLED" = "1" ]; then
	echo "Installing plugins..."

	mkdir -p "$CSGO_DIR/csgo"
	IFS=' ' read -ra PLUGIN_URLS <<< "$(echo "$INSTALL_PLUGINS" | tr "\n" " ")"
	for URL in "${PLUGIN_URLS[@]}"; do
	  install_plugin "$URL"
	done

	echo "Finished installing plugins."

	# Add steam ids to sourcemod admin file
	mkdir -p "$CSGO_DIR/csgo/addons/sourcemod/configs"
	IFS=',' read -ra STEAMIDS <<< "$SOURCEMOD_ADMINS"
	for id in "${STEAMIDS[@]}"; do
	    echo "\"$id\" \"99:z\"" >> "$CSGO_DIR/csgo/addons/sourcemod/configs/admins_simple.ini"
	done

	PLUGINS_ENABLED_DIR="$CSGO_DIR/csgo/addons/sourcemod/plugins"
	PLUGINS_DISABLED_DIR="$CSGO_DIR/csgo/addons/sourcemod/plugins/disabled"
	RETAKES_PLUGINS="retakes.smx retakes-instadefuse.smx retakes_autoplant.smx retakes-hud.smx retakes_standardallocator.smx"
	PUGSETUP_PLUGINS="pugsetup.smx pugsetup_teamnames.smx pugsetup_damageprint.smx"

	# Disable Retakes by default so that we have a working and predictable state without plugins conflict
	if [[ -f "$PLUGINS_ENABLED_DIR"/retakes.smx ]]; then
	  mv "$PLUGINS_ENABLED_DIR"/retakes*.smx "$PLUGINS_DISABLED_DIR"/
	fi

	if [ "$RETAKES" = "1" ]; then
	  if [[ -f "$PLUGINS_ENABLED_DIR"/pugsetup.smx ]]; then
	    (cd "$PLUGINS_ENABLED_DIR" && mv pugsetup*.smx "$PLUGINS_DISABLED_DIR")
	    echo "Disabled PugSetup plugins"
	  fi
	  # shellcheck disable=SC2086
	  (cd "$PLUGINS_DISABLED_DIR" && mv $RETAKES_PLUGINS "$PLUGINS_ENABLED_DIR")
	  echo "Enabled Retakes plugins"
	else
	  if [[ -f "$PLUGINS_DISABLED_DIR"/pugsetup.smx ]]; then
	    # shellcheck disable=SC2086
	    (cd "$PLUGINS_DISABLED_DIR" && mv $PUGSETUP_PLUGINS "$PLUGINS_ENABLED_DIR")
	    echo "Enabled PugSetup plugins"
	  fi
	fi
fi

Please note that I haven't tested this code. But that is how I would start :)

from csgo.

Soren90 avatar Soren90 commented on August 15, 2024

I just noticed that I created a pull request long ago to fix exactly this. But it never got implemented. This might be something you could use?

dd82b1c

from csgo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.