Raised This Month: $ Target: $400
 0% 

[Solved]Force spectator's m_hObserverTarget


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 06-16-2014 , 11:10   Re: [Orpheu] Force spectator's m_hObserverTarget
Reply With Quote #8

Quote:
Originally Posted by hornet View Post
Another method is with CBasePlayer::Observer_CheckTarget(). You can use the checkteam param.
What are you talking about?
PHP Code:
void CBasePlayer::Observer_CheckTarget()
{
    if( 
pev->iuser1 == OBS_ROAMING )
        return;

    
// try to find a traget if we have no current one
    
if ( m_hObserverTarget == NULL)
    {
        
Observer_FindNextPlayerfalseNULL );

        if (
m_hObserverTarget == NULL)
        {
            
// no target found at all 

            
int lastMode pev->iuser1;

            
Observer_SetModeOBS_ROAMING );

            
m_iObserverLastMode lastMode;    // don't overwrite users lastmode

            
return;    // we still have np target return
        
}
    }

    
CBasePlayertarget = (CBasePlayer*)(UTIL_PlayerByIndexENTINDEX(m_hObserverTarget->edict())));

    if ( !
target )
    {
        
Observer_FindNextPlayerfalseNULL );
        return;
    }

    
// check taget
    
if (target->pev->deadflag == DEAD_DEAD)
    {
        if ( (
target->m_fDeadTime 2.0f ) < gpGlobals->time )
        {
            
// 3 secs after death change target
            
Observer_FindNextPlayerfalseNULL );
            return;
        }
    }

SpeeDeeR is offline
 



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


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