Raised This Month: $ Target: $400
 0% 

Subplugin Submission [ZP] Addon: Show Health, Armor For Zombie


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fl0werD
Senior Member
Join Date: May 2011
Old 06-11-2011 , 10:54   [ZP] Addon: Show Health, Armor For Zombie
Reply With Quote #1

[ZP] Addon: Show Health, Armor For Zombie.

Author: [WPMG]fl0wer
Version: 0.1

[Description]
- plugin shows the health and armor for the zombies.

If a person has armor then we will see:
Click image for larger version

Name:	1307646441_armor.jpg
Views:	3252
Size:	4.4 KB
ID:	87257
If no armor:
Click image for larger version

Name:	1307646482_health.jpg
Views:	1724
Size:	2.6 KB
ID:	87258

Attached Files
File Type: sma Get Plugin or Get Source (zp_addon_show_health_armor_human.sma - 5995 views - 633 Bytes)
fl0werD is offline
Send a message via ICQ to fl0werD
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-12-2011 , 09:41   Re: [ZP] Addon: Show Health, Armor For Zombie
Reply With Quote #2

is that working no error logs ?
.Dare Devil. is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 06-12-2011 , 11:43   Re: [ZP] Addon: Show Health, Armor For Zombie
Reply With Quote #3

You should check if the attacker is a player.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
DSASDFGH
Senior Member
Join Date: Jul 2011
Location: Facebook
Old 08-26-2011 , 10:11   Re: [ZP] Addon: Show Health, Armor For Zombie
Reply With Quote #4

Optimized

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <zombieplague>
public plugin_init()
{
 
register_plugin("[ZP] Addon: Show Health, Armor For Zombie""0.1""WPMG Team")
 
RegisterHam(Ham_TakeDamage"player""Player_TakeDamage"1)
}
public 
Player_TakeDamage(victiminflictorattackerFloat:damage)
{
 if(!
is_user_alive(attacker) || !zp_get_user_zombie(attacker))
  return;
 new 
armor fm_get_user_armor(victim);
 if(
armor)
  
client_print(attackerprint_center"Health: %d^tArmor: %d"fm_get_user_health(victim), armor)
 else
  
client_print(attackerprint_center"Health: %d"fm_get_user_health(victim))
}
// Set player's health (from fakemeta_util)
stock fm_get_user_health(id)
{
 return 
pev(idpev_health)
}
stock fm_get_user_armor(id)
{
 return 
pev(idpev_armorvalue)

DSASDFGH is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-26-2011 , 15:05   Re: [ZP] Addon: Show Health, Armor For Zombie
Reply With Quote #5

check if attacker is valid , and use fun.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-26-2011 , 15:20   Re: [ZP] Addon: Show Health, Armor For Zombie
Reply With Quote #6

Quote:
Originally Posted by lucas_7_94 View Post
check if attacker is valid , and use fun.
He already did that ( is_user_alive. )
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
DSASDFGH
Senior Member
Join Date: Jul 2011
Location: Facebook
Old 08-26-2011 , 17:30   Re: [ZP] Addon: Show Health, Armor For Zombie
Reply With Quote #7

Quote:
Originally Posted by lucas_7_94 View Post
and use fun.
why?
__________________
Learning SourceMod is happy
DSASDFGH is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-26-2011 , 23:13   Re: [ZP] Addon: Show Health, Armor For Zombie
Reply With Quote #8

Quote:
Originally Posted by DSASDFGH View Post
why?
First of all, pev_health takes a float value, not an integer.

Second of all, the fun native is faster than the fakemeta
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.

Last edited by lucas_7_94; 08-26-2011 at 23:17.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
chasper
Member
Join Date: Dec 2012
Location: Hungary
Old 08-06-2013 , 05:27   Re: [ZP] Addon: Show Health, Armor For Zombie
Reply With Quote #9

zp 5.0 ?
chasper is offline
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 08-06-2013 , 11:01   Re: [ZP] Addon: Show Health, Armor For Zombie
Reply With Quote #10

Here :-
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <zp50_core>

public plugin_init()
{
    
register_plugin("[ZP] Addon: Show Health, Armor For Zombie""0.1""WPMG Team")
    
RegisterHam(Ham_TakeDamage"player""Player_TakeDamage"1)
}

public 
Player_TakeDamage(victiminflictorattackerFloat:damage)
{
    if(!
is_user_alive(attacker) || !zp_core_is_zombie(attacker))
        return;

    new 
armor get_user_armor(victim);

    if(
armor)
        
client_print(attackerprint_center"Health: %d^tArmor: %d"get_user_health(victim), armor)
    else
        
client_print(attackerprint_center"Health: %d"get_user_health(victim))

__________________
You will find everything u need :-
Catastrophe is offline
Reply


Thread Tools
Display Modes

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 16:00.


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