下面是引用 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);
}
}
}