|
发表于 2009-8-30 20:20:31
|
显示全部楼层
来自 中国–广东–广州
本帖最后由 kk阿朗 于 2009-8-30 20:23 编辑
支持一下!
我自己根据http://forums.alliedmods.net/showthread.php?p=813033这个贴子的原理,搞了一个!
用的文件都是他的!我只是把显示的内容改成比分!大家研究研究!如果有什么BUG,请回贴!- #include <amxmodx>
- #include <amxmisc>
-
- #define PLUGIN_NAME "Team Score"
- #define PLUGIN_VERSION "1.0"
- #define PLUGIN_AUTHOR "K.K.Lv"
- new pCvar_TaskTime
- new iTeamScore[2]
- public plugin_init()
- {
- register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
-
- pCvar_TaskTime = register_cvar("amx_task_time", "10")
- register_event("HLTV", "NewRound", "a", "1=0", "2=0")
- register_event("TeamScore", "Event_TeamScore", "a" )
- register_clcmd("say /score", "cmdScore")
- }
- public plugin_precache()
- {
- precache_generic("gfx/career/icon_!.tga")
- precache_generic("gfx/career/icon_!-bigger.tga")
- precache_generic("gfx/career/icon_i.tga")
- precache_generic("gfx/career/icon_i-bigger.tga")
- precache_generic("gfx/career/icon_skulls.tga")
- precache_generic("gfx/career/round_corner_ne.tga")
- precache_generic("gfx/career/round_corner_nw.tga")
- precache_generic("gfx/career/round_corner_se.tga")
- precache_generic("gfx/career/round_corner_sw.tga")
- precache_generic("resource/TutorScheme.res")
- precache_generic("resource/UI/TutorTextWindow.res")
- }
- public Event_TeamScore()
- {
- new iTeam[2]
- read_data(1, iTeam, 1)
- iTeamScore[(iTeam[0]=='C')?1:0] = read_data(2)
- return PLUGIN_CONTINUE
- }
- public NewRound()
- {
- for (new id = 1; id < get_maxplayers(); id++)
- {
- static iMsg[128]
- format(iMsg, 127, "The Score:^nCT : %d VS TE : %d", iTeamScore[1], iTeamScore[0])
- Create_Show(id, iMsg)
- }
- }
- stock Create_Show(id, iMsg[])
- {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("TutorText"), {0, 0, 0}, id)
- write_string(iMsg)
- write_byte(0)
- write_short(0)
- write_short(0)
- message_end()
-
- remove_task(id)
- set_task(get_pcvar_float(pCvar_TaskTime), "Remove_Show", id)
- }
-
- public Remove_Show(id)
- {
- remove_task(id)
-
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("TutorClose"), {0, 0, 0}, id)
- message_end()
- }
- public cmdScore(id)
- {
- if (is_user_connected(id))
- {
- static iMsg[128]
- format(iMsg, 127, "The Score:^nCT : %d VS TE : %d", iTeamScore[1], iTeamScore[0])
- Create_Show(id, iMsg)
- return PLUGIN_HANDLED
- }
- return PLUGIN_CONTINUE
- }
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|