chat_command_balance_teams 1.0.0

This commit is contained in:
Resxt
2023-07-28 12:53:42 +02:00
parent 48bf8b8a0b
commit 7a3e2e2490
2 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#include scripts\chat_commands;
Init()
{
CreateCommand(level.chat_commands["ports"], "balanceteams", "function", ::BalanceTeamsCommand, 3, [], ["bt"]);
}
/* Command section */
BalanceTeamsCommand(args)
{
BalanceTeams();
}
/* Logic section */
BalanceTeams()
{
if (!maps\mp\gametypes\_teams::getteambalance())
{
self thread TellPlayer(["Balancing teams"], 1);
level maps\mp\gametypes\_teams::balanceteams();
}
else
{
self thread TellPlayer(["Teams are already balanced"], 1);
}
}