AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [L4D2]IsThirdPerson bools (https://forums.alliedmods.net/showthread.php?t=299072)

Lux 07-01-2017 16:47

[L4D2]IsThirdPerson bools
 
Hello, i should of done this a while ago but here are my 2 bools that i use to detect when a client is thirdperson.


PHP Code:

static bool:IsSurvivorThirdPerson(iClient)
{
    if(
GetEntPropEnt(iClientProp_Send"m_hViewEntity") > 0)
        return 
true;
    if(
GetEntPropFloat(iClientProp_Send"m_TimeForceExternalView") > GetGameTime())
        return 
true;
    if(
GetEntProp(iClientProp_Send"m_iObserverMode") == 1)
        return 
true;
    if(
GetEntPropEnt(iClientProp_Send"m_pummelAttacker") > 0)
        return 
true;
    if(
GetEntPropEnt(iClientProp_Send"m_carryAttacker") > 0)
        return 
true;
    if(
GetEntPropEnt(iClientProp_Send"m_pounceAttacker") > 0)
        return 
true;
    if(
GetEntPropEnt(iClientProp_Send"m_jockeyAttacker") > 0)
        return 
true;
    if(
GetEntProp(iClientProp_Send"m_isHangingFromLedge") > 0)
        return 
true;
    if(
GetEntPropEnt(iClientProp_Send"m_reviveTarget") > 0)
        return 
true;
    if(
GetEntPropFloat(iClientProp_Send"m_staggerTimer"1) > -1.0)
        return 
true;
    switch(
GetEntProp(iClientProp_Send"m_iCurrentUseAction"))
    {
        case 
1:
        {
            static 
iTarget;
            
iTarget GetEntPropEnt(iClientProp_Send"m_useActionTarget");
            
            if(
iTarget == GetEntPropEnt(iClientProp_Send"m_useActionOwner"))
                return 
true;
            else if(
iTarget != iClient)
                return 
true;
        }
        case 
4678910:
        return 
true;
    }
    
    static 
String:sModel[31];
    
GetEntPropString(iClientProp_Data"m_ModelName"sModelsizeof(sModel));
    
    switch(
sModel[29])
    {
        case 
'b'://nick
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
626625624623622621661662664665666667668670671672673674620680616:
                return 
true;
            }
        }
        case 
'd'://rochelle
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
674678679630631632633634668677681680676675673672671670687629625616:
                return 
true;
            }
        }
        case 
'c'://coach
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
656622623624625626663662661660659658657654653652651621620669615:
                return 
true;
            }
        }
        case 
'h'://ellis
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
625675626627628629630631678677676575674673672671670669668667666665684621:
                return 
true;
            }
        }
        case 
'v'://bill
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
528759763764529530531532533534753676675761758757756755754527772762522:
                return 
true;
            }
        }
        case 
'n'://zoey
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
537819823824538539540541542543813828825822821820818817816815814536809572:
                return 
true;
            }
        }
        case 
'e'://francis
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
532533534535536537769768767766765764763762761760759758757756531530775525:
                return 
true;
            }
        }
        case 
'a'://louis
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
529530531532533534766765764763762761760759758757756755754753527772528522:
                return 
true;
            }
        }
        case 
'w'://adawong
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
674678679630631632633634668677681680676675673672671670687629625:
                return 
true;
            }
        }
    }
    
    return 
false;



PHP Code:

static bool:IsInfectedThirdPerson(iClient)
{
    if(
GetEntPropFloat(iClientProp_Send"m_TimeForceExternalView") > GetGameTime())
        return 
true;
    if(
GetEntPropFloat(iClientProp_Send"m_staggerTimer"1) > -1.0)
        return 
true;
    
    switch(
GetEntProp(iClientProp_Send"m_zombieClass"))
    {
        case 
1://smoker
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
30313236373839:
                return 
true;
            }
        }
        case 
2://boomer
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
30313233:
                return 
true;
            }
        }
        case 
3://hunter
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
3839404142434546474849:
                return 
true;
            }
        }
        case 
4://spitter
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
17181920:
                return 
true;
            }
        }
        case 
5://jockey
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
15161718:
                return 
true;
            }
        }
        case 
6://charger
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
5272829313233343539404142:
                return 
true;
            }
        }
        case 
8://tank
        
{
            switch(
GetEntProp(iClientProp_Send"m_nSequence"))
            {
                case 
2829303149505173747576 ,77:
                return 
true;
            }
        }
    }
    
    return 
false;


If you have any improvments please let me know.


All times are GMT -4. The time now is 18:54.

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