diff --git a/saco/net/remoteplayer.cpp b/saco/net/remoteplayer.cpp index 77489b1..4e91c88 100644 --- a/saco/net/remoteplayer.cpp +++ b/saco/net/remoteplayer.cpp @@ -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); + } + } +} + +//---------------------------------------------------- + diff --git a/saco/net/remoteplayer.h b/saco/net/remoteplayer.h index ceb3f5f..9e9f9f8 100644 --- a/saco/net/remoteplayer.h +++ b/saco/net/remoteplayer.h @@ -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); }; //----------------------------------------------------