I'm using a Multi-Mod server, and ideally, I would like my server to run a mp_restartgame when a player joins the server.
I am using a plugin like this to accomplish this with other mods on my server.
namespace EndWarmup
{
using CounterStrikeSharp.API;
using CounterStrikeSharp.API.Core;
public sealed partial class Plugin : BasePlugin
{
public override string ModuleName => "EndWarmup";
public override string ModuleAuthor => "audio_brutalci";
public override string ModuleDescription => "";
public override string ModuleVersion => "0.0.1";
public override void Load(bool hotReload)
{
RegisterEventHandler<EventPlayerConnectFull>(OnPlayerConnect);
}
private static int PlayersConnected()
{
return Utilities.GetPlayers().Where(player => player.IsValid && !player.IsHLTV && !player.IsBot).Count();
}
public HookResult OnPlayerConnect(EventPlayerConnectFull @event, GameEventInfo info)
{
if (PlayersConnected() == 1)
{
Server.ExecuteCommand("mp_restartgame 1");
Server.ExecuteCommand("mp_warmup_end");
}
return HookResult.Continue;
}
}
}
I would ideally like something like this already integrated into your mod as a toggle (or however you choose to do it), or allowing your plugin to work with the code displayed above.
Hey Nocky,
I'm using a Multi-Mod server, and ideally, I would like my server to run a mp_restartgame when a player joins the server.
I am using a plugin like this to accomplish this with other mods on my server.
I would ideally like something like this already integrated into your mod as a toggle (or however you choose to do it), or allowing your plugin to work with the code displayed above.
Thanks!