From bcb50d8800221a73fa987b07ff9934d2e5aa7df8 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:52:35 +0800 Subject: [PATCH] [bot] Implement `ScrSetPlayerFacingAngle(...)` --- bot/net/scriptrpc.cpp | 15 +++++++++++---- raknet/SAMPRPC.h | 2 +- saco/net/scriptrpc.cpp | 6 +++--- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/bot/net/scriptrpc.cpp b/bot/net/scriptrpc.cpp index ee8e65b..11c0efa 100644 --- a/bot/net/scriptrpc.cpp +++ b/bot/net/scriptrpc.cpp @@ -174,9 +174,16 @@ void ScrUnk12(RPCParameters *rpcParams) //---------------------------------------------------- -void ScrUnk13(RPCParameters *rpcParams) +void ScrSetPlayerFacingAngle(RPCParameters *rpcParams) { - // TODO: ScrUnk13 + PCHAR Data = reinterpret_cast(rpcParams->input); + int iBitLength = rpcParams->numberOfBitsOfData; + PlayerID sender = rpcParams->sender; + + float fAngle; + RakNet::BitStream bsData(Data,(iBitLength/8)+1,false); + bsData.Read(fAngle); + pNetGame->SetMyZAngle(fAngle); } //---------------------------------------------------- @@ -470,7 +477,7 @@ void RegisterScriptRPCs(RakClientInterface* pRakClient) REGISTER_STATIC_RPC(pRakClient, ScrUnk10); REGISTER_STATIC_RPC(pRakClient, ScrUnk11); REGISTER_STATIC_RPC(pRakClient, ScrUnk12); - REGISTER_STATIC_RPC(pRakClient, ScrUnk13); + REGISTER_STATIC_RPC(pRakClient, ScrSetPlayerFacingAngle); REGISTER_STATIC_RPC(pRakClient, ScrUnk14); REGISTER_STATIC_RPC(pRakClient, ScrUnk15); REGISTER_STATIC_RPC(pRakClient, ScrUnk16); @@ -544,7 +551,7 @@ void UnRegisterScriptRPCs(RakClientInterface* pRakClient) UNREGISTER_STATIC_RPC(pRakClient, ScrUnk10); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk11); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk12); - UNREGISTER_STATIC_RPC(pRakClient, ScrUnk13); + UNREGISTER_STATIC_RPC(pRakClient, ScrSetPlayerFacingAngle); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk14); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk15); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk16); diff --git a/raknet/SAMPRPC.h b/raknet/SAMPRPC.h index 04a1a24..ce68b10 100644 --- a/raknet/SAMPRPC.h +++ b/raknet/SAMPRPC.h @@ -145,7 +145,7 @@ #define RPC_ScrUnk10 "\x10" #define RPC_ScrUnk11 "\x11" #define RPC_ScrUnk12 "\x12" -#define RPC_ScrUnk13 "\x13" +#define RPC_ScrSetPlayerFacingAngle "\x13" #define RPC_ScrUnk14 "\x14" #define RPC_ScrUnk15 "\x15" #define RPC_ScrUnk16 "\x16" diff --git a/saco/net/scriptrpc.cpp b/saco/net/scriptrpc.cpp index 8a17951..9ab8cf4 100644 --- a/saco/net/scriptrpc.cpp +++ b/saco/net/scriptrpc.cpp @@ -72,7 +72,7 @@ void ScrUnk0F(RPCParameters *rpcParams) {} void ScrUnk10(RPCParameters *rpcParams) {} void ScrUnk11(RPCParameters *rpcParams) {} void ScrUnk12(RPCParameters *rpcParams) {} -void ScrUnk13(RPCParameters *rpcParams) {} +void ScrSetPlayerFacingAngle(RPCParameters *rpcParams) {} void ScrUnk14(RPCParameters *rpcParams) {} void ScrUnk15(RPCParameters *rpcParams) {} void ScrUnk16(RPCParameters *rpcParams) {} @@ -172,7 +172,7 @@ void RegisterScriptRPCs(RakClientInterface* pRakClient) REGISTER_STATIC_RPC(pRakClient, ScrUnk10); REGISTER_STATIC_RPC(pRakClient, ScrUnk11); REGISTER_STATIC_RPC(pRakClient, ScrUnk12); - REGISTER_STATIC_RPC(pRakClient, ScrUnk13); + REGISTER_STATIC_RPC(pRakClient, ScrSetPlayerFacingAngle); REGISTER_STATIC_RPC(pRakClient, ScrUnk14); REGISTER_STATIC_RPC(pRakClient, ScrUnk15); REGISTER_STATIC_RPC(pRakClient, ScrUnk16); @@ -280,7 +280,7 @@ void UnRegisterScriptRPCs(RakClientInterface* pRakClient) UNREGISTER_STATIC_RPC(pRakClient, ScrUnk10); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk11); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk12); - UNREGISTER_STATIC_RPC(pRakClient, ScrUnk13); + UNREGISTER_STATIC_RPC(pRakClient, ScrSetPlayerFacingAngle); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk14); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk15); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk16);