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


C++ CContextData::GetPlayerPed方法代码示例

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


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

示例1: GetLocalPlayerPed

IVPlayerPed * GetLocalPlayerPed()
{
    // Default to the local player ped (If available)
    IVPlayerInfo * pPlayerInfo = g_pCore->GetGame()->GetPools()->GetPlayerInfoFromIndex(0);

    if (pPlayerInfo)
        _pPlayerPed = pPlayerInfo->m_pPlayerPed;
    else
        _pPlayerPed = NULL;

    // Is the local player id valid?
    if (g_pCore->GetGame()->GetPools()->GetLocalPlayerIndex() != -1)
    {
        // Is the player index not the local player?
        if (g_pCore->GetGame()->GetPools()->GetLocalPlayerIndex() != 0)
        {
            // Get the context info for the player index
            CContextData * pContextInfo = CContextDataManager::GetContextData((BYTE) g_pCore->GetGame()->GetPools()->GetLocalPlayerIndex());

            // Is the context info valid?
            if (pContextInfo)
            {
                // Set the player ped to the remote player
                _pPlayerPed = pContextInfo->GetPlayerPed()->GetPlayerPed();
            }
        }
    }

    return _pPlayerPed;
}
开发者ID:B2O,项目名称:IV-Network,代码行数:30,代码来源:CHooks.cpp

示例2:

CContextData * CContextDataManager::GetContextData(IVPlayerPed * pPlayerPed)
{
	// Loop through the context info list
	for(std::list<CContextData *>::iterator iter = m_contextDataList.begin(); iter != m_contextDataList.end(); iter++)
	{
		// Get the context info pointer
		CContextData * pContextInfo = *iter;

		// Is this the context info we are looking for?
		if(pContextInfo->GetPlayerPed()->GetPlayerPed() == pPlayerPed)
			return pContextInfo;
	}

	return NULL;
}
开发者ID:guilhermelhr,项目名称:ivmultiplayer,代码行数:15,代码来源:CContextDataManager.cpp

示例3:

CContextData * CContextDataManager::GetContextData(IVPlayerPed * pPlayerPed)
{
	// Loop through the context data list
	for(std::list<CContextData *>::iterator iter = m_contextDataList.begin(); iter != m_contextDataList.end(); iter++)
	{
		// Get the context data
		CContextData * pContextData = *iter;

		// Is this the context data we're looking for?
		if(pContextData->GetPlayerPed()->GetPlayerPed() == pPlayerPed)
		{
			return pContextData;
		}
	}

	return nullptr;
}
开发者ID:ALArmagost,项目名称:IV-Network,代码行数:17,代码来源:CContextData.cpp


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