View Single Post
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 01-23-2024 , 12:29   Re: Plugin not compile [ZPS]
Reply With Quote #7

Quote:
Originally Posted by 101 View Post
This will print a hint message when a human aims at a breakable entity (I guess So).
I think this would be a better option
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sdktools_functions>

bool bShow;

public 
void OnMapStart()
{
    
CreateTimer(1.0Timer_HP_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);

    
HookEvent("round_start"Event_RoundEventHookMode_PostNoCopy);
    
HookEvent("round_end"Event_RoundEventHookMode_PostNoCopy);
}

public 
void Event_Round(Event event, const char[] namebool dontBroadcast)
{
    
bShow name[6] == 's';
}

public 
Action Timer_HP(Handle timer)
{
    if(!
bShow)
        return 
Plugin_Continue;

    static 
char cls[16];
    for(
int i 1aim<= MaxClientsi++)
        if(
IsClientInGame(i) && !IsFakeClient(i) && IsPlayerAlive(i) && (aim GetClientAimTarget(ifalse)) > MaxClients
        
&& GetEntityClassname(aimclssizeof(cls)) && !strncmp(cls"func_breakable"14false))
            
PrintHintText("Health [ %d / %d ]"GetEntProp(aimProp_Data"m_iHealth"), GetEntProp(aimProp_Data"m_iMaxHealth"));

    return 
Plugin_Continue;

__________________
Grey83 is offline