View Single Post
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 03-26-2023 , 12:49   Re: [L4D2] About "IsClientInGame()"
Reply With Quote #7

PHP Code:
#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart()
{
#if DEBUG
    
HookEvent("weapon_fire"Event_Weapon_Fire);
#endif
}

public 
void Event_Weapon_Fire(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    if(
client && !IsFakeClient(client)) CheckStatus();
}

stock void CheckStatus()
{
    
float buffer;
    for(
int i 1healthcount<= MaxClientsi++) if(IsClientInGame(i) && GetClientTeam(i) == 2)
    {
        
health GetEntProp(iProp_Send"m_iHealth");
        
buffer GetTempHealth(i);
        
count GetEntProp(iProp_Send"m_currentReviveCount");

        
PrintToChatAll("%N#HP:%d, TEMP:%f, REV:%d,"ihealthbuffercount);
        
PrintToServer("%N#HP:%d, TEMP:%f, REV:%d,"ihealthbuffercount);
    }

__________________

Last edited by Grey83; 03-26-2023 at 12:53.
Grey83 is offline