diff --git a/raknet/SAMPRPC.h b/raknet/SAMPRPC.h index e69d856..7377405 100644 --- a/raknet/SAMPRPC.h +++ b/raknet/SAMPRPC.h @@ -146,8 +146,8 @@ #define RPC_ScrUnk11 "\x11" #define RPC_ScrUnk12 "\x12" #define RPC_ScrSetPlayerFacingAngle "\x13" -#define RPC_ScrUnk15 "\x15" #define RPC_ScrResetMoney "\x14" +#define RPC_ScrResetPlayerWeapons "\x15" #define RPC_ScrUnk16 "\x16" #define RPC_ScrUnk40 "\x40" #define RPC_ScrUnk41 "\x41" diff --git a/saco/net/localplayer.h b/saco/net/localplayer.h index 607fc9b..4afceec 100644 --- a/saco/net/localplayer.h +++ b/saco/net/localplayer.h @@ -92,6 +92,8 @@ public: void ResetAllSyncAttributes(); + CPlayerPed * GetPlayerPed() { return m_pPlayerPed; }; + void Say(PCHAR szText); BOOL IsSpectating() { return m_bIsSpectating; }; diff --git a/saco/net/scriptrpc.cpp b/saco/net/scriptrpc.cpp index 3da6604..a7bf0b9 100644 --- a/saco/net/scriptrpc.cpp +++ b/saco/net/scriptrpc.cpp @@ -75,7 +75,6 @@ void ScrUnk10(RPCParameters *rpcParams) {} void ScrUnk11(RPCParameters *rpcParams) {} void ScrUnk12(RPCParameters *rpcParams) {} void ScrSetPlayerFacingAngle(RPCParameters *rpcParams) {} -void ScrUnk15(RPCParameters *rpcParams) {} void ScrUnk16(RPCParameters *rpcParams) {} void ScrUnk40(RPCParameters *rpcParams) {} void ScrUnk41(RPCParameters *rpcParams) {} @@ -198,6 +197,18 @@ void ScrResetMoney(RPCParameters *rpcParams) //---------------------------------------------------- +void ScrResetPlayerWeapons(RPCParameters *rpcParams) +{ + PCHAR Data = reinterpret_cast(rpcParams->input); + int iBitLength = rpcParams->numberOfBitsOfData; + PlayerID sender = rpcParams->sender; + + CPlayerPed *pPlayerPed = pNetGame->GetPlayerPool()->GetLocalPlayer()->GetPlayerPed(); + pPlayerPed->ClearAllWeapons(); +} + +//---------------------------------------------------- + void ScrForceSpawnSelection(RPCParameters *rpcParams) { pNetGame->GetPlayerPool()->GetLocalPlayer()->ReturnToClassSelection(); @@ -274,8 +285,8 @@ void RegisterScriptRPCs(RakClientInterface* pRakClient) REGISTER_STATIC_RPC(pRakClient, ScrUnk11); REGISTER_STATIC_RPC(pRakClient, ScrUnk12); REGISTER_STATIC_RPC(pRakClient, ScrSetPlayerFacingAngle); - REGISTER_STATIC_RPC(pRakClient, ScrUnk15); REGISTER_STATIC_RPC(pRakClient, ScrResetMoney); + REGISTER_STATIC_RPC(pRakClient, ScrResetPlayerWeapons); REGISTER_STATIC_RPC(pRakClient, ScrUnk16); REGISTER_STATIC_RPC(pRakClient, ScrUnk40); REGISTER_STATIC_RPC(pRakClient, ScrUnk41); @@ -382,8 +393,8 @@ void UnRegisterScriptRPCs(RakClientInterface* pRakClient) UNREGISTER_STATIC_RPC(pRakClient, ScrUnk11); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk12); UNREGISTER_STATIC_RPC(pRakClient, ScrSetPlayerFacingAngle); - UNREGISTER_STATIC_RPC(pRakClient, ScrUnk15); UNREGISTER_STATIC_RPC(pRakClient, ScrResetMoney); + UNREGISTER_STATIC_RPC(pRakClient, ScrResetPlayerWeapons); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk16); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk40); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk41);