|
发表于 2010-12-23 11:38:20
|
显示全部楼层
来自 中国–上海–上海–松江区
由于我玩1.5,因此下面HUD显示不冲突未测试....
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Team Score"
#define VERSION "1.0"
#define AUTHOR "Osker Lee"
new ct_score, terrorist_score
new g_MsgTutor
new const g_TutorPrecache[][] = { "gfx/career/round_corner_nw.tga", "resource/TutorScheme.res", "resource/UI/TutorTextWindow.res" }
new g_MyMsgSync
public plugin_init() {
register_plugin(PLUGIN,VERSION,AUTHOR)
register_event("TeamScore","team_score", "a")
set_task(1.0,"score_round",_,_,_,"b")
register_event("HLTV", "NewRound", "a", "1=0", "2=0")
g_MsgTutor = get_user_msgid("TutorText")
g_MyMsgSync = CreateHudSyncObj()
}
public plugin_precache()
{
new i
for(i = 0; i < sizeof g_TutorPrecache; i++)
{
precache_generic(g_TutorPrecache)
}
}
public score_round()
{
set_hudmessage(255, 255, 255, -1.0, 0.02, 0, 0.5, 2.0, 0.08, 2.0, -1);
ShowSyncHudMsg(0,g_MyMsgSync,"%d ", terrorist_score);
set_hudmessage(255, 255, 255, -1.0, 0.02, 0, 0.5, 2.0, 0.08, 2.0, -1);
ShowSyncHudMsg(0,g_MyMsgSync," %d", ct_score);
}
public NewRound()
{
for (new id = 1; id < get_maxplayers(); id++)
{
new Text[ 100 ]
MakeTutor(id, Text)
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
stock MakeTutor(id,Text[]){
message_begin(MSG_ONE_UNRELIABLE,g_MsgTutor,_,id)
write_string(Text)
write_byte(0)
write_short(0)
write_short(0)
message_end()
}
public tutorek(id)
{
new Text[ 100 ]
MakeTutor(id, Text)
return PLUGIN_CONTINUE
}
public team_score()
{
new team[32];
read_data(1,team,31);
if (equal(team,"CT"))
{
ct_score = read_data(2);
}
else if (equal(team,"TERRORIST"))
{
terrorist_score = read_data(2);
}
} |
|