From 5dfb0771386eae835d438b8cb06ee747f51ff28a Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:11:51 +0800 Subject: [PATCH] [saco] Implement/match `ScrEnableStuntBonus(...)` --- raknet/SAMPRPC.h | 2 +- saco/net/scriptrpc.cpp | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/raknet/SAMPRPC.h b/raknet/SAMPRPC.h index 7377405..244ae7e 100644 --- a/raknet/SAMPRPC.h +++ b/raknet/SAMPRPC.h @@ -114,7 +114,7 @@ #define RPC_ScrUnk56 "\x56" #define RPC_ScrUnk57 "\x57" #define RPC_ScrUnk58 "\x58" -#define RPC_ScrUnk68 "\x68" +#define RPC_ScrEnableStuntBonus "\x68" #define RPC_ScrUnk59 "\x59" #define RPC_ScrUnk5A "\x5A" #define RPC_ScrUnk5B "\x5B" diff --git a/saco/net/scriptrpc.cpp b/saco/net/scriptrpc.cpp index a7bf0b9..a68047d 100644 --- a/saco/net/scriptrpc.cpp +++ b/saco/net/scriptrpc.cpp @@ -47,7 +47,6 @@ void ScrStopFlashGangZone(RPCParameters *rpcParams) {} void ScrUnk56(RPCParameters *rpcParams) {} void ScrUnk57(RPCParameters *rpcParams) {} void ScrUnk58(RPCParameters *rpcParams) {} -void ScrUnk68(RPCParameters *rpcParams) {} void ScrUnk59(RPCParameters *rpcParams) {} void ScrUnk5A(RPCParameters *rpcParams) {} void ScrUnk5B(RPCParameters *rpcParams) {} @@ -216,6 +215,19 @@ void ScrForceSpawnSelection(RPCParameters *rpcParams) //---------------------------------------------------- +void ScrEnableStuntBonus(RPCParameters *rpcParams) +{ + PCHAR Data = reinterpret_cast(rpcParams->input); + int iBitLength = rpcParams->numberOfBitsOfData; + RakNet::BitStream bsData(Data,(iBitLength/8)+1,false); + + bool bStuntBonusEnabled; + bsData.Read(bStuntBonusEnabled); + pGame->EnableStuntBonus(bStuntBonusEnabled); +} + +//---------------------------------------------------- + void RegisterScriptRPCs(RakClientInterface* pRakClient) { REGISTER_STATIC_RPC(pRakClient, ScrUnkA7); @@ -253,7 +265,7 @@ void RegisterScriptRPCs(RakClientInterface* pRakClient) REGISTER_STATIC_RPC(pRakClient, ScrUnk56); REGISTER_STATIC_RPC(pRakClient, ScrUnk57); REGISTER_STATIC_RPC(pRakClient, ScrUnk58); - REGISTER_STATIC_RPC(pRakClient, ScrUnk68); + REGISTER_STATIC_RPC(pRakClient, ScrEnableStuntBonus); REGISTER_STATIC_RPC(pRakClient, ScrUnk59); REGISTER_STATIC_RPC(pRakClient, ScrUnk5A); REGISTER_STATIC_RPC(pRakClient, ScrUnk5B); @@ -333,7 +345,7 @@ void UnRegisterScriptRPCs(RakClientInterface* pRakClient) UNREGISTER_STATIC_RPC(pRakClient, ScrUnk56); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk57); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk58); - UNREGISTER_STATIC_RPC(pRakClient, ScrUnk68); + UNREGISTER_STATIC_RPC(pRakClient, ScrEnableStuntBonus); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk59); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk5A); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk5B);