Author Topic: Force an addon to execute on all gamemodes  (Read 543 times)

So I'm trying to set up a dedicated server script for someone, and I need an addon to execute when the server starts, regardless of the gamemode loaded.

I'm trying Greek2me's preload script with no success, and I'm assuming -mod is not a valid command line argument when starting the game

I don't want to overwrite config/{client,server}/prefs.cs, the addon list, or the music list files as those can be overwritten, and I'm not 100% sure doing
Code: [Select]
echo 'exec("Add-Ons/Support_RemoteScriptHandler/server.cs");' >> "$BL_DIR/config/server/musicList.cs"every server startup would be the best idea

I mean it might work, but I'd rather have something reliable in case that's overwritten.

Is that my best option?

Put the code in config/main.cs, it gets executed every server start and isn't overwritten by any of the default scripts.

Put the code in config/main.cs, it gets executed every server start and isn't overwritten by any of the default scripts.
that worked, thanks

Put the code in config/main.cs, it gets executed every server start and isn't overwritten by any of the default scripts.

But this is just exactly what Greek2Me's preloader does. The script is installed to config/main.cs and simply just loads every preload.cs in add-ons.

Please use my preloader script. It's designed to allow multiple mods to use the config/main.cs file without overwriting each other.

The server will need to be rebooted once (so the script can be installed to config/main.cs) before add-ons will be preloaded.