下面是引用 storym88349 于 2009-11-02 20:45 发表的 :
新进度,可以转档,可以使用,但是距离还是有问题
目前的问题是,距离没有办法跟着改变
[code]
#include <amxmodx>
#include <amxmisc>
.......
写得蛮不错的说
稍为帮你修改一下,请先试试看好了
#include <amxmodx>
#include <fakemeta>
#include <csx>
new bool:planted
new Float:C4Origin[3]
new Maxplayers
public plugin_init(){
register_plugin("Show Distance", "1.0", "FK")
register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0")
Maxplayers = get_maxplayers()
set_task(0.1, "hud", 0, "", 0, "b")
}
public event_RoundStart(){
planted = false
}
public bomb_planted(planter){
planted = true
pev(planter, pev_origin, C4Origin)
return PLUGIN_CONTINUE;
}
public bomb_explode(){
planted = false
return PLUGIN_HANDLED;
}
public bomb_defused(){
planted = false
return PLUGIN_HANDLED;
}
public hud(){
if (planted){
new Float:Origin[3], Float:Distance
for (new id = 1; id <= Maxplayers; id++){
if (!is_user_connected(id) || !is_user_alive(id))
continue;
pev(id, pev_origin, Origin)
Distance = get_distance_f(C4Origin, Origin);
set_hudmessage(255, 0, 0, -1.0, 0.73, 0, 6.0, 0.2, 0.1, 0.2, 4);
show_hudmessage(id, "距离C4装设点:%4.1f", Distance);
}
}
}