|
发表于 2008-3-29 14:04:01
|
显示全部楼层
来自 中国–北京–北京–海淀区
回复: 更换队伍插件瘫痪服务器
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #define PLUGIN "Test"
- #define AUTHOR "Jim"
- #define VERSION "1.0"
- new g_maxplayers
- new g_round
- new g_pcvar_tcl
- new g_limitteams
- new g_autobalance
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_event("TextMsg", "round_restart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in")
- register_logevent("round_end", 2, "1=Round_End")
- g_pcvar_tcl = register_cvar("teamchange_level", "3")
- g_maxplayers = get_maxplayers()
- }
- public round_restart()
- {
- g_round = 0
- }
- public round_end()
- {
- g_round++
- if(g_round % get_pcvar_num(g_pcvar_tcl))
- {
- g_limitteams = get_cvar_num("mp_limitteams")
- g_autobalance = get_cvar_num("mp_autoteambalance")
- set_cvar_num("mp_limitteams", 0)
- set_cvar_num("mp_autoteambalance", 0)
- change_team()
- }
- }
- public change_team()
- {
- new CsTeams:team
- for(new id = 1; id <= g_maxplayers; id++)
- {
- if(is_user_connected(id))
- {
- team = cs_get_user_team(id)
- if(team == CS_TEAM_T)
- cs_set_user_team(id, CS_TEAM_CT)
- else if(team == CS_TEAM_CT)
- cs_set_user_team(id, CS_TEAM_T)
-
- if(is_user_alive(id))
- user_silentkill(id)
- }
-
- }
- set_cvar_num("mp_limitteams", g_limitteams)
- set_cvar_num("mp_autoteambalance", g_autobalance)
- }
复制代码 顺手写了个,不知道能不能解决你们的问题,测试一下告诉我结果吧,参数是
teamchange_level 3 就是打多少局就换队,另外活人在换队时会处死,但是不会death -1。 |
|