Respawn Balance
Respawn Balance
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?
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?
-
OciXCrom
Извън линия - Администратор
- Мнения: 7206
- Регистриран на: 06 Окт 2016, 19:20
- Местоположение: /resetscore
- Се отблагодари: 117 пъти
- Получена благодарност: 1295 пъти
- Обратна връзка:
Respawn Balance
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:
I believe you can figure out what they do just by their names.
There are the only 2 codes that are executed during team change:
Код за потвърждение: Избери целия код
cs_set_user_team(iPlayer, iLess)
cs_reset_user_model(iPlayer)
Respawn Balance
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.
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.
Respawn Balance
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,
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
Hmm, that's true. I don't know how I missed that. Try it like this: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,
Код за потвърждение: Избери целия код
#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)
}
}
}
Respawn Balance
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
Може ли да се направи които има имун да не го прехвърля пак с квар
НАУЧИ ПРАВИЛАТА, ЗА ДА ЗНАЕШ КАК ПОРЯДЪЧНО ДА ГИ НАРУШАВАШ!!!
-
- Подобни теми
- Отговори
- Преглеждания
- Последно мнение
-
- 0 Отговори
- 1577 Преглеждания
-
Последно мнение от gadinkata
-
- 5 Отговори
- 2494 Преглеждания
-
Последно мнение от HALLO_KITTY
-
- 1 Отговори
- 1057 Преглеждания
-
Последно мнение от m0ney
-
- 7 Отговори
- 3684 Преглеждания
-
Последно мнение от nameless.
-
- 4 Отговори
- 2248 Преглеждания
-
Последно мнение от OciXCrom
-
- 1 Отговори
- 1431 Преглеждания
-
Последно мнение от Midnight1337
-
- 2 Отговори
- 1393 Преглеждания
-
Последно мнение от Infamous2018
Кой е на линия
Потребители разглеждащи този форум: 0 регистрирани и 23 госта