void CPedRPCs::SetPedAnimationProgress ( CClientEntity* pSource, NetBitStreamInterface& bitStream ) { // Read out the player and vehicle id char szAnimName [ 64 ]; unsigned char ucAnimSize; float fProgress; if ( bitStream.Read ( ucAnimSize ) ) { // Grab the ped CClientPed * pPed = m_pPedManager->Get ( pSource->GetID (), true ); if ( pPed ) { if ( ucAnimSize > 0 ) { if ( bitStream.Read ( szAnimName, ucAnimSize ) ) { szAnimName [ ucAnimSize ] = 0; if ( bitStream.Read ( fProgress ) ) { CAnimBlendAssociation* pA = g_pGame->GetAnimManager ()->RpAnimBlendClumpGetAssociation ( pPed->GetClump (), szAnimName ); if ( pA ) { pA->SetCurrentProgress ( fProgress ); } } } } else { pPed->KillAnimation (); } } } }
void CPedRPCs::SetPedAnimation ( CClientEntity* pSource, NetBitStreamInterface& bitStream ) { // Read out the player and vehicle id char szBlockName [ 64 ], szAnimName [ 64 ]; unsigned char ucBlockSize, ucAnimSize; int iTime; bool bLoop, bUpdatePosition, bInterruptable, bFreezeLastFrame; if ( bitStream.Read ( ucBlockSize ) ) { // Grab the ped CClientPed * pPed = m_pPedManager->Get ( pSource->GetID (), true ); if ( pPed ) { if ( ucBlockSize > 0 ) { if ( bitStream.Read ( szBlockName, ucBlockSize ) && bitStream.Read ( ucAnimSize ) ) { szBlockName [ ucBlockSize ] = 0; if ( bitStream.Read ( szAnimName, ucAnimSize ) && bitStream.Read ( iTime ) && bitStream.ReadBit ( bLoop ) && bitStream.ReadBit ( bUpdatePosition ) && bitStream.ReadBit ( bInterruptable ) && bitStream.ReadBit ( bFreezeLastFrame ) ) { szAnimName [ ucAnimSize ] = 0; CAnimBlock * pBlock = g_pGame->GetAnimManager ()->GetAnimationBlock ( szBlockName ); if ( pBlock ) { pPed->RunNamedAnimation ( pBlock, szAnimName, iTime, bLoop, bUpdatePosition, bInterruptable, bFreezeLastFrame ); } } } } else { pPed->KillAnimation (); } } } }