|
Member
|
05-04-2024
, 13:31
Re: Show zombie hp
|
#12
|
Quote:
Originally Posted by deadackerman
When dealing damage to a zombie, it does not show its HP. How can it be fixed?
screen: https://ibb.co/dt40HfP
meta lists:
PHP Code:
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5294 ini Start ANY
[ 2] Reunion RUN - reunion_mm.dll v0.1.92d ini Start Never
[ 3] Revoice RUN - revoice_mm.dll v0.1.0.34 ini Start Never
[ 4] POD-Bot mm RUN - podbot_mm.dll v3.0B18c ini Chlvl ANY
[ 5] SafeNameAndChat RUN - safenameandchat.dll v1.2 Beta 3 ini ANY ANY
[ 6] MySQL RUN - mysql_amxx.dll v1.9.0.5294 pl1 ANY ANY
[ 7] SQLite RUN - sqlite_amxx.dll v1.9.0.5294 pl1 ANY ANY
[ 8] Fun RUN - fun_amxx.dll v1.9.0.5294 pl1 ANY ANY
[ 9] Engine RUN - engine_amxx.dll v1.9.0.5294 pl1 ANY ANY
[10] FakeMeta RUN - fakemeta_amxx.dll v1.9.0.5294 pl1 ANY ANY
[11] CStrike RUN - cstrike_amxx.dll v1.9.0.5294 pl1 ANY ANY
[12] CSX RUN - csx_amxx.dll v1.9.0.5294 pl1 ANY ANY
[13] Ham Sandwich RUN - hamsandwich_amxx.dll v1.9.0.5294 pl1 ANY ANY
[14] ReAPI RUN - reapi_amxx.dll v5.24.0.300-dev pl1 ANY Never
code:
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_VERSION, PLUGIN_AUTHOR)
RegisterHam(Ham_TakeDamage, "player", "fw_Player_TakeDamage_Post", 1)
g_iMaxPlayers = get_maxplayers()
}
public client_putinserver(iId) g_bIsConnected[iId] = true
public client_disconnected(iId) g_bIsConnected[iId] = false
public fw_Player_TakeDamage_Post(iVictim, iInflictor, iAttacker, Float:flDamage, iDamageType)
{
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(iAttacker, print_center, "You did %.1f Damage. Health: %d", flDamage, iVictimHealth)
#else
client_print(iAttacker, print_center, "Health: %d", iVictimHealth)
#endif
else
client_print(iAttacker, print_center, "You Killed him")
return HAM_HANDLED
}
return HAM_IGNORED
}
|
https://dev-cs.ru/resources/1289/
|
|
|
|