mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +08:00
[saco] Implement/match CPlayerPed::EnterVehicle(...)
This commit is contained in:
parent
aacad6daf2
commit
0a7fc0799b
@ -24,6 +24,9 @@ DWORD dwFarClipReturnAddr=0;
|
||||
// used generically
|
||||
PED_TYPE *_pPlayer;
|
||||
|
||||
BOOL bIgnoreNextEntry=FALSE;
|
||||
BOOL bIgnoreNextExit=FALSE;
|
||||
|
||||
BYTE byteSavedCameraMode;
|
||||
DWORD dwCurPlayerActor=0;
|
||||
BYTE *pbyteCameraMode = (BYTE *)0xB6F1A8;
|
||||
|
@ -11,6 +11,9 @@
|
||||
#include "task.h"
|
||||
|
||||
extern CGame *pGame;
|
||||
extern CNetGame *pNetGame;
|
||||
extern BOOL bIgnoreNextEntry;
|
||||
extern BOOL bIgnoreNextExit;
|
||||
|
||||
extern BYTE *pbyteCurrentPlayer;
|
||||
|
||||
@ -836,6 +839,30 @@ void CPlayerPed::PutDirectlyInVehicle(int iVehicleID, int iSeat)
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CPlayerPed::EnterVehicle(int iVehicleID, BOOL bPassenger)
|
||||
{
|
||||
if(!m_pPed) return;
|
||||
VEHICLE_TYPE *ThisVehicleType;
|
||||
if((ThisVehicleType = GamePool_Vehicle_GetAt(iVehicleID)) == NULL) return;
|
||||
if(!GamePool_Ped_GetAt(m_dwGTAId)) return;
|
||||
|
||||
bIgnoreNextEntry = TRUE;
|
||||
|
||||
if(GetCurrentWeapon() == WEAPON_PARACHUTE) {
|
||||
SetArmedWeapon(0);
|
||||
}
|
||||
|
||||
if(bPassenger) {
|
||||
if(ThisVehicleType->entity.nModelIndex == TRAIN_PASSENGER && (m_pPed == GamePool_FindPlayerPed())) {
|
||||
ScriptCommand(&put_actor_in_car2,m_dwGTAId,iVehicleID,-1);
|
||||
} else {
|
||||
ScriptCommand(&send_actor_to_car_passenger,m_dwGTAId,iVehicleID,3000,-1);
|
||||
}
|
||||
} else {
|
||||
ScriptCommand(&send_actor_to_car_driverseat,m_dwGTAId,iVehicleID,3000);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Forceful removal
|
||||
|
||||
|
@ -67,6 +67,7 @@ public:
|
||||
void SetImmunities(BOOL bBullet, BOOL bFire, BOOL bExplosion, BOOL bDamage, BOOL bUnknown);
|
||||
|
||||
void PutDirectlyInVehicle(int iVehicleID, int iSeat);
|
||||
void EnterVehicle(int iVehicleID, BOOL bPassenger);
|
||||
void RemoveFromVehicleAndPutAt(float fX, float fY, float fZ);
|
||||
|
||||
BOOL IsAPassenger();
|
||||
|
@ -77,6 +77,9 @@ const SCRIPT_COMMAND set_actor_can_be_decapitated = { 0x0446, "ii" };
|
||||
const SCRIPT_COMMAND play_sound = { 0x018c, "fffi" };
|
||||
|
||||
const SCRIPT_COMMAND remove_actor_from_car_and_put_at = { 0x0362, "ifff" };
|
||||
const SCRIPT_COMMAND send_actor_to_car_driverseat = { 0x05CB, "iii" };
|
||||
const SCRIPT_COMMAND send_actor_to_car_passenger = { 0x05CA, "iiii" };
|
||||
|
||||
const SCRIPT_COMMAND enable_train_traffic = { 0x06d7, "i" };
|
||||
|
||||
const SCRIPT_COMMAND lock_car = { 0x0519, "ii" };
|
||||
|
Loading…
Reference in New Issue
Block a user