AMX MOD X
Четверг, 25.04.2024, 18:47:09



Приветствую Вас Гость | RSS
[ Главная ] [ CSDM TeamBalancer - AMX Mod X Форум ] [ Регистрация ] [ Вход ]
[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]

Вниманию участников! Данный форум теперь является архивом и вскором времени здесь нельзя будет создавать новых тем! Просьба всем для общения и создания новых тем перейти на наш новый форум: http://amxmodx.su/

  • Страница 1 из 1
  • 1
Модератор форума: slogic, AlMod  
AMX Mod X Форум » Плагины » Обсуждение сторонних плагинов » CSDM TeamBalancer (Криво стал работать!)
CSDM TeamBalancer
[NegativkO]Дата: Пятница, 10.04.2009, 14:57:57 | Сообщение # 1
Полковник
Группа: Пользователи
Сообщений: 243
Репутация: 3
Статус: Не в сети
Ставил уже давно на свой GunGame этот плагин, работал нормально. А теперь он стал все перекидывать за CT постоянно, даже если Т мало все равно! Помогите исправить...

Code
/*  
*  
*        CSDM Teambalancer V1.0 by DA  
*        Date: 03.04.2008
*  
*     
*        Description:
*                               This plugin balance the teams in CS 1.6 without to end the round. It was made for CSDM (Deathmatch) Servers
*  
*       
*        Installation:
*                                Download the sma file and compile it
*                                Load the compiled csdm_teambalancer.amxx to your plugins folder
*                                Add a line "csdm_teambalancer.amxx" (without quotes) to your plugins.ini
*                                If you want to play a sound to the player who switched by the plugin then copy the massteleporttarget.wav to your /sound/misc/ folder and add this to your amxx.cfg: amx_tsound 1
*                                Change the map or restart the Server
*    
*        
*        SVAR's:
*          amx_tfreq   (Default: 50)    -    All 50 (Default) death the plugin checks the players and switch they
*          amx_tmaxplayers  (Default:  4)    -    Max players on the server that it works
*          amx_tsound   (Default:  0)    -  Plays a sound to the player if he will be changed  
*  
*  
*        Credits:
*          Jim for some code and the idea
*          Geesu for the sound file from wc3ft
*       
*  
*/  

#include <amxmodx>
#include <cstrike>

#define PLUGIN    "CSDM Teambalancer"
#define AUTHOR    "DA"
#define VERSION    "1.0"

#define TeamT      1
#define TeamCT     2

new counter=0;

public plugin_precache()
{
  if    ((get_cvar_num("amx_tsound")) != 1)
   return PLUGIN_CONTINUE;
   
  precache_sound("gungame/smb_star2.wav");
  return PLUGIN_CONTINUE;
}

public on_death()
{
  counter++;
  if    (counter >= (get_cvar_num("amx_tmaxfreq")))
  {
   if    (get_playersnum() >= (get_cvar_num("amx_tmaxplayers")))
   {
    counter = 0;
    check_balance();
   }
  }
}

public check_balance()
{
  new players[32], tnum, ctnum;
  get_players(players, tnum, "ce", "TERRORIST");
  get_players(players, ctnum, "ce", "CT");
  if    ((tnum - ctnum) >= 2) transfer_player(TeamT);
  if    ((ctnum - tnum) >= 2) transfer_player(TeamCT);
}

transfer_player(team)  
{  
  new name[32], players[32], scores[32];
  new player, playercount, bestscore, theone, i;

   
  get_players(players, playercount, "ce", team == TeamT ? "TERRORIST" : "CT");
  for    (i=0; i<playercount; i++)  
  {
   player = players[i];
   scores[i] = get_user_frags(player) - get_user_deaths(player);
  }
   
  bestscore = -9999;
  for    (i=0; i<playercount; i++)  
  {
   if    (scores[i] > bestscore)  
   {
    bestscore = scores[i];
    theone = players[i];
   }
  }
   
  cs_set_user_team(theone, team == TeamT ? CS_TEAM_CT : CS_TEAM_T);
  if    (get_cvar_num("amx_tsound") == 1)  
   client_cmd(theone, "speak gungame/smb_star2");
  set_hudmessage(255, 140, 0, -1.0, 0.40, 2, 0.02, 5.0, 0.01, 0.1, 2);
  show_hudmessage(theone,"You have been transfered to %s", team == TeamT ? "CT" : "Terrorist");
  get_user_name(theone,name,31);
  client_print(0,print_chat,"%s has been transfered to %s.", name, team == TeamT ? "CT" : "Terrorist");
  console_print(0,"%s has been transfered to %s.", name, team == TeamT ? "CT" : "Terrorist");
}

public plugin_init()
{
  register_plugin(PLUGIN, VERSION, AUTHOR);
  register_cvar("amx_tmaxfreq", "6");
  register_cvar("amx_tmaxplayer", "4");
  register_cvar("amx_tsound", "1");
  register_event("DeathMsg", "on_death", "a");
Прикрепления: csdm_teambalanc.sma (3.2 Kb)
 
zDemoNДата: Суббота, 24.10.2009, 04:18:28 | Сообщение # 2
Лейтенант
Группа: Пользователи
Сообщений: 60
Репутация: -1
Статус: Не в сети
Может стоит опробывать версию 1.1 ?
 
NinjaДата: Суббота, 24.10.2009, 14:43:09 | Сообщение # 3
Лейтенант
Группа: Пользователи
Сообщений: 58
Репутация: 0
Статус: Не в сети
http://forums.alliedmods.net/showthread.php?t=69399 CSDM Teambalancer V1.1
 
AMX Mod X Форум » Плагины » Обсуждение сторонних плагинов » CSDM TeamBalancer (Криво стал работать!)
  • Страница 1 из 1
  • 1
Поиск:

AMX Mod X Russian Community © 2006-2024