Raised This Month: $ Target: $400
 0% 

L4D2 Common Infected / Horde Counting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Scuzzy
Senior Member
Join Date: Oct 2007
Old 12-22-2013 , 14:11   L4D2 Common Infected / Horde Counting
Reply With Quote #1

I've been looking high and low for a way to count the number of common infected in l4d2, preferably as they spawn. Does anyone know of a way/plugin/event that'll do this? (or point me in the right direction...)

Thanks,
Scuzzy
Scuzzy is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 12-22-2013 , 14:15   Re: L4D2 Common Infected / Horde Counting
Reply With Quote #2

PHP Code:
GetCommonCount()
{
    new 
commonInf 0;
    
decl String:nameType[64];
    for ( new 
i=MaxClients+1i<=GetEntityCount(); i++ )
    {
        if ( !
IsValidEntity)) continue;
        
        
GetEntityClassnameinameTypesizeofnameType ));
        if ( 
StrContainsnameType"infected"false) != -)
        {
            
commonInf++;
        }
    }
    return 
commonInf;

__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 12-22-2013 at 14:16.
GsiX is offline
Scuzzy
Senior Member
Join Date: Oct 2007
Old 12-22-2013 , 16:30   Re: L4D2 Common Infected / Horde Counting
Reply With Quote #3

Very cool, is there a way to detect when these specific entities are loaded?

Edit: found OnEntityCreated, thanks!

Last edited by Scuzzy; 12-22-2013 at 16:36.
Scuzzy is offline
Reply



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 14:15.


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