+- +-

+-User

Welcome, Guest.
Please login or register.
 
 
 

Login with your social network

Forgot your password?

Author Topic: Health And Armor Display  (Read 528 times)

0 Members and 1 Guest are viewing this topic.

DON KHAN

  • My Bio
  • FoundeR
  • Hero Member
  • *****
  • Posts: 5046
  • Karma: +0/-0
  • Gender: Male
  • Scriptor, Model Editor, Bug Fixer And Student
  • Location: Karachi
    • View Profile
    • Ro{Y}aL WarLanD Community
Health And Armor Display
« on: March 28, 2019, 10:23:39 pm »
Hello Guys  ;D ;D

There Was A Request About Health And Armor Display Plugin So I'm Posting This Plugin Here.

This Hud Armor And Health Look Like Real Health And Display.

You Need To Add:-

amxx File:- cstrike/addons/amxmodx/plugin

sma File:- cstrike/addons/amxmodx/scripting

inc File:- cstrike/addons/amxmodx/scripting/include

Code: [Select]
#include <amxmodx>
#include <engine>
#include <dhudmessage>

enum UserStats
{
USER_HP = 0,
USER_AP
}

new bool:g_b_user_hp_hud_blink[33], g_i_user_cache_stats[33][UserStats]
public plugin_init() {
register_plugin("Real-Like HP/AP HUD", "2.4", "DON KHAN")

register_event("Health","Event_Health","b")
register_event("Battery","Event_Battery","b")

new ent = create_entity("info_target")
entity_set_string(ent,EV_SZ_classname,"env_hud")
entity_set_float(ent,EV_FL_nextthink,get_gametime() + 0.5)

register_think("env_hud","env_hud_think")
}

public Event_Health(id) g_i_user_cache_stats[id][USER_HP] = get_user_health(id)
public Event_Battery(id) g_i_user_cache_stats[id][USER_AP] = get_user_armor(id)

public env_hud_think(ent)
{
entity_set_float(ent,EV_FL_nextthink,get_gametime() + 0.5)

static i_players[32],i_num, id
get_players(i_players,i_num,"a")

static i_health,i_armor

for(--i_num ; i_num >= 0 ; i_num--)
{
id = i_players[i_num]

i_health = g_i_user_cache_stats[id][USER_HP]
i_armor = g_i_user_cache_stats[id][USER_AP]

set_dhudmessage(255, 255, 255, 0.01, 0.92, 0, 0.0, 0.5, 0.0, 0.0)
show_dhudmessage(id, "HP:           AP:")

if(i_health > 30 || !g_b_user_hp_hud_blink[id])
{
g_b_user_hp_hud_blink[id] = true
set_dhudmessage(255, 170, 0, 0.01, 0.92, 0, 0.0, 0.5, 0.0, 0.0)
} else {
if(i_health <= 10) g_b_user_hp_hud_blink[id] = false
set_dhudmessage(255, 0, 0, 0.01, 0.92, 0, 0.0, 0.5, 0.0, 0.0)
}
show_dhudmessage(id, "     %i",i_health)

if(i_armor > 30)
{
set_dhudmessage(255, 170, 0, 0.01, 0.92, 0, 0.0, 0.5, 0.0, 0.0)
} else {
set_dhudmessage(255, 0, 0, 0.01, 0.92, 0, 0.0, 0.5, 0.0, 0.0)
}
show_dhudmessage(id, "                     %i",i_armor)
}
}

Get Plugin:- https://www.mediafire.com/file/8zqp8n4hfc6uv3n/HP_And_AP_Hud.amxx/file
Get Source:- https://www.mediafire.com/file/hcymedrcqok5uqc/HP_And_AP_Hud.sma/file
Get Include:- https://www.mediafire.com/file/myb61w282x56b28/dhudmessage.inc/file
Selling Mods.
PM Me If You Want Any Plugin.
Facebook:- https://www.facebook.com/cs.pro.usman
Youtube:- PC Gaming And Technology With Usman
My Introduction:- Muslim, Student, Scriptor At Counter Strike 1.6, Bug Fixer And Model Editor.
To Download Any Game Visit Here:- http://crazygamers.ucoz.net/

Share on Facebook Share on Twitter


 

+-Recent Topics

5 ways to make money from playing games by Martha Louise
February 21, 2023, 01:47:19 am

Need mod :/ by bacem
October 13, 2019, 05:49:09 am

Rules by DON KHAN
August 28, 2019, 01:50:29 pm

[REQ] VIP are knife and all see this by DON KHAN
August 20, 2019, 12:56:37 pm

Advance VIP Menu [Public, CSDM & Furien] by DON KHAN
June 22, 2019, 11:50:05 am

For Umbrella Swarm mod by DON KHAN
June 22, 2019, 08:13:26 am

[ZP] VIP Model by DON KHAN
June 17, 2019, 08:57:35 am

[ZP] SVIP Plugin by DON KHAN
June 13, 2019, 11:43:24 am

Updates / Helpful BBC Codes For Your Post by DON KHAN
June 09, 2019, 03:01:39 am

BHOP Script by DON KHAN
June 08, 2019, 01:40:41 pm