|
发表于 2009-2-4 11:34:40
|
显示全部楼层
|阅读模式
来自 中国–广西–百色–右江区
本帖最后由 心静如水 于 2009-2-5 20:45 编辑
这是俺参照写的相同队标到同一队伍的代码,但缺点是调队伍后不平衡,
想加入:
1.同队标调到同一队伍后若人数不平衡,则把人多的队伍分过人少的队伍,但OP和同队标的不要动,最好就是调那些高手过去.
谢谢..........
public one_death(){
new victimId = read_data(2)
new pnum,target,sameipid,sameipcnt=0
new players[32],name[32],target_name[32]
get_user_name(victimId,name,31)
if(is_user_connected(victimId)){
get_players(players,pnum)
for( new i = 0 ; i <pnum ; i++){
target = players
if( victimId != target ){
get_user_name(target,target_name,31)
if( contain(name, "[G.XtzBd]") != -1 ){
if( contain(target_name, "[G.XtzBd]") != -1 ){
sameipid = target
sameipcnt = 1
}
}
}
}
if( sameipcnt ){
get_user_name(sameipid,target_name,31)
if( (get_user_team(victimId) != get_user_team(sameipid))&& ( get_user_time(victimId)<get_user_time(sameipid) || get_user_frags(victimId)<get_user_frags(sameipid) ) ){
if( get_user_team(sameipid) == 2 ){
cs_set_user_team(victimId,CS_TEAM_CT,CS_CT_GIGN)
sameipcnt = 0
client_print(0,print_chat,"* 【滴滴】: %s 因为和 %s 相同队标,所以把他们安排在同一队.",name,target_name)
}
if( get_user_team(sameipid) == 1 ){
cs_set_user_team(victimId,CS_TEAM_T,CS_T_TERROR)
sameipcnt = 0
client_print(0,print_chat,"* 【滴滴】: %s 因为和 %s 相同队标,所以把他们安排在同一队.",name,target_name)
}
}
}
}
return PLUGIN_CONTINUE
} |
|