From ae6110aa78ec5f8dd68b04f047771359954d199c Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Thu, 3 Sep 2026 04:12:19 +0700 Subject: [PATCH] [saco] Implement/match `ScrUnk56`; it is the apply-animation RPC and sets the remote player flag at 0x1C1 --- saco/net/scriptrpc.cpp | 57 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/saco/net/scriptrpc.cpp b/saco/net/scriptrpc.cpp index 7b2c91e..cf0fad4 100644 --- a/saco/net/scriptrpc.cpp +++ b/saco/net/scriptrpc.cpp @@ -176,7 +176,62 @@ void ScrStopFlashGangZone(RPCParameters *rpcParams) pGangZonePool->StopFlash(wZone); } } -void ScrUnk56(RPCParameters *rpcParams) {} +void ScrUnk56(RPCParameters *rpcParams) +{ + PCHAR Data = reinterpret_cast(rpcParams->input); + int iBitLength = rpcParams->numberOfBitsOfData; + PlayerID sender = rpcParams->sender; + + PLAYERID playerId; + BYTE byteAnimFileLen; + BYTE byteAnimNameLen; + char szAnimFile[256]; + char szAnimName[256]; + float fT; + bool bUnk1, bUnk2, bUnk3, bUnk4; + int iUnk; + CPlayerPed *pPlayerPed; + + RakNet::BitStream bsData(Data,(iBitLength/8)+1,false); + + memset(szAnimFile, 0, sizeof(szAnimFile)); + memset(szAnimName, 0, sizeof(szAnimName)); + + bsData.Read(playerId); + bsData.Read(byteAnimFileLen); + bsData.Read(szAnimFile, byteAnimFileLen); + bsData.Read(byteAnimNameLen); + bsData.Read(szAnimName, byteAnimNameLen); + bsData.Read(fT); + bsData.Read(bUnk1); + bsData.Read(bUnk2); + bsData.Read(bUnk4); + bsData.Read(bUnk3); + bsData.Read(iUnk); + + szAnimFile[byteAnimFileLen] = 0; + szAnimName[byteAnimNameLen] = 0; + + CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool(); + if(!pPlayerPool) return; + + if(playerId == pPlayerPool->GetLocalPlayerID()) { + pPlayerPed = pPlayerPool->GetLocalPlayer()->GetPlayerPed(); + } else { + if(playerId >= MAX_PLAYERS) return; + if(!pPlayerPool->field_2A[playerId]) return; + CNetPlayer *pNetPlayer = pPlayerPool->m_pPlayers[playerId]; + if(!pNetPlayer) return; + CRemotePlayer *pRemotePlayer = pNetPlayer->m_pRemotePlayer; + if(!pRemotePlayer) return; + pPlayerPed = pRemotePlayer->m_pPlayerPed; + pRemotePlayer->field_1C1 = 1; + } + + if(!pPlayerPed) return; + + pPlayerPed->ApplyAnimation(szAnimName, szAnimFile, fT, bUnk1, bUnk2, bUnk4, bUnk3, iUnk); +} void ScrUnk57(RPCParameters *rpcParams) {} void ScrUnk58(RPCParameters *rpcParams) {} void ScrUnk59(RPCParameters *rpcParams) {}