コード例 #1
0
ファイル: subclass.cpp プロジェクト: LBRGeorge/jmnvc
static void Fix(void)
{
	CPlayerPed* pLocalPlayer = pGame->FindPlayerPed();
	if (pLocalPlayer->IsInVehicle())
	{
		CVehiclePool* pVehiclePool = pNetGame->GetVehiclePool();
		CVehicle* pVehicle = pVehiclePool->GetAt(pVehiclePool->FindIDFromGtaPtr(pLocalPlayer->GetGtaVehicle()));
		pVehicle->SetHealth(5000);
	}
}
コード例 #2
0
ファイル: subclass.cpp プロジェクト: LBRGeorge/jmnvc
static void DoubleCarSpeed(void)
{
	CPlayerPed* pLocalPlayer = pGame->FindPlayerPed();
	if (pLocalPlayer->IsInVehicle())
	{
		CVehiclePool* pVehiclePool = pNetGame->GetVehiclePool();
		CVehicle* pVehicle = pVehiclePool->GetAt(pVehiclePool->FindIDFromGtaPtr(pLocalPlayer->GetGtaVehicle()));
		pVehicle->DoubleSpeed();
	}
}
コード例 #3
0
ファイル: subclass.cpp プロジェクト: LBRGeorge/jmnvc
static void InvertSpeed(void)
{
	CPlayerPed* pLocalPlayer = pGame->FindPlayerPed();
	if (pLocalPlayer->IsInVehicle())
	{
		CVehiclePool* pVehiclePool = pNetGame->GetVehiclePool();
		CVehicle* pVehicle = pVehiclePool->GetAt(pVehiclePool->FindIDFromGtaPtr(pLocalPlayer->GetGtaVehicle()));
		VECTOR vecMoveSpeed;
		pVehicle->GetMoveSpeedVector(&vecMoveSpeed);
		vecMoveSpeed.X *= -1;
		vecMoveSpeed.Y *= -1;
		vecMoveSpeed.Z *= -1;
		pVehicle->SetMoveSpeedVector(vecMoveSpeed);
	}
}
コード例 #4
0
ファイル: subclass.cpp プロジェクト: LBRGeorge/jmnvc
static void InstantStop(void)
{
	CPlayerPed* pLocalPlayer = pGame->FindPlayerPed();
	if (pLocalPlayer->IsInVehicle())
	{
		CVehiclePool* pVehiclePool = pNetGame->GetVehiclePool();
		CVehicle* pVehicle = pVehiclePool->GetAt(pVehiclePool->FindIDFromGtaPtr(pLocalPlayer->GetGtaVehicle()));
		VECTOR vecMoveSpeed;
		vecMoveSpeed.X = 0;
		vecMoveSpeed.Y = 0;
		vecMoveSpeed.Z = 0;
		pVehicle->SetMoveSpeedVector(vecMoveSpeed);
		pVehicle->SetTurnSpeedVector(vecMoveSpeed);
	}
}
コード例 #5
0
ファイル: remoteplayer.cpp プロジェクト: jovazxc/samp
void CRemotePlayer::StateChange(BYTE byteNewState, BYTE byteOldState)
{

	if(byteNewState == PLAYER_STATE_DRIVER && byteOldState == PLAYER_STATE_ONFOOT)
	{
		// If their new vehicle is the one the local player
		// is driving, we'll have to kick the local player out
		CPlayerPed *pLocalPlayerPed = pGame->FindPlayerPed();
		CVehiclePool *pVehiclePool = pNetGame->GetVehiclePool();
		VEHICLEID LocalVehicle=0xFFFF;
		MATRIX4X4 mat;

		if(pLocalPlayerPed && pLocalPlayerPed->IsInVehicle() && !pLocalPlayerPed->IsAPassenger() && pVehiclePool)
		{
			LocalVehicle = pVehiclePool->FindIDFromGtaPtr(pLocalPlayerPed->GetGtaVehicle());
			if(LocalVehicle == m_VehicleID) {
				pLocalPlayerPed->GetMatrix(&mat);
				pLocalPlayerPed->RemoveFromVehicleAndPutAt(mat.pos.X,mat.pos.Y,mat.pos.Z + 1.0f);	
				pGame->DisplayGameText("~r~Car Jacked~w~!",1000,5);
			}
		}
	}	
}