|
发表于 2012-12-27 23:12:42
|
显示全部楼层
来自 中国–山东
挖出源码无罪- #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();
- }
复制代码 |
|