Respawn Balance

Одобрените от нас плъгини. Моля, докладвайте ако забележите бъг с някой от плъгините в този раздел.
Аватар
rian18
Извън линия
Foreigner
Foreigner
Мнения: 17
Регистриран на: 19 Юли 2020, 12:11
Се отблагодари: 10 пъти

Respawn Balance

Мнение от rian18 » 19 Юли 2020, 12:13

Playing a ReDM server and using this plugin. There must be an issue wwith team change.
Alive players get changed, and sometimes the alive players die when change is done.
Guess there is sth missing to only switch dead players, or?

Аватар
iv69
Извън линия
Потребител
Потребител
Мнения: 744
Регистриран на: 17 Мар 2018, 15:34
Се отблагодари: 214 пъти
Получена благодарност: 39 пъти

Respawn Balance

Мнение от iv69 » 19 Юли 2020, 12:36

rian18 написа: 19 Юли 2020, 12:13 Playing a ReDM server and using this plugin. There must be an issue wwith team change.
Alive players get changed, and sometimes the alive players die when change is done.
Guess there is sth missing to only switch dead players, or?
Use this: https://goldsrc.ru/resources/147/field?field=5 !!! 8)

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

Respawn Balance

Мнение от OciXCrom » 19 Юли 2020, 14:54

There is no issue in alive players chanigng - that's how the plugin is made on purpose. But there is no code in there that can kill a player.
There are the only 2 codes that are executed during team change:

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

cs_set_user_team(iPlayer, iLess)
cs_reset_user_model(iPlayer)
I believe you can figure out what they do just by their names.

Аватар
DON KHAN
Извън линия
Foreigner
Foreigner
Мнения: 5
Регистриран на: 19 Авг 2019, 20:28
Се отблагодари: 1 път

Respawn Balance

Мнение от DON KHAN » 24 Мар 2021, 10:23

Hello,
I want this plugin works with SentryGun and Dispencer.
If a player have planted Sentrygun or dispencer he should not be transfered to other team.
Dispencer Classname: NiceDispenser
SentryGun Classname: sentry

And this plugin kills player when it transfer someone to other team.

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

Respawn Balance

Мнение от OciXCrom » 24 Мар 2021, 14:16

Attach the plugin.

Аватар
DON KHAN
Извън линия
Foreigner
Foreigner
Мнения: 5
Регистриран на: 19 Авг 2019, 20:28
Се отблагодари: 1 път

Respawn Balance

Мнение от DON KHAN » 24 Мар 2021, 15:01

i will send u plugin in dm

Аватар
Stach
Извън линия
Потребител
Потребител
Мнения: 2
Регистриран на: 13 Май 2021, 11:15
Се отблагодари: 1 път

Respawn Balance

Мнение от Stach » 13 Май 2021, 11:21

Hi,
Thanks a lot for this plugin! I am just wondering if there is maybe a bug in the code (not sure though). Indeed, in line 48, the array iPlayers is loaded with the CT only, and then it seems to be overwritten in line 49 with the TERRORIST only. So then in line 60 you can't find any CT to transfer in the array iPlayers, or maybe I am missing something?
Best,

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

Respawn Balance

Мнение от OciXCrom » 13 Май 2021, 14:37

Stach написа: 13 Май 2021, 11:21 Hi,
Thanks a lot for this plugin! I am just wondering if there is maybe a bug in the code (not sure though). Indeed, in line 48, the array iPlayers is loaded with the CT only, and then it seems to be overwritten in line 49 with the TERRORIST only. So then in line 60 you can't find any CT to transfer in the array iPlayers, or maybe I am missing something?
Best,
Hmm, that's true. I don't know how I missed that. Try it like this:

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

#include <amxmodx>
#include <cromchat>
#include <cstrike>

#if AMXX_VERSION_NUM < 183
	#include <dhudmessage>
#endif

enum _:Cvars
{
	rb_freq,
	rb_gap,
	rb_hud_messages,
	rb_chat_messages
}

new g_eCvars[Cvars]

