diff --git a/raknet/SAMPRPC.h b/raknet/SAMPRPC.h index 244ae7e..e3dc6ec 100644 --- a/raknet/SAMPRPC.h +++ b/raknet/SAMPRPC.h @@ -120,8 +120,8 @@ #define RPC_ScrUnk5B "\x5B" #define RPC_ScrUnk6F "\x6F" #define RPC_ScrUnk62 "\x62" -#define RPC_ScrUnk5C "\x5C" #define RPC_ScrUnk96 "\x96" +#define RPC_ScrSetPlayerDrunkVisuals "\x5C" #define RPC_ScrUnk70 "\x70" #define RPC_ScrSetSpawnInfo "\x44" #define RPC_ScrUnk45 "\x45" diff --git a/saco/game/scripting.h b/saco/game/scripting.h index d12610d..f5f6a5f 100644 --- a/saco/game/scripting.h +++ b/saco/game/scripting.h @@ -109,6 +109,9 @@ const SCRIPT_COMMAND set_panel_row_enable = { 0x08D9, "iii" }; const SCRIPT_COMMAND get_panel_active_row = { 0x08D7, "iv" }; +const SCRIPT_COMMAND set_player_drunk_visuals = { 0x052c, "ii" }; // player, severity (0-255) + +// --- const SCRIPT_COMMAND restore_camera_to_user_defined = { 0x925, "" }; const SCRIPT_COMMAND set_camera_position_to = { 0x936, "ffffffii" }; diff --git a/saco/net/scriptrpc.cpp b/saco/net/scriptrpc.cpp index a68047d..d4403c1 100644 --- a/saco/net/scriptrpc.cpp +++ b/saco/net/scriptrpc.cpp @@ -52,7 +52,6 @@ void ScrUnk5A(RPCParameters *rpcParams) {} void ScrUnk5B(RPCParameters *rpcParams) {} void ScrUnk6F(RPCParameters *rpcParams) {} void ScrUnk62(RPCParameters *rpcParams) {} -void ScrUnk5C(RPCParameters *rpcParams) {} void ScrUnk96(RPCParameters *rpcParams) {} void ScrUnk70(RPCParameters *rpcParams) {} void ScrSetSpawnInfo(RPCParameters *rpcParams) {} @@ -228,6 +227,23 @@ void ScrEnableStuntBonus(RPCParameters *rpcParams) //---------------------------------------------------- +void ScrSetPlayerDrunkVisuals(RPCParameters* rpcParams) +{ + PCHAR Data = reinterpret_cast(rpcParams->input); + int iBitLength = rpcParams->numberOfBitsOfData; + RakNet::BitStream bsData(Data,(iBitLength/8)+1,false); + + int iVisuals; + bsData.Read(iVisuals); + + CPlayerPed* pPlayer = pGame->FindPlayerPed(); + if (pPlayer) { + ScriptCommand(&set_player_drunk_visuals, 0, iVisuals); + } +} + +//---------------------------------------------------- + void RegisterScriptRPCs(RakClientInterface* pRakClient) { REGISTER_STATIC_RPC(pRakClient, ScrUnkA7); @@ -271,8 +287,8 @@ void RegisterScriptRPCs(RakClientInterface* pRakClient) REGISTER_STATIC_RPC(pRakClient, ScrUnk5B); REGISTER_STATIC_RPC(pRakClient, ScrUnk6F); REGISTER_STATIC_RPC(pRakClient, ScrUnk62); - REGISTER_STATIC_RPC(pRakClient, ScrUnk5C); REGISTER_STATIC_RPC(pRakClient, ScrUnk96); + REGISTER_STATIC_RPC(pRakClient, ScrSetPlayerDrunkVisuals); REGISTER_STATIC_RPC(pRakClient, ScrUnk70); REGISTER_STATIC_RPC(pRakClient, ScrSetSpawnInfo); REGISTER_STATIC_RPC(pRakClient, ScrUnk45); @@ -351,8 +367,8 @@ void UnRegisterScriptRPCs(RakClientInterface* pRakClient) UNREGISTER_STATIC_RPC(pRakClient, ScrUnk5B); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk6F); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk62); - UNREGISTER_STATIC_RPC(pRakClient, ScrUnk5C); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk96); + UNREGISTER_STATIC_RPC(pRakClient, ScrSetPlayerDrunkVisuals); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk70); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk38); UNREGISTER_STATIC_RPC(pRakClient, ScrUnk90);