本文整理汇总了C++中CWeapon::GetInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CWeapon::GetInfo方法的具体用法?C++ CWeapon::GetInfo怎么用?C++ CWeapon::GetInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWeapon
的用法示例。
在下文中一共展示了CWeapon::GetInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SetCurrentWeaponSlot
void CPedSA::SetCurrentWeaponSlot ( eWeaponSlot weaponSlot )
{
if ( weaponSlot < WEAPONSLOT_MAX )
{
eWeaponSlot currentSlot = GetCurrentWeaponSlot ();
if ( weaponSlot != GetCurrentWeaponSlot () )
{
CWeapon * pWeapon = GetWeapon ( currentSlot );
if ( pWeapon ) RemoveWeaponModel ( pWeapon->GetInfo ( WEAPONSKILL_STD )->GetModel () );
CPedSAInterface * thisPed = (CPedSAInterface *)this->GetInterface();
// set the new weapon slot
thisPed->bCurrentWeaponSlot = weaponSlot;
// is the player the local player?
CPed * pPed = pGame->GetPools()->GetPedFromRef ( (DWORD)1 );
//if ( pPed == this && thisPed->pPlayerInfo )
//{
DWORD dwThis = (DWORD)this->GetInterface();
if ( pPed == this )
{
((CPlayerInfoSA *)pGame->GetPlayerInfo())->GetInterface()->PlayerPedData.m_nChosenWeapon = weaponSlot;
DWORD dwFunc = FUNC_MakeChangesForNewWeapon_Slot;
_asm
{
mov ecx, dwThis
push weaponSlot
call dwFunc
}
}
开发者ID:ntauthority,项目名称:openvice,代码行数:33,代码来源:CPedSA.cpp示例2: DrawFromAim
void CNametags::DrawFromAim ( void )
{
unsigned long ulCurrentTime = CClientTime::GetTime ();
// Got any players that are not local?
if ( m_pPlayerManager->Count () > 1 )
{
// Grab the local player
CClientPlayer* pLocalPlayer = m_pPlayerManager->GetLocalPlayer ();
if ( pLocalPlayer )
{
// Grab the current time and the camera
unsigned long ulCurrentTime = CClientTime::GetTime ();
CCamera* pCamera = g_pGame->GetCamera ();
// Grab our controller state
CControllerState State;
g_pGame->GetPad ()->GetCurrentControllerState ( &State );
// Grab our current weapon slot. Use screen center if melee or none
CVector vecStart;
CVector vecTarget;
eWeaponSlot eSlot = pLocalPlayer->GetCurrentWeaponSlot ();
if ( eSlot == WEAPONSLOT_TYPE_UNARMED ||
eSlot == WEAPONSLOT_TYPE_MELEE ||
eSlot == WEAPONSLOT_TYPE_RIFLE ||
eSlot == WEAPONSLOT_TYPE_THROWN ||
eSlot == WEAPONSLOT_TYPE_SPECIAL ||
eSlot == WEAPONSLOT_TYPE_GIFT ||
eSlot == WEAPONSLOT_TYPE_PARACHUTE ||
eSlot == WEAPONSLOT_TYPE_DETONATOR )
{
// Grab the active cam
CCamera* pCamera = g_pGame->GetCamera ();
CCam* pActive = pCamera->GetCam ( pCamera->GetActiveCam () );
// Grab the camera matrix
CMatrix matCamera;
pCamera->GetMatrix ( &matCamera );
vecStart = matCamera.vPos;
// Range
float fRange;
if ( eSlot == WEAPONSLOT_TYPE_RIFLE && State.RightShoulder1 )
{
fRange = SNIPER_AIM_VISIBLE_RANGE;
}
else
{
fRange = MELEE_VISIBLE_RANGE;
}
// Find the target position
CVector vecFront = *pActive->GetFront ();
vecFront.Normalize ();
vecTarget = *pActive->GetSource () + vecFront * fRange;
}
else
{
// Grab the weapon and keysync state. If it exists and he holds Target down
CWeapon* pPlayerWeapon = pLocalPlayer->GetWeapon ();
if ( pPlayerWeapon && State.RightShoulder1 )
{
// Grab the gun muzzle position
CWeaponInfo* pCurrentWeaponInfo = pPlayerWeapon->GetInfo ();
CVector vecGunMuzzle = *pCurrentWeaponInfo->GetFireOffset ();
pLocalPlayer->GetTransformedBonePosition ( BONE_RIGHTWRIST, vecGunMuzzle );
// Grab the target point
pCamera->Find3rdPersonCamTargetVector ( AIM_VISIBLE_RANGE, &vecGunMuzzle, &vecStart, &vecTarget );
}
else
{
// Grab the active cam
CCam* pActive = pCamera->GetCam ( pCamera->GetActiveCam () );
// Grab the camera matrix
CMatrix matCamera;
pCamera->GetMatrix ( &matCamera );
vecStart = matCamera.vPos;
// Find the target position
CVector vecFront = *pActive->GetFront ();
vecFront.Normalize ();
vecTarget = *pActive->GetSource () + vecFront * MELEE_VISIBLE_RANGE;
}
}
// Ignore the local player for this
pLocalPlayer->WorldIgnore ( true );
// Do the raycast
CColPoint* pColPoint = NULL;
CEntity* pEntity = NULL;
g_pGame->GetWorld ()->ProcessLineOfSight ( &vecStart, &vecTarget, &pColPoint, &pEntity, true, true, true, true, true, true, false, true );
if ( pColPoint ) pColPoint->Destroy ();
// Un-ignore the local player
pLocalPlayer->WorldIgnore ( false );
//.........这里部分代码省略.........
开发者ID:AdiBoy,项目名称:multitheftauto,代码行数:101,代码来源:CNametags.cpp本文标签属性:
示例:示例英语
代码:代码编程
CWeapon:CWeapon
GetInfo:getinfo什么意思