Exemple #1
0
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);
	}
}
Exemple #2
0
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();
	}
}
Exemple #3
0
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);
	}
}
Exemple #4
0
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);
	}
}
Exemple #5
0
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);
			}
		}
	}	
}