Raised This Month: $ Target: $400
 0% 

[L4D2] About "IsClientInGame()"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Iciaria
Member
Join Date: Aug 2022
Old 03-26-2023 , 11:11   Re: [L4D2] About "IsClientInGame()"
Reply With Quote #6

that should be right
PHP Code:
public void OnPluginStart()
{
#if DEBUG
        
HookEvent("weapon_fire"Event_Weapon_Fire);            
#endif
}
void Event_Weapon_Fire(Event event, const char[] namebool dontBroadcast)
{
        
int client GetClientOfUserId(event.GetInt("userid"));
        if(!
IsFakeClient(client))
        {
                
CheckStatus();
        }
}
void CheckStatus()
{
        for(
int i =1i<=MaxClientsi++)
        {
                if(!
IsClientInGame(i) )
                        continue;
                if(
GetClientTeam(i) == 2)
                {       
                        
char name[64];
                        
GetClientName(inamesizeof(name) );
                        
int health GetEntProp(iProp_Send"m_iHealth");
                        
float buffer GetTempHealth(i);
                        
int count GetEntProp(iProp_Send"m_currentReviveCount");
                        
PrintToChatAll("%s#HP:%d, TEMP:%f, REV:%d,"namehealthbuffercount);
                        
PrintToServer("%s#HP:%d, TEMP:%f, REV:%d,"namehealthbuffercount);
                }
        }


Code:
L 03/24/2023 - 19:59:23: [SM] Blaming: test.smx
L 03/24/2023 - 19:59:23: [SM] Call stack trace:
L 03/24/2023 - 19:59:23: [SM]   [0] Event.GetInt
L 03/24/2023 - 19:59:23: [SM]   [1] Line 90, test.sp::Event_Weapon_Fire
Sorry I seem to have forgotten to paste a lot of important stuff
, the problem is only because of "return;"
Anyway thanks.
__________________
Sorry,my english not good
Iciaria is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode