哪位大哥帮俺完善此代码?谢谢...
本帖最后由 心静如水 于 2009-2-5 20:45 编辑这是俺参照写的相同队标到同一队伍的代码,但缺点是调队伍后不平衡,
想加入:
1.同队标调到同一队伍后若人数不平衡,则把人多的队伍分过人少的队伍,但OP和同队标的不要动,最好就是调那些高手过去.
谢谢..........
public one_death(){
new victimId = read_data(2)
new pnum,target,sameipid,sameipcnt=0
new players,name,target_name
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, "") != -1 ){
if( contain(target_name, "") != -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
} 1# 心静如水
晕了........在论坛上转一天了,没有哪位大哥帮花心思一下吗? 等R版吧,他搞的偶都放心!
点通现在的银子扣的真历害啊! 3# cao869
过年回来了,大家新年好!如果有人帮忙一下更好.............希望此贴别沉下去
页:
[1]