|
楼主 |
发表于 2008-3-24 19:57:06
|
显示全部楼层
来自 中国–河南–南阳
回复: 插件高手请进!关于自动换边插件!
在别处找来一个源代码,但不是很完善,哪位高手能修改一下:
#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 == 50) {
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("50 Rounds Swap Restart", "1.0", "Codetrinis")
register_event("TeamScore", "score_new", "a")
return PLUGIN_CONTINUE
} |
|