PHP Code:
#include <sourcemod>
public void OnMapStart()
{
CreateTimer(1.0, Timer_DisplayHealth, TIMER_REPEAT);
}
public Action Timer_DisplayHealth(Handle:timer)
{
for (int entity = 1; entity <= MaxClients; entity++)
{
if (!IsValidEntity(entity))
continue;
if (GetClassname(entity) == "func_breakable")
{
int health = GetEntProp(entity, Prop_Data, "m_iHealth", 0, 0);
int maxHealth = GetEntProp(entity, Prop_Data, "m_iMaxHealth", 0, 0);
if (health >= 0 && maxHealth >= 0)
{
ShowHealthInfoToClient(entity, health, maxHealth);
}
}
}
return Plugin_Continue;
}
public Action ShowHealthInfoToClient(int client, int health, int maxHealth)
{
PrintToChat(client, "Prop health: %d / %d", health, maxHealth);
return Plugin_Continue;
}
The plugin displayed the amount of HP for breaking objects in the game such as doors and barricades, but on the new version 3.2.7 it no longer works, what’s wrong and what’s the matter?
the plugin displayed the amount of remaining HP for objects in the game like func_breakable and physical props, something like show damage only for collapsing obje.