下面是源码:
#include <amxmodx>
#include <amxmisc>
#include <metahook>
new ct_score, terrorist_score;
public plugin_init()
{
register_plugin("New test", "1.0", "Ethan_Xue");
register_event("TeamScore", "team_score", "a");
}
public client_putinserver(id)
{
set_task(1.0, "AddImgs", id, _, _, "b");
}
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);
}
}
public AddImgs(id)
{
if(MH_IsMetaHookPlayer(id)){
static ctgewei[128];
static ctshiwei[128];
static ctbaiwei[128];
static tgewei[128];
static tshiwei[128];
static tbaiwei[128];
format(ctgewei,4,"%s%d","Num",ct_score%10);
format(ctshiwei,4,"%s%d","Num",ct_score/10);
format(ctbaiwei,4,"%s%d","Num",ct_score/100);
format(tgewei,4,"%s%d","Num",terrorist_score%10);
format(tshiwei,4,"%s%d","Num",terrorist_score/10);
format(tbaiwei,4,"%s%d","Num",terrorist_score/100);
MH_DrawHolesImage(id, 0, "score", 0.3, 0.0, 255, 255, 255, 0, 2.0, 1);
MH_DrawAdditiveImage(id, 0, ctshiwei, 0.37, 0.01, 255, 255, 255, 0, 2.0, 2);
MH_DrawAdditiveImage(id, 0, ctgewei, 0.40, 0.01, 255, 255, 255, 0, 2.0, 4);
MH_DrawAdditiveImage(id, 0, tshiwei, 0.57, 0.01, 255, 255, 255, 0, 2.0, 3);
MH_DrawAdditiveImage(id, 0, tgewei, 0.60, 0.01, 255, 255, 255, 0, 2.0, 5);
if(ct_score>99)
MH_DrawAdditiveImage(id, 0, ctbaiwei, 0.33, 0.01, 255, 255, 255, 0, 2.0, 6);
if(terrorist_score>99)
MH_DrawAdditiveImage(id, 0, tbaiwei, 0.55, 0.01, 255, 255, 255, 0, 2.0, 7);
}
}
为什么我加载会什么也显示不了 哪里不对吗 |