457417918
发表于 2010-1-21 19:01:26
晕什么都看不到
qpwoeiruty
发表于 2010-1-29 20:27:00
这个插件很有用啊,免的长期优势地图人是越玩越少
ICHITAKA SETO
发表于 2010-2-8 22:21:47
什麼來啊?
野猪
发表于 2010-2-17 21:14:18
楼主想要的是实力平衡,就是枪法最厉害的和最烂的经常自动换边平衡,不知道哪个有这个插件、
coolmanlu
发表于 2010-2-22 22:11:20
我也想要。。。。
tides
发表于 2010-2-27 00:45:30
日日日
太阳太阳太阳
wangyang5008
发表于 2010-2-28 14:37:50
16# tides
这插件满地都是
457417918
发表于 2010-3-1 10:49:00
支持云代码
tides
发表于 2010-3-1 12:52:26
#include <amxmodx>
#include <cstrike>
new roundnum = 0
new already//已经换好
new exchange//区分CT和T
new YNteam
new YNnum
public plugin_init(){
register_plugin("队伍平衡", "1", "3344")
register_logevent("event_round_end", 2, "0=World triggered", "1=Round_End")
register_event("TextMsg", "round_restart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in")
register_cvar("sv_randomteams", "15")//多少局执行
register_cvar("teamtype", "2")//1为队伍对换,2为队伍实力平衡
register_cvar("teamdegree", "1")//执行多少次
}
public event_round_end(){
if(YNteam)
return
roundnum++
client_print(0, print_center, "%d",roundnum)
if(roundnum >= get_cvar_num("sv_randomteams")){
set_task(4.8, "event_round_end34", 546548, "", 1)
roundnum = 0
YNnum++
if(YNnum >= get_cvar_num("teamdegree"))
YNteam = true
}
}
public round_restart(){
YNteam = false
roundnum = 0
}
public event_round_end34(){
switch (get_cvar_num("teamtype"))
{
case 1:
{
new num, players
get_players(players,num)
for(new i=0;i<num;i++){
if(!is_user_connected(players)) continue
if(cs_get_user_team(players)==CS_TEAM_CT)
cs_set_user_team(players,CS_TEAM_T)
else if(cs_get_user_team(players)!=CS_TEAM_SPECTATOR)
cs_set_user_team(players,CS_TEAM_CT)
}
}
case 2:
{
new Pnum=get_playersnum()
for (new s=1;s<=Pnum;s++){
new frag,id,worstfrag
for (new i=1;i<=Pnum;i++){//找出分数高的人
if (is_user_connected(i) && !already){//排除已经换队的人
frag = get_user_frags(i)
if (frag>worstfrag){
id=i
worstfrag=frag
}
}
}
if(is_user_connected(id) && cs_get_user_team(id)!=CS_TEAM_SPECTATOR){
already=true//作记号
if(exchange){
cs_set_user_team(id,CS_TEAM_CT)
exchange=false
}
else{
cs_set_user_team(id,CS_TEAM_T)
exchange=true
}
}
}
for (new r=1;r<=Pnum;r++)//清除记号
already=false
}
}
}
tides
发表于 2010-3-1 12:54:09
单机测试过,应该不会卡,大概平衡(按杀人数来平衡)
你可以测试测试