diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index 968bf95..721d1e1 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -1092,6 +1092,32 @@ void CPlayerPed::SetMoney(int iAmount) //----------------------------------------------------------- +void CPlayerPed::ApplyAnimation( char *szAnimName, char *szAnimFile, float fT, + int opt1, int opt2, int opt3, int opt4, int iUnk ) +{ + int iWaitAnimLoad=0; + + if(!m_pPed) return; + if(!GamePool_Ped_GetAt(m_dwGTAId)) return; + + // Can't allow 'naughty' anims! + if( !stricmp(szAnimFile,"SEX") ) + return; + + if (!pGame->IsAnimationLoaded(szAnimFile)) { + pGame->RequestAnimation(szAnimFile); + while(!pGame->IsAnimationLoaded(szAnimFile)) { + Sleep(1); + iWaitAnimLoad++; + if(iWaitAnimLoad == 15) return; // we can't wait forever + } + } + + ScriptCommand(&apply_animation,m_dwGTAId,szAnimName,szAnimFile,fT,opt1,opt2,opt3,opt4,iUnk); +} + +//----------------------------------------------------------- + float CPlayerPed::GetAimZ() { if(m_pPed) { diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 9c8c8f2..f0634e3 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -92,6 +92,9 @@ public: void SetAnimationSet(PCHAR szAnim); void SetMoney(int iAmount); + void ApplyAnimation(char *szAnimName, char *szAnimFile, float fT, + int opt1, int opt2, int opt3, int opt4, int iUnk); + CPlayerPed();