[saco] Implement/match CRemotePlayer::EnterVehicle(...)

This commit is contained in:
RD42 2024-10-31 17:31:36 +08:00
parent 63d04d6639
commit 9b91485a8a
2 changed files with 21 additions and 2 deletions

View File

@ -14,7 +14,7 @@ CRemotePlayer::CRemotePlayer()
field_1E7 = 0;
field_10A = 0;
m_PlayerID = INVALID_PLAYER_ID;
field_1DD = 0;
m_pPlayerPed = NULL;
field_1B8 = 0;
field_109 = -1;
field_4 = 1;
@ -83,3 +83,20 @@ DWORD CRemotePlayer::GetPlayerColorAsARGB()
}
//----------------------------------------------------
void CRemotePlayer::EnterVehicle(VEHICLEID VehicleID, BOOL bPassenger)
{
CVehiclePool *pVehiclePool = pNetGame->GetVehiclePool();
CVehicle *pVehicle = pVehiclePool->GetAt(VehicleID);
if(m_pPlayerPed && pVehicle && !m_pPlayerPed->IsInVehicle()) {
int iGtaVehicleID = pVehiclePool->FindGtaIDFromID(VehicleID);
if(iGtaVehicleID && iGtaVehicleID != INVALID_VEHICLE_ID) {
m_pPlayerPed->SetKeys(0,0,0);
m_pPlayerPed->EnterVehicle(iGtaVehicleID,bPassenger);
}
}
}
//----------------------------------------------------

View File

@ -41,7 +41,7 @@ private:
char field_1C9[12];
DWORD field_1D5;
DWORD field_1D9;
int field_1DD;
CPlayerPed *m_pPlayerPed;
int field_1E1;
PLAYERID m_PlayerID;
short field_1E7;
@ -60,6 +60,8 @@ public:
void SetPlayerColor(DWORD dwColor);
DWORD GetPlayerColorAsRGBA();
DWORD GetPlayerColorAsARGB();
void EnterVehicle(VEHICLEID VehicleID, BOOL bPassenger);
};
//----------------------------------------------------