[saco] Implement/match ScrResetPlayerWeapons(...)

This commit is contained in:
RD42 2024-10-16 17:39:25 +08:00
parent f1f9db0395
commit 5d75ee8a66
3 changed files with 17 additions and 4 deletions

View File

@ -146,8 +146,8 @@
#define RPC_ScrUnk11 "\x11" #define RPC_ScrUnk11 "\x11"
#define RPC_ScrUnk12 "\x12" #define RPC_ScrUnk12 "\x12"
#define RPC_ScrSetPlayerFacingAngle "\x13" #define RPC_ScrSetPlayerFacingAngle "\x13"
#define RPC_ScrUnk15 "\x15"
#define RPC_ScrResetMoney "\x14" #define RPC_ScrResetMoney "\x14"
#define RPC_ScrResetPlayerWeapons "\x15"
#define RPC_ScrUnk16 "\x16" #define RPC_ScrUnk16 "\x16"
#define RPC_ScrUnk40 "\x40" #define RPC_ScrUnk40 "\x40"
#define RPC_ScrUnk41 "\x41" #define RPC_ScrUnk41 "\x41"

View File

@ -92,6 +92,8 @@ public:
void ResetAllSyncAttributes(); void ResetAllSyncAttributes();
CPlayerPed * GetPlayerPed() { return m_pPlayerPed; };
void Say(PCHAR szText); void Say(PCHAR szText);
BOOL IsSpectating() { return m_bIsSpectating; }; BOOL IsSpectating() { return m_bIsSpectating; };

View File

@ -75,7 +75,6 @@ void ScrUnk10(RPCParameters *rpcParams) {}
void ScrUnk11(RPCParameters *rpcParams) {} void ScrUnk11(RPCParameters *rpcParams) {}
void ScrUnk12(RPCParameters *rpcParams) {} void ScrUnk12(RPCParameters *rpcParams) {}
void ScrSetPlayerFacingAngle(RPCParameters *rpcParams) {} void ScrSetPlayerFacingAngle(RPCParameters *rpcParams) {}
void ScrUnk15(RPCParameters *rpcParams) {}
void ScrUnk16(RPCParameters *rpcParams) {} void ScrUnk16(RPCParameters *rpcParams) {}
void ScrUnk40(RPCParameters *rpcParams) {} void ScrUnk40(RPCParameters *rpcParams) {}
void ScrUnk41(RPCParameters *rpcParams) {} void ScrUnk41(RPCParameters *rpcParams) {}
@ -198,6 +197,18 @@ void ScrResetMoney(RPCParameters *rpcParams)
//---------------------------------------------------- //----------------------------------------------------
void ScrResetPlayerWeapons(RPCParameters *rpcParams)
{
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
int iBitLength = rpcParams->numberOfBitsOfData;
PlayerID sender = rpcParams->sender;
CPlayerPed *pPlayerPed = pNetGame->GetPlayerPool()->GetLocalPlayer()->GetPlayerPed();
pPlayerPed->ClearAllWeapons();
}
//----------------------------------------------------
void ScrForceSpawnSelection(RPCParameters *rpcParams) void ScrForceSpawnSelection(RPCParameters *rpcParams)
{ {
pNetGame->GetPlayerPool()->GetLocalPlayer()->ReturnToClassSelection(); pNetGame->GetPlayerPool()->GetLocalPlayer()->ReturnToClassSelection();
@ -274,8 +285,8 @@ void RegisterScriptRPCs(RakClientInterface* pRakClient)
REGISTER_STATIC_RPC(pRakClient, ScrUnk11); REGISTER_STATIC_RPC(pRakClient, ScrUnk11);
REGISTER_STATIC_RPC(pRakClient, ScrUnk12); REGISTER_STATIC_RPC(pRakClient, ScrUnk12);
REGISTER_STATIC_RPC(pRakClient, ScrSetPlayerFacingAngle); REGISTER_STATIC_RPC(pRakClient, ScrSetPlayerFacingAngle);
REGISTER_STATIC_RPC(pRakClient, ScrUnk15);
REGISTER_STATIC_RPC(pRakClient, ScrResetMoney); REGISTER_STATIC_RPC(pRakClient, ScrResetMoney);
REGISTER_STATIC_RPC(pRakClient, ScrResetPlayerWeapons);
REGISTER_STATIC_RPC(pRakClient, ScrUnk16); REGISTER_STATIC_RPC(pRakClient, ScrUnk16);
REGISTER_STATIC_RPC(pRakClient, ScrUnk40); REGISTER_STATIC_RPC(pRakClient, ScrUnk40);
REGISTER_STATIC_RPC(pRakClient, ScrUnk41); REGISTER_STATIC_RPC(pRakClient, ScrUnk41);
@ -382,8 +393,8 @@ void UnRegisterScriptRPCs(RakClientInterface* pRakClient)
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk11); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk11);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk12); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk12);
UNREGISTER_STATIC_RPC(pRakClient, ScrSetPlayerFacingAngle); UNREGISTER_STATIC_RPC(pRakClient, ScrSetPlayerFacingAngle);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk15);
UNREGISTER_STATIC_RPC(pRakClient, ScrResetMoney); UNREGISTER_STATIC_RPC(pRakClient, ScrResetMoney);
UNREGISTER_STATIC_RPC(pRakClient, ScrResetPlayerWeapons);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk16); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk16);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk40); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk40);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk41); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk41);