View Single Post
101
Member
Join Date: Nov 2023
Old 01-26-2024 , 14:30   Re: Plugin not compile [ZPS]
Reply With Quote #17

Quote:
Originally Posted by ORdli View Post
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 
GetEventInt(event,"entindex");
    if ( !
IsFakeClient(P) &&  h_timer[P] ==null )
    {
        
h_timer[P]=CreateTimer(Timer_Refresh ,Timer_DisplayHealthTIMER_REPEAT);
    }
}

public 
Action Timer_DisplayHealth(Handle Timer,any P)
{
    
int Eye_Target GetClientAimTarget(Pfalse);
    
    switch ( 
Eye_Target)
    {
        case -
: return Plugin_Continue;
        case -
SetFailState("This Function Is Not Supported");
    }
    
    
int Health GetEntProp(Eye_TargetProp_Data"m_iHealth");

    if ( 
Health>)
    {
        
PrintHintText("Health[ %d ]" Health);
    }
    return 
Plugin_Continue;
}

public 
OnClientDisconnect(P)
{
    if (
h_timer[P]!=null)
        
delete h_timer[P];


Last edited by 101; 01-26-2024 at 14:32.
101 is offline