Tab Score Setting

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
By Hazard
Извън линия
Foreigner
Foreigner
Мнения: 3
Регистриран на: 05 Авг 2019, 04:25
Се отблагодари: 1 път

Tab Score Setting

Мнение от By Hazard » 05 Авг 2019, 17:34

For example, at the end of 15 rounds, the CT team will move to the terrorist team and the TERROR team will move to the CT team. When the 16th round starts, they will continue to add scores to their new team. Cs global offensive competition mode logic.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Tab Score Setting

Мнение от OciXCrom » 06 Авг 2019, 15:18

Cvar: teamswitch_rounds = 15

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <cstrike>

new bool:g_bSwitch, g_iRound, g_pRounds

public plugin_init()
{
	register_plugin("Team Switch On X Round", "1.0", "OciXCrom")
	register_logevent("OnFirstRound", 2, "0=World triggered", "1&Restart_Round_")
	register_logevent("OnFirstRound", 2, "0=World triggered", "1=Game_Commencing")
	register_logevent("OnRoundStart", 2, "0=World triggered", "1=Round_Start")
	register_logevent("OnRoundEnd", 2, "1=Round_End")
	g_pRounds = register_cvar("teamswitch_rounds", "15")
}

public OnFirstRound()
{
	g_iRound = 0
	g_bSwitch = false
}

public OnRoundStart()
{
	new iMaxRounds = get_pcvar_num(g_pRounds)

	if(g_iRound++ == iMaxRounds)
	{
		g_bSwitch = true
		client_print(0, print_chat, "* Round #%i has been reached. Teams will be switched at the end of this round.", iMaxRounds)
	}
}

public OnRoundEnd()
{
	if(g_bSwitch)
	{
		g_bSwitch = false

		new iPlayers[32], iPnum
		get_players(iPlayers, iPnum)

		for(new i, iPlayer, CsTeams:iTeam; i < iPnum; i++)
		{
			iPlayer = iPlayers[i]
			iTeam = cs_get_user_team(iPlayer)

			if(iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT)
			{
				cs_set_user_team(iPlayer, iTeam == CS_TEAM_T ? CS_TEAM_CT : CS_TEAM_T)
			}
		}

		client_print(0, print_chat, "* Teams have been switched.")
	}
}

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 14 госта