From 989405a307911f4c04572378b2fb14f34e976ffb Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Thu, 3 Sep 2026 03:22:53 +0700 Subject: [PATCH] [saco] Implement/match `ScrUnk16`; it is the give-weapon RPC and calls `CPlayerPed::GiveWeapon` --- saco/net/scriptrpc.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/saco/net/scriptrpc.cpp b/saco/net/scriptrpc.cpp index cd0340c..7dda999 100644 --- a/saco/net/scriptrpc.cpp +++ b/saco/net/scriptrpc.cpp @@ -316,7 +316,20 @@ void ScrSetPlayerFacingAngle(RPCParameters *rpcParams) pGame->FindPlayerPed()->ForceTargetRotation(fAngle); } -void ScrUnk16(RPCParameters *rpcParams) {} +void ScrUnk16(RPCParameters *rpcParams) +{ + PCHAR Data = reinterpret_cast(rpcParams->input); + int iBitLength = rpcParams->numberOfBitsOfData; + PlayerID sender = rpcParams->sender; + + int iWeapon, iAmmo; + + RakNet::BitStream bsData(Data,(iBitLength/8)+1,false); + bsData.Read(iWeapon); + bsData.Read(iAmmo); + + pNetGame->GetPlayerPool()->GetLocalPlayer()->GetPlayerPed()->GiveWeapon(iWeapon, iAmmo); +} void ScrUnk40(RPCParameters *rpcParams) { PCHAR Data = reinterpret_cast(rpcParams->input);