Quote:
Originally Posted by ORdli
I tested both plugins, the first from 101 works, but the amount of HP is not shown correctly, and not on all objects, it skips prop_physic
|
That because u requested a script to only show the breakable shit , try this: ( if u want some additional details) then reply .
PHP Code:
#include <sdktools_functions>
#define Timer_Refresh 1.0
new Handle:h_timer[MAXPLAYERS+1];
public OnPluginStart()
{
HookEvent("player_spawn",E_P_S);
}
public E_P_S(Handle:event, const String:name[], bool:Broadcast)
{
new P = GetEventInt(event,"entindex");
if ( !IsFakeClient(P) && h_timer[P] ==null )
{
h_timer[P]=CreateTimer(Timer_Refresh ,Timer_DisplayHealth, P , TIMER_REPEAT);
}
}
public Action Timer_DisplayHealth(Handle Timer,any P)
{
int Eye_Target = GetClientAimTarget(P, false);
switch ( Eye_Target)
{
case -1 : return Plugin_Continue;
case -2 : SetFailState("This Function Is Not Supported");
}
int Health = GetEntProp(Eye_Target, Prop_Data, "m_iHealth");
if ( Health>1 )
{
PrintHintText(P , "Health[ %d ]" , Health);
}
return Plugin_Continue;
}
public OnClientDisconnect(P)
{
if (h_timer[P]!=null)
delete h_timer[P];
}