mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +08:00
[saco] Implement/match ScrSetPlayerHealth(...)
This commit is contained in:
parent
694b02e99a
commit
1ff45278eb
@ -129,7 +129,7 @@
|
||||
#define RPC_ScrSetPlayerName "\x0B"
|
||||
#define RPC_ScrSetPlayerPos "\x0C"
|
||||
#define RPC_ScrUnk0D "\x0D"
|
||||
#define RPC_ScrUnk0E "\x0E"
|
||||
#define RPC_ScrSetPlayerHealth "\x0E"
|
||||
#define RPC_ScrPutPlayerInVehicle "\x46"
|
||||
#define RPC_ScrRemovePlayerFromVehicle "\x47"
|
||||
#define RPC_ScrSetPlayerColor "\x48"
|
||||
|
@ -58,7 +58,6 @@ void ScrUnk45(RPCParameters *rpcParams) {}
|
||||
void ScrUnk99(RPCParameters *rpcParams) {}
|
||||
void ScrSetPlayerPos(RPCParameters *rpcParams) {}
|
||||
void ScrUnk0D(RPCParameters *rpcParams) {}
|
||||
void ScrUnk0E(RPCParameters *rpcParams) {}
|
||||
void ScrPutPlayerInVehicle(RPCParameters *rpcParams) {}
|
||||
void ScrRemovePlayerFromVehicle(RPCParameters *rpcParams) {}
|
||||
void ScrSetPlayerColor(RPCParameters *rpcParams) {}
|
||||
@ -135,6 +134,23 @@ void ScrSetPlayerName(RPCParameters *rpcParams)
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
void ScrSetPlayerHealth(RPCParameters *rpcParams)
|
||||
{
|
||||
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
|
||||
int iBitLength = rpcParams->numberOfBitsOfData;
|
||||
PlayerID sender = rpcParams->sender;
|
||||
|
||||
CLocalPlayer *pLocalPlayer = pNetGame->GetPlayerPool()->GetLocalPlayer();
|
||||
float fHealth;
|
||||
|
||||
RakNet::BitStream bsData(Data,(iBitLength/8)+1,false);
|
||||
bsData.Read(fHealth);
|
||||
|
||||
pLocalPlayer->GetPlayerPed()->SetHealth(fHealth);
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
void ScrSetCameraPos(RPCParameters *rpcParams)
|
||||
{
|
||||
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
|
||||
@ -312,7 +328,7 @@ void RegisterScriptRPCs(RakClientInterface* pRakClient)
|
||||
REGISTER_STATIC_RPC(pRakClient, ScrSetPlayerName);
|
||||
REGISTER_STATIC_RPC(pRakClient, ScrSetPlayerPos);
|
||||
REGISTER_STATIC_RPC(pRakClient, ScrUnk0D);
|
||||
REGISTER_STATIC_RPC(pRakClient, ScrUnk0E);
|
||||
REGISTER_STATIC_RPC(pRakClient, ScrSetPlayerHealth);
|
||||
REGISTER_STATIC_RPC(pRakClient, ScrPutPlayerInVehicle);
|
||||
REGISTER_STATIC_RPC(pRakClient, ScrRemovePlayerFromVehicle);
|
||||
REGISTER_STATIC_RPC(pRakClient, ScrSetPlayerColor);
|
||||
@ -420,7 +436,7 @@ void UnRegisterScriptRPCs(RakClientInterface* pRakClient)
|
||||
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk99);
|
||||
UNREGISTER_STATIC_RPC(pRakClient, ScrSetPlayerPos);
|
||||
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk0D);
|
||||
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk0E);
|
||||
UNREGISTER_STATIC_RPC(pRakClient, ScrSetPlayerHealth);
|
||||
UNREGISTER_STATIC_RPC(pRakClient, ScrPutPlayerInVehicle);
|
||||
UNREGISTER_STATIC_RPC(pRakClient, ScrRemovePlayerFromVehicle);
|
||||
UNREGISTER_STATIC_RPC(pRakClient, ScrSetPlayerColor);
|
||||
|
Loading…
Reference in New Issue
Block a user