|
发表于 2008-1-8 10:43:30
|
显示全部楼层
来自 中国–广西–百色–田东县
回复: 那位高手帮我写一个插件
#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 == 3) {
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, "1", 1)
}
return PLUGIN_CONTINUE
}
public plugin_init() {
register_plugin("3 Rounds Swap Restart", "1.0", "Codetrinis")
register_event("TeamScore", "score_new", "a")
return PLUGIN_CONTINUE
}
我的服是1.9和1.76C的,测试确切不通....只见重新开局..............希望................. |
|