ZE ZOMBIE HEALTH BAR
ZE ZOMBIE HEALTH BAR
I would like to have a more advanced version.
The less health, the color turns from green to red.
Something like that.
Also, a longer and larger health bar sprite.
The less health, the color turns from green to red.
Something like that.
Also, a longer and larger health bar sprite.
-
- Veteran Member
- Posts: 678
- Joined: 7 years ago
- Location: Paraguay
- Contact:
Oo I think U mean Like zp has health bar?
Well I will make it for You If u want
Well I will make it for You If u want
Nobody Is That Busy If They Make Time
-
- Veteran Member
- Posts: 678
- Joined: 7 years ago
- Location: Paraguay
- Contact:
- #include <zombie_escape>
- #define PLUGIN "[ZE] Addon: Show Health Bar"
- #define VERSION "1.0"
- #define AUTHOR "ZE DEV TEAM"
- new const healthbar_spr[] = "sprites/zb_healthbar.spr"
- new g_playerbar[33] , g_isAlive[33]
- new g_playerMaxHealth[33]
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- RegisterHam(Ham_Spawn, "player", "ham_spawn_post", 1)
- register_forward(FM_AddToFullPack, "fm_addtofullpack_post", 1)
- register_event("ResetHUD", "event_resethud", "be")
- register_event("DeathMsg", "event_death", "a")
- register_event("Health", "event_health", "be")
- make_healthbar()
- }
- public make_healthbar()
- {
- static playerBar, allocString
- allocString = engfunc(EngFunc_AllocString, "env_sprite")
- for( new id = 1; id <= get_maxplayers(); id ++ )
- {
- g_playerbar[id] = engfunc(EngFunc_CreateNamedEntity, allocString)
- playerBar = g_playerbar[id]
- if(pev_valid(playerBar))
- {
- set_pev(playerBar, pev_scale, 0.25)
- engfunc(EngFunc_SetModel, playerBar, healthbar_spr)
- set_pev(playerBar, pev_effects, pev(playerBar, pev_effects ) | EF_NODRAW)
- }
- }
- }
- public plugin_precache() engfunc(EngFunc_PrecacheModel, healthbar_spr)
- public ham_spawn_post(id)
- {
- if(is_user_alive(id))
- {
- g_isAlive[id] = 1
- }
- }
- public ze_user_infected(id)
- {
- g_playerMaxHealth[id] = get_user_health(id)
- }
- public ze_user_humanized(id)
- {
- set_pev(g_playerbar[id], pev_effects, pev(g_playerbar[id], pev_effects) | EF_NODRAW)
- }
- public client_disconnect(id)
- {
- set_pev(g_playerbar[id], pev_effects, pev(g_playerbar[id], pev_effects) | EF_NODRAW)
- }
- public event_resethud(id)
- {
- set_pev(g_playerbar[id], pev_effects, pev(g_playerbar[id], pev_effects) | EF_NODRAW)
- }
- public event_death()
- {
- new id = read_data(2)
- g_isAlive[id] = 0
- set_pev(g_playerbar[id], pev_effects, pev(g_playerbar[id], pev_effects) | EF_NODRAW)
- }
- public event_health(id)
- {
- new hp = get_user_health(id)
- if(g_playerMaxHealth[id] < hp)
- {
- g_playerMaxHealth[id] = hp
- set_pev(g_playerbar[id], pev_frame, 99.0)
- }
- else
- {
- set_pev(g_playerbar[id], pev_frame, 0.0 + (((hp - 1) * 100) / g_playerMaxHealth[id]))
- }
- }
- public fm_addtofullpack_post(es, e, user, host, host_flags, player, p_set)
- {
- if(!player)
- return FMRES_IGNORED
- if(!is_user_alive(host) || !is_user_alive(user))
- return FMRES_IGNORED
- if(!ze_is_user_zombie(user))
- return FMRES_IGNORED
- if(host == user)
- return FMRES_IGNORED
- new Float:PlayerOrigin[3]
- pev(user, pev_origin, PlayerOrigin)
- PlayerOrigin[2] += 60.0
- engfunc(EngFunc_SetOrigin, g_playerbar[user], PlayerOrigin)
- set_pev(g_playerbar[user], pev_effects, pev(g_playerbar[user], pev_effects) & ~EF_NODRAW)
- return FMRES_HANDLED
- }
sprite u can download from here
http://www.mediafire.com/file/1naee37b0 ... th+Bar.rar
Nobody Is That Busy If They Make Time
Johnny, Upload the file direct to our forum better (It's not so big to upload to external platform).
He who fails to plan is planning to fail
-
- Veteran Member
- Posts: 678
- Joined: 7 years ago
- Location: Paraguay
- Contact:
How about Posting the full Plugin ?
Nobody Is That Busy If They Make Time
Will be good idea if you posted it.
He who fails to plan is planning to fail
Cool. That's what I mean. Thank you.johnnysins2000 wrote: ↑6 years ago Oo I think U mean Like zp has health bar?
Well I will make it for You If u want
May be some cvars like zb/human display, who can see and something else...
The most important part is the sprite and it will change color as the health.
-
- Veteran Member
- Posts: 678
- Joined: 7 years ago
- Location: Paraguay
- Contact:
Mark it as solved and locked
plugin is available here
http://escapers-zone.xyz/viewtopic.php? ... 3392#p3392
plugin is available here
http://escapers-zone.xyz/viewtopic.php? ... 3392#p3392
Nobody Is That Busy If They Make Time
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute
Sign in
Who is online
Users browsing this forum: No registered users and 1 guest