[NegativkO] | Дата: Пятница, 10.04.2009, 14:57:57 | Сообщение # 1 |
Полковник
Группа: Пользователи
Сообщений: 243
Статус: Не в сети
| Ставил уже давно на свой 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");
|
|
| |
zDemoN | Дата: Суббота, 24.10.2009, 04:18:28 | Сообщение # 2 |
Лейтенант
Группа: Пользователи
Сообщений: 60
Статус: Не в сети
| Может стоит опробывать версию 1.1 ?
|
|
| |
Ninja | Дата: Суббота, 24.10.2009, 14:43:09 | Сообщение # 3 |
Лейтенант
Группа: Пользователи
Сообщений: 58
Статус: Не в сети
| http://forums.alliedmods.net/showthread.php?t=69399 CSDM Teambalancer V1.1
|
|
| |