Code:
#include <Windows.h>

void CustomPlayerAnimation()
{
	CPlayer* TargetPlayer;

	TargetPlayer->Object->SetCurrAnim(1, 0/*M-wait0*/);
	TargetPlayer->Object->SetCurrAnim(2, 0/*M-wait0*/);
}

class ModelInstance;

class CPlayer
{
public:
	char pad_0000[8]; //0x0000
	ModelInstance* Object; //0x0008
};

class CModel
{
public:
	__int32 GetAnimCount()
	{
		if (!this) return 0;
		return *(__int32*)((uintptr_t)this + 0x006C);
	}

	bool IsValidModelInstance()
	{
		return *(DWORD *)this
			&& (unsigned int)*(unsigned __int16 *)(this + 0x4) < *(DWORD *)(*(DWORD *)this + 0x6C)
			&& (unsigned int)*(unsigned __int16 *)(this + 0xC) < *(DWORD *)(*(DWORD *)this + 0x6C)
			&& (unsigned int)*(unsigned __int16 *)(this + 0x6) < *(DWORD *)(*(DWORD *)(0x20 * *(unsigned __int16 *)(this + 0x4)
				+ *(DWORD *)(*(DWORD *)this + 0x68))
				+ 0xC)
			&& (unsigned int)*(unsigned __int16 *)(this + 0xE) < *(DWORD *)(*(DWORD *)(0x20
				* *(unsigned __int16 *)(this + 0xC)
				+ *(DWORD *)(*(DWORD *)this + 0x68))
				+ 0xC)
			&& *(float *)(this + 0x14) >= 0.0
			&& *(float *)(this + 0x14) <= 1.0;
	}
};

class CModelAnimation
{
public:
	BYTE& off_0070()
	{
		return *(BYTE*)((uintptr_t)this + 0x0070);
	}

	unsigned __int8 TrackerID()
	{
		return *(unsigned __int8*)((uintptr_t)this + 0x0038);
	}

	char SetCurrAnimFn(unsigned int AnimID, char a3)
	{
		if (!this) return 0;

		int v4; // ecx
		int v5; // eax

		CModel* Model = (CModel*)this->GetModel();
		if (!Model) return 0;

		if (!(*(WORD *)((uintptr_t)this + 0x14) & 8) && AnimID >= Model->GetAnimCount())
			return 0;
		v4 = *(DWORD *)((uintptr_t)this + 0x2C);
		*(DWORD *)((uintptr_t)this + 0x20) = *(DWORD *)((uintptr_t)this + 0x28);
		*(DWORD *)((uintptr_t)this + 0x24) = v4;
		*(float *)((uintptr_t)this + 0x30) = 0.0;
		*(WORD *)((uintptr_t)this + 0x28) = AnimID;
		*(DWORD *)((uintptr_t)this + 0x10) = 0;
		*(WORD *)((uintptr_t)this + 0x2A) = 0;
		*(DWORD *)((uintptr_t)this + 0x2C) = 0;

		/*if (a3 && Model->IsValidModelInstance())
		{
			*(WORD *)((uintptr_t)this + 0x16) = 0;
		}
		else
		{
			*(WORD *)((uintptr_t)this + 0x16) = -1;
			v5 = *(DWORD *)((uintptr_t)this + 0x2C);
			*(DWORD *)((uintptr_t)this + 0x20) = *(DWORD *)((uintptr_t)this + 0x28);
			*(DWORD *)((uintptr_t)this + 0x24) = v5;
		}*/
		return 1;
	}

	CModel* GetModel()
	{
		if (!this) return NULL;
		return *(CModel**)((uintptr_t)this + 0x001C);
	}
};

class CAnimation : public CModelAnimation
{
public:
	CModelAnimation* GetModelAnimation(unsigned __int8 TrackerID)
	{
		if (!this || TrackerID == 255)
			return 0;

		for (int i = (DWORD)this; i; i = *(DWORD*)(i + 0x0004))
		{
			if (!((CModelAnimation*)i) || i == 0)
				return 0;
			if (((CModelAnimation*)i)->TrackerID() == TrackerID)
				return (CModelAnimation*)i;
		}

		return 0;
	}
};

class ModelInstance
{
public:
	void SetCurrAnim(unsigned __int8 TrackerID, unsigned int AnimID)
	{
		if (!this) return;

		CAnimation* Animation = (CAnimation*)this->GetAnimation();
		if (!Animation) return;

		CModelAnimation* ModelAnimation = (CModelAnimation*)Animation->GetModelAnimation(TrackerID);
		if (!ModelAnimation) return;

		if (ModelAnimation->SetCurrAnimFn(AnimID, 1))
		{
			ModelAnimation->off_0070() = 1;
		}
	}
};