Участник
Пользователь
- Сообщения
- 278
- Реакции
- 137
PurposeLess submitted a new resource:
Health Display - Health Display
Read more about this resource...
Health Display - Health Display
Read more about this resource...
@message_hideweapon()
{
set_msg_arg_int(1, ARG_BYTE, get_msg_arg_int(1) | (1<<3));
}
/**
* Player HUD
* CBasePlayer::m_iHideHUD
*/
#define HIDEHUD_WEAPONS (1<<0)
#define HIDEHUD_FLASHLIGHT (1<<1)
#define HIDEHUD_ALL (1<<2)
#define HIDEHUD_HEALTH (1<<3)
#define HIDEHUD_TIMER (1<<4)
#define HIDEHUD_MONEY (1<<5)
#define HIDEHUD_CROSSHAIR (1<<6)
#define HIDEHUD_OBSERVER_CROSSHAIR (1<<7)
#include <amxmodx>
#include <reapi>
public plugin_init() {
register_plugin("Health Display", "1.2", "PurposeLess");
RegisterHookChain(RG_CBasePlayer_Spawn, "@CBasePlayer_Spawn", .post=true);
RegisterHookChain(RG_CBasePlayer_Killed, "@CBasePlayer_Killed", .post=true);
}
public client_disconnected(id)
{
remove_task(id);
}
@CBasePlayer_Spawn(const id)
{
if(!is_user_alive(id))
{
return;
}
set_member(id, m_iHideHUD, (1<<3));
if(!task_exists(id))
{
set_task(0.1, "@task_healtharmor", id, .flags = "b");
}
}
@CBasePlayer_Killed(const victim, const attacker)
{
#pragma unused attacker
remove_task(victim);
}
@task_healtharmor(const id)
{
static Float:health; health = get_entvar(id, var_health);
static Float:armor; armor = get_entvar(id, var_armorvalue);
set_dhudmessage(0, 255, 0, 0.01, 0.96, 0, 0.0, 0.2, 0.0, 0.0);
show_dhudmessage(id, "¤ HP: %0.f | ARMOR: %0.f", health, armor);
}
It doesn't update health and armor of user because of dhud.PurposeLess, task 0.1 sec rly?