mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-10 19:53:04 +08:00
[saco] Implement/match ScrUnk56; it is the apply-animation RPC and sets the remote player flag at 0x1C1
This commit is contained in:
+56
-1
@@ -176,7 +176,62 @@ void ScrStopFlashGangZone(RPCParameters *rpcParams)
|
||||
pGangZonePool->StopFlash(wZone);
|
||||
}
|
||||
}
|
||||
void ScrUnk56(RPCParameters *rpcParams) {}
|
||||
void ScrUnk56(RPCParameters *rpcParams)
|
||||
{
|
||||
PCHAR Data = reinterpret_cast<PCHAR>(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) {}
|
||||
|
||||
Reference in New Issue
Block a user