当前位置: 首页>>代码示例>>C++>>正文


C++ CClientPlayer::SetPlayerVoice方法代码示例

本文整理汇总了C++中CClientPlayer::SetPlayerVoice方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientPlayer::SetPlayerVoice方法的具体用法?C++ CClientPlayer::SetPlayerVoice怎么用?C++ CClientPlayer::SetPlayerVoice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CClientPlayer的用法示例。


在下文中一共展示了CClientPlayer::SetPlayerVoice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ClassInit

CClientPlayer::CClientPlayer ( CClientManager* pManager, ElementID ID, bool bIsLocalPlayer ) : ClassInit ( this ), CClientPed ( pManager, 0, ID, bIsLocalPlayer )
{
    // Initialize
    m_pManager = pManager;
    m_bIsLocalPlayer = bIsLocalPlayer;

    SetTypeName ( "player" );

    m_bNametagColorOverridden = false;
    m_uiPing = 0;

    m_usLatency = 0;

    m_uiPlayerSyncCount = 0;
    m_uiKeySyncCount = 0;
    m_uiVehicleSyncCount = 0;

    m_ulLastPuresyncTime = 0;
    m_bHasConnectionTrouble = false;    

    m_bForce = false;
    m_bDoExtrapolatingAim = false;

    m_bNetworkDead = false;

    m_voice = NULL;

    // If it's the local player, add the model
    if ( m_bIsLocalPlayer )
    {
        // Set us as the local player in the player manager
        if ( !pManager->GetPlayerManager ()->GetLocalPlayer () )
        {
            pManager->GetPlayerManager ()->SetLocalPlayer ( this );
        }

        CClientPlayer * pLocalPlayer = this;
        // Enable voice playback for local player
        if ( pLocalPlayer->GetVoice() == NULL )
        {
            //If voice is enabled
            CClientPlayerVoice * pVoice = new CClientPlayerVoice ( this, g_pClientGame->GetVoiceRecorder() );
            pLocalPlayer->SetPlayerVoice ( pVoice );
        }
    }
    else
    {
        // Enable weapon processing for players
        m_remoteDataStorage->SetProcessPlayerWeapon ( true );

        // Enable voice playback for remote players
        if ( g_pClientGame->GetVoiceRecorder()->IsEnabled() ) //If voice is enabled
            m_voice = new CClientPlayerVoice ( this, g_pClientGame->GetVoiceRecorder() );
    }

    // Set all our default stats
    m_pTeam = NULL;

    m_bNametagShowing = true;
    m_ucNametagColorR = 255;
    m_ucNametagColorG = 255;
    m_ucNametagColorB = 255;
    m_ulLastNametagShow = 0;
    SetNametagText ( m_strNick );

    // Add us to the player list
    m_pManager->GetPlayerManager ()->AddToList ( this );

#ifdef MTA_DEBUG
    m_bShowingWepdata = false;
#endif
    m_LastPuresyncType = PURESYNC_TYPE_NONE;
}
开发者ID:Anubhav652,项目名称:mtasa-blue,代码行数:73,代码来源:CClientPlayer.cpp


注:本文中的CClientPlayer::SetPlayerVoice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。