|
楼主 |
发表于 2008-12-16 03:50:36
|
显示全部楼层
来自 中国–江西–萍乡
回复: 跪求<每局自动换队伍换边>的插件
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
new a_score = 0
new b_score = 0
public restart(time[]) {
set_cvar_string("sv_restart", time)
return PLUGIN_CONTINUE
}
public score_new() {
new team[32]
read_data(1, team, 31)
if(team[0] == 'C') {
a_score = read_data(2)
} else if(team[0] == 'T') {
b_score = read_data(2)
}
new totalScore = a_score + b_score
if(totalScore == 1) {
new playersCT[32]
new playersT[32]
new nbrCT, nbrT
get_players(playersCT,nbrCT,"e","CT")
get_players(playersT,nbrT,"e","TERRORIST")
for(new i = 0; i < nbrCT; i++) {
cs_set_user_team(playersCT, CS_TEAM_T)
}
for(new i = 0; i < nbrT; i++) {
cs_set_user_team(playersT, CS_TEAM_CT)
}
set_task(5.0, "restart", 0, "0", 1)
}
return PLUGIN_CONTINUE
}
public plugin_init() {
register_plugin("50 Rounds Swap Restart", "1.0", "Codetrinis")
register_event("TeamScore", "score_new", "a")
return PLUGIN_CONTINUE
} 找到这个代码,自己修改了一下没有用,希望高人帮忙,修改一下~~~
这个只有T赢才换,CT赢了不换,而且只能换能换两次. |
|