Approved Show Zombie HP

Plug-ins compatibility with Zombie Escape 1.x only!


Post Reply
User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

Show Zombie HP

#1

Post by Raheem » 7 years ago

Show Zombie HP

Description:
  • This plugin will show a Hud message when you attack or make damage for the zombie. This message will tell you his HP.

Cvars:
  • ze_hpremain_mode 1 Type of HP remaining ( 1 = Normal | 0 = HUD )
  • ze_hpremain_commas 1 Enable or Disable Adding Commas to HP? 1 = Enable | 0 = Disable
Installation & Instructions:
  • Simply install it like any plugin.

Changelog:
  • Spoiler!
    Version: 1.0
    • First Release.
    Version: 1.1
    • Added new Cvar for Commas.
    • Fixed problem that message was show everytime zombie take damage from anything.
    Version: 1.2 [Current Version]
    • Update Cvars.
    • Added HUD mode.
    • Fixed show HP when infect player.
Screenshots:
  • The attachment ze_atix_assault_u30000.jpg is no longer available
    Pic0
    Pic0
    Pic1
    Pic1
    Pic2
    Pic2
    Pic3
    Pic3
Downloads:
  • Pic4
    Pic4
He who fails to plan is planning to fail

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 7 years ago

New version Released.
Current Version Now: 1.1
He who fails to plan is planning to fail

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#3

Post by czirimbolo » 5 years ago

L 08/11/2018 - 09:42:11: Invalid player id 96
L 08/11/2018 - 09:42:11: [AMXX] Displaying debug trace (plugin "ze_show_zombie_hp.amxx", version "1.1")
L 08/11/2018 - 09:42:11: [AMXX] Run time error 10: native error (native "client_print")
L 08/11/2018 - 09:42:11: [AMXX] [0] ze_show_zombie_hp.sma::Fw_TakeDamage_Post (line 24)

This crashed me server 2 times
Image

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#4

Post by Raheem » 5 years ago

Invalid id errors can not crash the server, it's only logged and the message won't be sent if it's invalid. Anyway i added checks to know if this user valid or not:
  • Code: Select all

    #include <zombie_escape>
    
    new cvar_enable_commas
    
    public plugin_init()
    {
        register_plugin("[ZE] Show Zombie HP", "1.1", "Raheem")
        
        // Hook Chains
        RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_TakeDamage_Post", 1)
    	
    	// Cvars
        cvar_enable_commas = register_cvar("ze_enable_commas_hp", "1")
    }
    
    public Fw_TakeDamage_Post(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
    {
    	if (!is_user_alive(iVictim) || !is_user_alive(iAttacker))
    		return
    	
        if (get_member(iAttacker, m_iTeam) == TEAM_CT && get_member(iVictim, m_iTeam) == TEAM_TERRORIST)
    	{
    		if (get_pcvar_num(cvar_enable_commas) == 1)
    		{
    			new szHealth[15];
    			AddCommas(get_user_health(iVictim), szHealth, charsmax(szHealth))
    			client_print(iAttacker, print_center,"HP: %s", szHealth)
    		}
    		else
    		{
    			client_print(iAttacker, print_center,"HP: %i", get_user_health(iVictim))
    		}
    	}
    }
He who fails to plan is planning to fail

BandiT
Member
Member
Romania
Posts: 59
Joined: 4 years ago
Contact:

#5

Post by BandiT » 2 years ago

czirimbolo wrote: 5 years ago L 08/11/2018 - 09:42:11: Invalid player id 96
L 08/11/2018 - 09:42:11: [AMXX] Displaying debug trace (plugin "ze_show_zombie_hp.amxx", version "1.1")
L 08/11/2018 - 09:42:11: [AMXX] Run time error 10: native error (native "client_print")
L 08/11/2018 - 09:42:11: [AMXX] [0] ze_show_zombie_hp.sma::Fw_TakeDamage_Post (line 24)

This crashed me server 2 times
do you have the fixed plugin ?

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#6

Post by czirimbolo » 2 years ago

I use this:

Code: Select all

#include <zombie_escape>

new cvar_enable_commas

public plugin_init()
{
    register_plugin("[ZE] Show Zombie HP", "1.1", "Raheem")
    
    // Hook Chains
    RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_TakeDamage_Post", 1)
	
	// Cvars
    cvar_enable_commas = register_cvar("ze_enable_commas_hp", "1")
}

public Fw_TakeDamage_Post(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
{
	if (!is_user_alive(iVictim) || !is_user_alive(iAttacker))
		return
	
    if (get_member(iAttacker, m_iTeam) == TEAM_CT && get_member(iVictim, m_iTeam) == TEAM_TERRORIST)
	{
		if (get_pcvar_num(cvar_enable_commas) == 1)
		{
			new szHealth[15];
			AddCommas(get_user_health(iVictim), szHealth, charsmax(szHealth))
			client_print(iAttacker, print_center,"HP: %s", szHealth)
		}
		else
		{
			client_print(iAttacker, print_center,"HP: %i", get_user_health(iVictim))
		}
	}
}
Image

BandiT
Member
Member
Romania
Posts: 59
Joined: 4 years ago
Contact:

#7

Post by BandiT » 2 years ago

Thanks

User avatar
z0h1r-LK
Mod Developer
Mod Developer
Morocco
Posts: 473
Joined: 5 years ago
Location: The Red City ❤
Contact:

#8

Post by z0h1r-LK » 1 year ago

Updated to 1.2

Post Reply

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

Register

Sign in

Who is online

Users browsing this forum: No registered users and 0 guests