|
发表于 2009-11-18 02:23:00
|
显示全部楼层
来自 中国–四川–内江
本帖最后由 sakulekingz 于 2009-11-18 02:44 编辑
自己写的。。。还没测试。。楼主需要的话可以先测试再使用
cvar:mp_autoscore <1-N> 为双方比分达到多少后自动更换队伍 - #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
-
- #define PLUGIN "Auto Swap Teams"
- #define VERSION "1.0"
- #define AUTHOR "dt.Sakulekingz (KIN)"
- #define LOADING "^n^t%s v%s, Copyright (C) 2009 by %s^n"
-
- new score[2];
- new mp_autoscore;
-
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR);
- server_print(LOADING,PLUGIN,VERSION,AUTHOR);
- register_event("TeamScore", "team_score", "a");
- register_logevent("show_the_score", 2, "0=World triggered", "1=Round_Draw", "1=Round_End");
- mp_autoscore = register_cvar("mp_autoscore", "15");
- }
-
- public team_score()
- {
- new team[32];
- read_data(1,team,31);
- if (equal(team,"CT"))
- {
- score[0] = read_data(2);
- }
- else if (equal(team,"TERRORIST"))
- {
- score[1] = read_data(2);
- }
- }
-
- public show_the_score()
- {
- if(get_pcvar_num(mp_autoscore) == score[0]+score[1])
- {
- static player;
- for(player = 1; player <= get_maxplayers(); player++)
- {
- switch(get_user_team(player))
- {
- case 1: cs_set_user_team(player, 2);
- case 2: cs_set_user_team(player, 1);
- }
- }
- color_print(0, "第%d局过去了服务器自动交换双方队伍!",get_pcvar_num(mp_autoscore));
- }
- }
-
- color_print(const id, const szText[], any:...)
- {
- new szMsg[192], iLen = formatex(szMsg, 191, "^x04[Auto Swap Teams] ^x01");
- vformat(szMsg[iLen], 191 - iLen, szText, 3);
-
- message_begin(id ? MSG_ONE : MSG_BROADCAST, get_user_msgid("SayText"), _, id);
- write_byte(1);
- write_string(szMsg);
- message_end();
- }
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|