本文整理汇总了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;
}
示例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;
}
示例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;
}