rcar $car=get scriptowner car
shared float $speedo
float $brake
float $throttle
shared float $sample=10
float $gforce[3]
shared float $gforce_long
while 1
{
	$gforce = get $car gforce
	$gforce_long=$gforce.z/1
	$speedo=get $car tachovelocity
	$speedo*=3.72
	$throttle = get $car throttle
	$brake = get $car brake
	if ($gforce_long > 0.01)
	{
		$sample=2500/abs(2.50*$gforce_long)
	}
	if ($gforce_long < 0.01)
	{
		$sample=1000/abs(1.00*$gforce_long)
		if $sample > 1000
		{
			$sample = 1000
		}
	}
	if $sample > 2500
	{
		$sample = 2500
	}
	if $sample < 100
	{
		$sample = 100
	}
	if ($speedo % 1 > 0.50)
	{
		$speedo=1+$speedo-($speedo % 1)
	}
	if ($speedo % 1 < 0.50)
	{
		$speedo=$speedo-($speedo % 1)-1
	}
	if $speedo < 3.4
	{
		$speedo = 0
	}
	if $speedo < 9.49
	{
		$sample = 0.1
	}
	wait($sample)
	interrupt
}