add arms race

This commit is contained in:
shoopea
2024-11-16 18:08:04 +01:00
parent faaea9a17e
commit b57e56f35e
8 changed files with 160 additions and 48 deletions

View File

@@ -24,23 +24,40 @@ router.post('/api/setup-game', is_authenticated, async (req, res) => {
await rcon.execute_command(server_id, `mp_teamname_2 "${team2}"`);
}
if (game == "1") {
if (game == "1") { // Competitive Short
await rcon.execute_command(server_id, `game_type 0`);
await rcon.execute_command(server_id, `game_mode 1`);
execute_cfg_on_server(server_id, './cfg/live_competitive_16.cfg');
} else if (game == "2") {
await rcon.execute_command(server_id, `mp_warmup_pausetimer 1`);
} else if (game == "2") { // Competitive Long
await rcon.execute_command(server_id, `game_type 0`);
await rcon.execute_command(server_id, `game_mode 1`);
execute_cfg_on_server(server_id, './cfg/live_competitive_24.cfg');
} else if (game == "3") {
await rcon.execute_command(server_id, `mp_warmup_pausetimer 1`);
} else if (game == "3") { // Casual Short
await rcon.execute_command(server_id, `game_type 0`);
await rcon.execute_command(server_id, `game_mode 0`);
execute_cfg_on_server(server_id, './cfg/live_casual_16.cfg');
} else if (game == "4") {
await rcon.execute_command(server_id, `mp_warmup_pausetimer 1`);
} else if (game == "4") { // Casual Long
await rcon.execute_command(server_id, `game_type 0`);
await rcon.execute_command(server_id, `game_mode 0`);
execute_cfg_on_server(server_id, './cfg/live_casual_24.cfg');
} else if (game == "5") {
await rcon.execute_command(server_id, `mp_warmup_pausetimer 1`);
} else if (game == "5") { // Wingman
await rcon.execute_command(server_id, `game_type 0`);
await rcon.execute_command(server_id, `game_mode 2`);
execute_cfg_on_server(server_id, './cfg/live_wingman.cfg');
await rcon.execute_command(server_id, `mp_warmup_pausetimer 1`);
} else if (game == "6") { // Arms race
await rcon.execute_command(server_id, `game_type 1`);
await rcon.execute_command(server_id, `game_mode 0`);
execute_cfg_on_server(server_id, './cfg/live_arms_race.cfg');
setTimeout(() => {
rcon.execute_command(server_id, `mp_restartgame 1`);
}, 20000)
}
await rcon.execute_command(server_id, `mp_warmup_pausetimer 1`);
await rcon.execute_command(server_id, `changelevel ${map}`);
// Adding 1 second delay in executing warmup.cfg to make it effective after map has been changed.