引用 | 編輯
killer200
2012-11-18 08:15 |
樓主
▼ |
||
x0
請問如何做到視窗的右下角,用(set_hudmessage+show_hudmessage),令到在玩的時候能有自已的血量呢我這樣做對嗎???? #include <amxmodx> #include <fakemeta> #include <fun> public plugin_init() { register_plugin("Health","1.0","godkiller") register_event("RoundTime", "eNewRound", "bc") } public eNewRound(id) { new name[32], pid = read_data(2) get_user_name(pid, name, 31) set_hudmessage(0,255,0,0.3,0.53,0,3.0,6.0,0.5,0.15,3) show_hudmessage(id, "HP: %s", pev(pid, pev_health)) } 請幫小弟>< x0
|
引用 | 編輯
不能正視你
2012-11-19 18:02 |
1樓
▲ ▼ |
||||||||||
試用這個吧
我找了1個插件修改過的 我修改了沒有指令(自動開啓) 這個是顯示隊友的HP 如果你想修改只顯示自己 又或者是自己和敵人的 我再幫你修改 #include <amxmodx> new friend[33] public set_team(id){ friend[id] = read_data(2) } public hide_status(id){ set_hudmessage(0,0,0,0.0,0.0,0, 0.0, 0.01, 0.0, 0.0, 4) show_hudmessage(id,"") } public show_status(id){ new name[32],pid = read_data(2) get_user_name(pid,name,31) if (friend[id] == 1 ){ /* friend */ set_hudmessage(0,50,255,0.03,0.90,1, 0.01, 3.0, 0.01, 0.01, 4) /* blue */ show_hudmessage(id,"隊友(%s)血量:%d",name,get_user_health(pid)) /* wpnname[7] - trunk weapon_ */ } else { set_hudmessage(255,50,0,0.03,0.90,1, 0.01, 3.0, 0.01, 0.01, 4) /* red */ show_hudmessage(id,"敵人(%s)血量:%d",name,get_user_health(pid)) /* wpnname[7] - trunk weapon_ */ } return PLUGIN_CONTINUE } public plugin_init(){ register_plugin("aim info","0.9.2","default") register_event("StatusValue","set_team","be","1=1") register_event("StatusValue","show_status","be","1=2","2!0") register_event("StatusValue","hide_status","be","1=1","2=0") return PLUGIN_CONTINUE }
x0 |
引用 | 編輯
andyt0621
2012-11-20 20:21 |
6樓
▲ ▼ |
複製程式
// Client joins the game public client_putinserver(id) { if (!is_user_bot(id)) { // Set the custom HUD display task set_task(1.0, "ShowHUD", id, _, _, "b") } } // Show HUD Task public ShowHUD(id) { ... ... //your code } 樓主的Code只能在New Round時出現一陣子的 =.= x0 |
引用 | 編輯
不能正視你
2012-11-22 09:30 |
8樓
▲ ▼ |
||||||||||
下面是引用 killer200 於 2012-11-21 17:28 發表的 : 我另外找來這個 試一試用 客戶端指令 say /health - 顯示玩家HP 有源碼 OP指令 health_on <0|1> 0=插件關閉 1=插件開啓 health_time (秒) - 顯示血量時間(秒) 預設600秒(10分鐘) health_color <0|1|2> - 顯示血量顏色 預設2 0=白色 1=自定 (須使用health_custom 指令) // ZP生命值顯示顏色(R:0 G:0 B:255) (即是health_custom 0 0 255) 2=隨機 health_custom <RRR GGG BBB> //預設(0 255 0, 設定時必須用"0 255 0" 開引號) 顯示RGB顏色 RRR= 紅色代碼(0-255) GGG=綠色代碼(0-255) BBB=藍色代碼(0-255) health_effects <0|1|2> 顯示文字效果 0=沒有效果 1= 打印效果 2=閃爍效果 health_always <0|1> - 是否經常顯示hp 0=只顯示1次(倒數後結束) 1=經常顯示hp(重新開局都會顯示)
x0 |
引用 | 編輯
觀眾甲
2012-11-22 15:23 |
9樓
▲ ▼ |
複製程式
#include <amxmodx> #include <fun> public plugin_init() { register_plugin("123", "1.0", "123") } public client_putinserver(id) { check(id+2222) } public check(id) { id -= 2222 set_hudmessage(0,255,0,0.3,0.53,0,3.0,6.0,0.5,0.15,3) show_hudmessage(id, "HP: %d", get_user_health(id)) set_task(0.4, "check", id+2222) } x0 |
引用 | 編輯
不能正視你
2012-11-23 08:22 |
10樓
▲ ▼ |
下面是引用 上帝的右手^^ 於 2012-11-22 15:23 發表的 : 想學一下 id-=2222 和id+2222 作用是什麼? 用作派發玩家id 每1個玩家不同id? 有沒有死亡後不顯示? x1 |
引用 | 編輯
killer200
2012-11-24 12:15 |
11樓
▲ |
下面是引用 上帝的右手^^ 於 2012-11-22 15:23 發表的 : 請問... 為什麼要check(id+2222).... 我不明白 因為我看另一個是 +9898 ..... x0 |