高手看看这个比分牌【带源码】
下面是源码:#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;
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;
static ctshiwei;
static ctbaiwei;
static tgewei;
static tshiwei;
static tbaiwei;
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);
}
}
为什么我加载会什么也显示不了 哪里不对吗 估计是什么什么没设置。 需要加载metahook模块,最近网上流传的csodjb单机版就是用metahook来修改的。
页:
[1]