#define PLUGIN_VERSION "1.3.1"
#define RANDOM_COLOR random_num(50, 255)

new g_iGap
new bool:g_bHudMessages
new bool:g_bChatMessages

public plugin_init()
{
	register_plugin("Respawn Team Balance", PLUGIN_VERSION, "OciXCrom")
	register_cvar("CRXRespawnBalance", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
	g_eCvars[rb_freq] = register_cvar("rb_freq", "3.0")
	g_eCvars[rb_gap] = register_cvar("rb_gap", "2")
	g_eCvars[rb_hud_messages] = register_cvar("rb_hud_messages", "1")
	g_eCvars[rb_chat_messages] = register_cvar("rb_chat_messages", "1")
	CC_SetPrefix("&x04[REBalance]")
}

public plugin_cfg()
{
	g_iGap = get_pcvar_num(g_eCvars[rb_gap])
	g_bHudMessages = bool:get_pcvar_num(g_eCvars[rb_hud_messages])
	g_bChatMessages = bool:get_pcvar_num(g_eCvars[rb_chat_messages])
	set_task(get_pcvar_float(g_eCvars[rb_freq]), "CheckTeams", .flags = "b")
}

public CheckTeams()
{
	new iPlayers[CsTeams][32], iPnum[CsTeams], CsTeams:iLess = CS_TEAM_UNASSIGNED
	get_players(iPlayers[CS_TEAM_CT], iPnum[CS_TEAM_CT], "e", "CT")
	get_players(iPlayers[CS_TEAM_T], iPnum[CS_TEAM_T], "e", "TERRORIST")
	
	if(iPnum[CS_TEAM_CT] == iPnum[CS_TEAM_T])
		return
	else if(iPnum[CS_TEAM_CT] - iPnum[CS_TEAM_T] >= g_iGap)
		iLess = CS_TEAM_T
	else if(iPnum[CS_TEAM_T] - iPnum[CS_TEAM_CT] >= g_iGap)
		iLess = CS_TEAM_CT
		
	if(iLess != CS_TEAM_UNASSIGNED)
	{
		new CsTeams:iMore = iLess == CS_TEAM_CT ? CS_TEAM_T : CS_TEAM_CT
		new iPlayer = iPlayers[iMore][random(iPnum[iMore])]

		cs_set_user_team(iPlayer, iLess)
		cs_reset_user_model(iPlayer)
		
		if(g_bHudMessages)
		{
			set_dhudmessage(RANDOM_COLOR, RANDOM_COLOR, RANDOM_COLOR, -1.0, -1.0, 0, 0.1, 2.0, 0.1, 0.1)
			show_dhudmessage(iPlayer, "You have been transfered to the opposite team.")
		}
		
		if(g_bChatMessages)
		{
			new szName[32]
			get_user_name(iPlayer, szName, charsmax(szName))
			CC_SendMessage(0, "&x03%s &x01has been transfered to the opposite team for &x04Team Balance&x01.", szName)
		}
	}
}

Аватар
Stach
Извън линия
Потребител
Потребител
Мнения: 2
Регистриран на: 13 Май 2021, 11:15
Се отблагодари: 1 път

Respawn Balance

Мнение от Stach » 14 Май 2021, 02:00

Thanks a lot! I am actually working on a plugin based on yours, that would also balance by skills. Happy to share the sources if it is of any interest to you! :)

Аватар
Ant1Lamer
Извън линия
Потребител
Потребител
Мнения: 217
Регистриран на: 08 Окт 2016, 00:03
Се отблагодари: 18 пъти
Получена благодарност: 3 пъти

Respawn Balance

Мнение от Ant1Lamer » 12 Окт 2021, 23:04

Може ли да се направи които има имун да не го прехвърля пак с квар
НАУЧИ ПРАВИЛАТА, ЗА ДА ЗНАЕШ КАК ПОРЯДЪЧНО ДА ГИ НАРУШАВАШ!!!

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

Обратно към “Одобрени плъгини”

Кой е на линия

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