mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-10 11:43:04 +08:00
[server] Implement/match CPlayer::ToggleCheckpoint(...)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
extern CNetGame *pNetGame;
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
void CPlayer::Say(unsigned char * szText, BYTE byteTextLen)
|
||||
@@ -17,3 +19,33 @@ void CPlayer::SetSpawnInfo(PLAYER_SPAWN_INFO *pSpawn)
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
void CPlayer::ToggleCheckpoint(BOOL bEnabled)
|
||||
{
|
||||
m_bCheckpointEnabled = bEnabled;
|
||||
m_bInCheckpoint = FALSE;
|
||||
|
||||
RakNet::BitStream bsParams;
|
||||
|
||||
if (bEnabled)
|
||||
{
|
||||
bsParams.Write(m_vecCheckpoint.X);
|
||||
bsParams.Write(m_vecCheckpoint.Y);
|
||||
bsParams.Write(m_vecCheckpoint.Z);
|
||||
bsParams.Write(m_fCheckpointSize);
|
||||
pNetGame->SendToPlayer(RPC_SetCheckpoint, &bsParams, m_PlayerID, 2);
|
||||
} else {
|
||||
pNetGame->SendToPlayer(RPC_DisableCheckpoint, &bsParams, m_PlayerID, 2);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user