AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Subplugin Submission [ZP] Addon: Show Health, Armor For Zombie (https://forums.alliedmods.net/showthread.php?t=158982)

fl0werD 06-11-2011 10:54

[ZP] Addon: Show Health, Armor For Zombie
 
3 Attachment(s)
[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:
Attachment 87257
If no armor:
Attachment 87258


.Dare Devil. 06-12-2011 09:41

Re: [ZP] Addon: Show Health, Armor For Zombie
 
is that working no error logs ?

bibu 06-12-2011 11:43

Re: [ZP] Addon: Show Health, Armor For Zombie
 
You should check if the attacker is a player.

DSASDFGH 08-26-2011 10:11

Re: [ZP] Addon: Show Health, Armor For Zombie
 
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)



lucas_7_94 08-26-2011 15:05

Re: [ZP] Addon: Show Health, Armor For Zombie
 
check if attacker is valid , and use fun.

abdul-rehman 08-26-2011 15:20

Re: [ZP] Addon: Show Health, Armor For Zombie
 
Quote:

Originally Posted by lucas_7_94 (Post 1541557)
check if attacker is valid , and use fun.

He already did that ( is_user_alive. )

DSASDFGH 08-26-2011 17:30

Re: [ZP] Addon: Show Health, Armor For Zombie
 
Quote:

Originally Posted by lucas_7_94 (Post 1541557)
and use fun.

why?

lucas_7_94 08-26-2011 23:13

Re: [ZP] Addon: Show Health, Armor For Zombie
 
Quote:

Originally Posted by DSASDFGH (Post 1541665)
why?

First of all, pev_health takes a float value, not an integer.

Second of all, the fun native is faster than the fakemeta

chasper 08-06-2013 05:27

Re: [ZP] Addon: Show Health, Armor For Zombie
 
zp 5.0 ?

Catastrophe 08-06-2013 11:01

Re: [ZP] Addon: Show Health, Armor For Zombie
 
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))




All times are GMT -4. The time now is 16:00.

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