Raised This Month: $51 Target: $400
 12% 

Zombie Health


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheTimo007
Member
Join Date: Oct 2010
Location: Estonia
Old 01-23-2011 , 07:12   Zombie Health
Reply With Quote #1

Can someone make plugin that shows Zombie Health : in the middle of screen.
TheTimo007 is offline
MostwantedScript
Senior Member
Join Date: Sep 2010
Location: Sweden,Gothenburg
Old 01-23-2011 , 13:49   Re: Zombie Health
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>

// Uncomment this if you want to show the taken damage
//#define SHOW_DAMAGE_ON_MESSAGE

// Integers
new g_iMaxPlayers

// Bools
new bool:g_bIsConnected[33]

// Macros
#define IsConnected(%1) (1 <= %1 <= g_iMaxPlayers && g_bIsConnected[%1])

#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "meTaLiCroSS"

public plugin_init() 
{
    
register_plugin("[ZP] Addon: Zombie HP Displayer"PLUGIN_VERSIONPLUGIN_AUTHOR)
    
    
RegisterHam(Ham_TakeDamage"player""fw_Player_TakeDamage_Post"1)
    
    
g_iMaxPlayers get_maxplayers()
}

public 
client_putinserver(iIdg_bIsConnected[iId] = true
public client_disconnect(iIdg_bIsConnected[iId] = false

public fw_Player_TakeDamage_Post(iVictimiInflictoriAttackerFloat:flDamageiDamageType)
{
    if(!
IsConnected(iAttacker) || iVictim == iAttacker)
        return 
HAM_IGNORED
    
    
if(zp_get_user_zombie(iVictim))
    {
        
// I use statics variables
        // because this forward can (or not)
        // be called many times.
        
static iVictimHealth
        iVictimHealth 
get_user_health(iVictim)
        
        if(
iVictimHealth)
        
#if defined SHOW_DAMAGE_ON_MESSAGE
            
client_print(iAttackerprint_center"You did %.1f Damage. Health Remaining: %d"flDamageiVictimHealth)  
        
#else
            
client_print(iAttackerprint_center"Health Remaining: %d"iVictimHealth)  
        
#endif
        
else
            
client_print(iAttackerprint_center"You Killed him")
            
        return 
HAM_HANDLED
    
}
    
    return 
HAM_IGNORED

__________________
Owner & Creator of
http://mostwantedhf.info
MostwantedScript is offline
Send a message via Skype™ to MostwantedScript
TheTimo007
Member
Join Date: Oct 2010
Location: Estonia
Old 01-23-2011 , 14:23   Re: Zombie Health
Reply With Quote #3

fatal error: 100: cannot read from file "zombieplague"
TheTimo007 is offline
RelaxMazteR
Member
Join Date: Jul 2009
Location: Sweden
Old 01-23-2011 , 14:55   Re: Zombie Health
Reply With Quote #4

You need to have "zombieplague" in your include folder. You can download it here
http://forums.alliedmods.net/showthread.php?t=72505
RelaxMazteR is offline
TheTimo007
Member
Join Date: Oct 2010
Location: Estonia
Old 01-24-2011 , 08:39   Re: Zombie Health
Reply With Quote #5

But i want this plugin for Base Builder Zombie Mod, is it possible?
TheTimo007 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-24-2011 , 11:23   Re: Zombie Health
Reply With Quote #6

PHP Code:
#include <amxmodx>
#include <hamsandwich>

// Uncomment this if you want to show the taken damage
//#define SHOW_DAMAGE_ON_MESSAGE

// Integers
new g_iMaxPlayers

// Bools
new bool:g_bIsConnected[33]

// Macros
#define IsConnected(%1) (1 <= %1 <= g_iMaxPlayers && g_bIsConnected[%1])

#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "meTaLiCroSS"

public plugin_init() 
{
    
register_plugin("[BB] Addon: Zombie HP Displayer"PLUGIN_VERSIONPLUGIN_AUTHOR)
    
    
RegisterHam(Ham_TakeDamage"player""fw_Player_TakeDamage_Post"1)
    
    
g_iMaxPlayers get_maxplayers()
}

public 
client_putinserver(iIdg_bIsConnected[iId] = true
public client_disconnect(iIdg_bIsConnected[iId] = false

public fw_Player_TakeDamage_Post(iVictimiInflictoriAttackerFloat:flDamageiDamageType)
{
    if(!
IsConnected(iAttacker) || iVictim == iAttacker)
        return 
HAM_IGNORED
    
    
if(get_user_team(iVictim) == 1)
    {
        
// I use statics variables
        // because this forward can (or not)
        // be called many times.
        
static iVictimHealth
        iVictimHealth 
get_user_health(iVictim)
        
        if(
iVictimHealth)
        
#if defined SHOW_DAMAGE_ON_MESSAGE
            
client_print(iAttackerprint_center"You did %.1f Damage. Health Remaining: %d"flDamageiVictimHealth)  
        
#else
            
client_print(iAttackerprint_center"Health Remaining: %d"iVictimHealth)  
        
#endif
        
else
            
client_print(iAttackerprint_center"You Killed him")
            
        return 
HAM_HANDLED
    
}
    
    return 
HAM_IGNORED

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
TheTimo007
Member
Join Date: Oct 2010
Location: Estonia
Old 01-24-2011 , 16:02   Re: Zombie Health
Reply With Quote #7

Ty Exolent, it worked well !
TheTimo007 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-26-2011 , 20:02   Re: Zombie Health
Reply With Quote #8

Version for admins only requested via PM.
PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define ADMIN_FLAG ADMIN_KICK

// Uncomment this if you want to show the taken damage
//#define SHOW_DAMAGE_ON_MESSAGE

// Integers
new g_iMaxPlayers

// Bools
new bool:g_bIsConnected[33]

// Macros
#define IsConnected(%1) (1 <= %1 <= g_iMaxPlayers && g_bIsConnected[%1])

#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "meTaLiCroSS"

public plugin_init() 
{
    
register_plugin("[BB] Addon: Zombie HP Displayer"PLUGIN_VERSIONPLUGIN_AUTHOR)
    
    
RegisterHam(Ham_TakeDamage"player""fw_Player_TakeDamage_Post"1)
    
    
g_iMaxPlayers get_maxplayers()
}

public 
client_putinserver(iIdg_bIsConnected[iId] = true
public client_disconnect(iIdg_bIsConnected[iId] = false

public fw_Player_TakeDamage_Post(iVictimiInflictoriAttackerFloat:flDamageiDamageType)
{
    if(!
IsConnected(iAttacker) || iVictim == iAttacker)
        return 
HAM_IGNORED
    
    
if(get_user_team(iVictim) == && (get_user_flags(iAttacker) & ADMIN_FLAG))
    {
        
// I use statics variables
        // because this forward can (or not)
        // be called many times.
        
static iVictimHealth
        iVictimHealth 
get_user_health(iVictim)
        
        if(
iVictimHealth)
        
#if defined SHOW_DAMAGE_ON_MESSAGE
            
client_print(iAttackerprint_center"You did %.1f Damage. Health Remaining: %d"flDamageiVictimHealth)  
        
#else
            
client_print(iAttackerprint_center"Health Remaining: %d"iVictimHealth)  
        
#endif
        
else
            
client_print(iAttackerprint_center"You Killed him")
            
        return 
HAM_HANDLED
    
}
    
    return 
HAM_IGNORED

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode