Raised This Month: $ Target: $400
 0% 

How to know that an entity is a common infected is alive?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
chu1720
Senior Member
Join Date: Mar 2010
Location: Hong Kong
Old 07-21-2010 , 06:21   How to know that an entity is a common infected is alive?
Reply With Quote #1

Thanks for helping~~~
chu1720 is offline
Send a message via MSN to chu1720
Damizean
SourceMod Donor
Join Date: Mar 2009
Old 07-21-2010 , 08:33   Re: How to know that an entity is a common infected is alive?
Reply With Quote #2

PHP Code:
stock bool:IsCommonInfected(iEntity)
{
    if (
iEntity && IsValidEntity(iEntity)
    {
        
decl String:strClassName[64];
        
GetEdictClassName(iEntitystrClassNamesizeof(strClassName));
        return 
StrEqual(strClassName"infected");
    }
    return 
false;
}

stock GetEntityLifeState(iEntity)
{
    return 
GetEntProp(iEntityProp_Data"m_lifeState");

The first one should let you know if an entity is a common infected. The second should return the entity's life state, wich should tell you if it's alive or not. I don't know the exact values it should have, you'll have to find out that by yourself.
__________________
Dat annoying guy
Damizean is offline
Send a message via AIM to Damizean Send a message via MSN to Damizean
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 21:55.


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