void CPedSA::SetCurrentRotation(FLOAT fRotation) { GetPedInterface ()->fCurrentRotation = fRotation; // char szDebug[255] = {'\0'}; // sprintf(szDebug,"CurrentRotate Offset: %d", ((DWORD)&((CPedSAInterface *)this->GetInterface())->CurrentRotate) - (DWORD)this->GetInterface()); // OutputDebugString(szDebug); }
void CPedSA::SetModelIndex(DWORD dwModelIndex) { DEBUG_TRACE("void CPedSA::SetModelIndex ( DWORD dwModelIndex )"); DWORD dwFunction = FUNC_SetModelIndex; DWORD dwThis = (DWORD)this->GetInterface(); _asm { mov ecx, dwThis push dwModelIndex call dwFunction } // Also set the voice gender CPedModelInfoSAInterface* pModelInfo = (CPedModelInfoSAInterface*)pGame->GetModelInfo(dwModelIndex)->GetInterface(); if (pModelInfo) { DWORD dwType = pModelInfo->pedType; GetPedInterface()->pedSound.m_bIsFemale = (dwType == 5 || dwType == 22); } }
void CPedSA::Init() { DEBUG_TRACE("void CPedSA::Init()"); CPedSAInterface * pedInterface = GetPedInterface (); DWORD dwPedIntelligence = 0; DWORD dwFunc = 0x411DE0; DWORD dwInterface = (DWORD)pedInterface; _asm { mov ecx, dwInterface call dwFunc mov dwPedIntelligence, eax } CPedIntelligenceSAInterface * m_pPedIntelligenceInterface = (CPedIntelligenceSAInterface *)(dwPedIntelligence); this->m_pPedIntelligence = new CPedIntelligenceSA(m_pPedIntelligenceInterface, this); this->m_pPedSound = new CPedSoundSA ( &pedInterface->pedSound ); for ( int i = 0; i < WEAPONSLOT_MAX; i++ ) this->m_pWeapons[i] = new CWeaponSA(&(pedInterface->Weapons[i]), this, (eWeaponSlot)i); //this->m_pPedIK = new Cm_pPedIKSA(&(pedInterface->m_pPedIK)); }
eWeaponSlot CPedSA::GetCurrentWeaponSlot () { return (eWeaponSlot) GetPedInterface ()->bCurrentWeaponSlot; }
void CPedSA::SetTargetRotation(FLOAT fRotation) { GetPedInterface ()->fTargetRotation = fRotation; }
FLOAT CPedSA::GetTargetRotation() { return GetPedInterface ()->fTargetRotation; }
FLOAT CPedSA::GetCurrentRotation() { return GetPedInterface ()->fCurrentRotation; }
void CPedSA::SetOxygenLevel ( float fOxygen ) { GetPedInterface ()->pPlayerData->m_fBreath = fOxygen; }
float CPedSA::GetOxygenLevel ( void ) { return GetPedInterface ()->pPlayerData->m_fBreath; }
void CPedSA::SetArmor ( float fArmor ) { GetPedInterface ()->fArmor = fArmor; }
float CPedSA::GetArmor ( void ) { return GetPedInterface ()->fArmor; }
void CPedSA::SetHealth ( float fHealth ) { GetPedInterface ()->fHealth = fHealth; }
FLOAT CPedSA::GetHealth() { return GetPedInterface ()->fHealth; }