Custom Hud
|
|
ir-ham97 | Date: Saturday, 20 Dec 2014, 7:35 PM | Message # 1 |
New Member
Group: Member
Messages: 1
Status: Offline
| apakah yang salah dari plugin yang daku coba buat ini :(
#include <amxmodx> #include <amxmisc> #include <fun> #include <berton>
#define PLUGIN "HUD" #define VERSION "1.0" #define AUTHOR "IRFAN"
public plugin_init() { register_plugin("HUD", "0.2", "irfan") register_event("Health", "event_Health", "be")
} public client_putinserver(id) { set_task(1.0,"drawPNG",id) set_task(1.0,"drawhealth",id) }
//---------------------------------------------------------------------------------------------- public drawPNG(id) { BX_DrawPNG(id, "hud", 255, 255, 255, 1.0, 0, 0, 0, 0.0, 0.0, 0, 2) } //----------------------------------------------------------------------------------------- public event_Health(id) { new hp_hud[33] BX_InitFont(id, "arial", 0, 0, 0, 20, 1); formatex(hp_hud,31,"Health Point %03d Remaining", get_user_health(id)) BX_DrawFont(id, hp_hud, 255, 255, 255, 0.7, 1, 0.5, 0.985, 0, 1) } problem: -hp cuma muncul setelah kena damage gimana cara fixnya ya???
maap kalo acak2kan, first time bikin thread :D
help me please.... :D
|
|
| |
DavidJr | Date: Sunday, 21 Dec 2014, 7:18 AM | Message # 2 |
CEO
Group: Executive Team
Messages: 471
Status: Offline
| set_task(1.0,"drawhealth",id) gak kepake tuh, di client_putinserver kasih event_Health(id)
Code public client_putinserver(id) { set_task(1.0,"drawPNG",id) event_Health(id) }
InitFont cuma boleh sekali aja, bikin task baru di client_putinserver untuk initfont
Auto Aim Bot Detector: http://youtu.be/NiKY0rG7cNg
|
|
| |
callmetoto2008 | Date: Wednesday, 31 Dec 2014, 5:45 PM | Message # 3 |
New Member
Group: Member
Messages: 5
Status: Offline
| Coba seperti ini gan
public event_Health(id) { new Float:health, hp_hud[32] format(hp_hud, 31, "Health Point %d Remaining", pev(id, pev_health, health)) BX_InitFont(id, "arial", 0, 0, 0, 20, 1); BX_DrawFont(id, hp_hud, 255, 255, 255, 0.7, 1, 0.5, 0.985, 0, 1) BX_DrawPNG(id, "hud", 255, 255, 255, 1.0, 0, 0, 0, 0.0, 0.0, 0, 2) }
~jadi tidak harus menambah 2 perintah set_task..
Seorang pemula yang mencoba belajar dengan berbagai keterbasannya. :)
Message edited by callmetoto2008 - Wednesday, 31 Dec 2014, 6:03 PM |
|
| |