mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-03 16:13:34 +08:00
[saco] Implement/match CPlayerPed::GetDistanceFromVehicle(...)
* Add CVehicle constructor stub
This commit is contained in:
parent
db28736d81
commit
2c418701fd
@ -438,6 +438,23 @@ BOOL CPlayerPed::HasAmmoForCurrentWeapon()
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
//-----------------------------------------------------------
|
||||
|
||||
float CPlayerPed::GetDistanceFromVehicle(CVehicle *pVehicle)
|
||||
{
|
||||
MATRIX4X4 matFromPlayer;
|
||||
MATRIX4X4 matThis;
|
||||
float fSX,fSY,fSZ;
|
||||
|
||||
GetMatrix(&matThis);
|
||||
pVehicle->GetMatrix(&matFromPlayer);
|
||||
|
||||
fSX = (matThis.pos.X - matFromPlayer.pos.X) * (matThis.pos.X - matFromPlayer.pos.X);
|
||||
fSY = (matThis.pos.Y - matFromPlayer.pos.Y) * (matThis.pos.Y - matFromPlayer.pos.Y);
|
||||
fSZ = (matThis.pos.Z - matFromPlayer.pos.Z) * (matThis.pos.Z - matFromPlayer.pos.Z);
|
||||
|
||||
return (float)sqrt(fSX + fSY + fSZ);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
|
@ -59,6 +59,8 @@ public:
|
||||
|
||||
VEHICLE_TYPE * GetGtaVehicle();
|
||||
|
||||
float GetDistanceFromVehicle(CVehicle *pVehicle);
|
||||
|
||||
void StartJetpack();
|
||||
void StopJetpack();
|
||||
BOOL IsInJetpackMode();
|
||||
|
15
saco/game/vehicle.cpp
Normal file
15
saco/game/vehicle.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
#include "../main.h"
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// CONSTRUCTOR
|
||||
|
||||
CVehicle::CVehicle(int iType, float fPosX, float fPosY,
|
||||
float fPosZ, float fRotation, BOOL bKeepModelLoaded,
|
||||
int a8)
|
||||
{
|
||||
// TODO: CVehicle::CVehicle
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
17
saco/game/vehicle.h
Normal file
17
saco/game/vehicle.h
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "game.h"
|
||||
#include "entity.h"
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
class CVehicle : public CEntity
|
||||
{
|
||||
public:
|
||||
|
||||
CVehicle( int iType, float fPosX, float fPosY, float fPosZ, float fRotation = 0.0f, BOOL bKeepModelLoaded = FALSE, int a8 = 0);
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------
|
Loading…
x
Reference in New Issue
Block a user