[saco] Implement/match CPlayerPed::ApplyAnimation(...)

This commit is contained in:
RD42 2024-10-31 19:16:49 +08:00
parent 74e2a5f12a
commit 4c8333f443
2 changed files with 29 additions and 0 deletions

View File

@ -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) {

View File

@ -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();