Code:
/* !! Viziteaza <a href="http://www.tutyzone.ucoz.com" target="_blank" rel="nofollow noopener">www.tutyzone.ucoz.com</a> !!
-> Intra pe serveru nostru -> tutyzone2.idle.ro <- = Biohazard Zombie Infection si multe alte noutati
copyright (c)
*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#define PLUGIN "battery_low"
#define VERSION "1.0"
#define AUTHOR "tuty"
new HB
new healthBat
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
HB = register_cvar("amx_healthbattery", "1")
register_event("ResetHUD","event_spawm","be")
}
public event_spawm(id)
{
set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(id, "[========]")
}
public client_PreThink(id)
{
healthBat = get_user_health(id)
if(get_pcvar_num(HB) != 1 && !is_user_alive(id))
return;
set_hudmessage(0, 0, 255, 0.0, -1.0, 0, 6.0, 12.0)
if(healthBat > 100 && healthBat < 100)
{
set_hudmessage(255, 255, 255, 0.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(id, "[========]FULL")
}
if(healthBat > 90 && healthBat < 100)(show_hudmessage(id, "[========]"))
if(healthBat > 80 && healthBat < 90)(show_hudmessage(id, "[=======]"))
if(healthBat > 70 && healthBat < 80)(show_hudmessage(id, "[======]"))
if(healthBat > 60 && healthBat < 70)(show_hudmessage(id, "[=====]"))
if(healthBat > 50 && healthBat < 60)(show_hudmessage(id, "[====]"))
if(healthBat > 40 && healthBat < 50)(show_hudmessage(id, "[===]"))
if(healthBat > 20 && healthBat < 40)(show_hudmessage(id, "[==]"))
if(healthBat > 0 && healthBat < 20)
{
set_hudmessage(255, 0, 0, 0.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(id, "!!!!! [=] !!!! ^nBatteryLow")
set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,20)
}
}