# autotraidF
if $ARGS[0] = 'start':
	$metka = $ARGS[0]
	$loc = $CURLOC
	cla
	*clr
	minut += 5
	gs 'stat'
	'<center><b>Car</b></center>'
	'<center><img src="images/etogame/autotraid.jpg"></center>'
	'Machine can only be bought if you have permission. And you can not have two cars.'

	if hour <= 17:
		if car > 0:act 'Approach the car salesman':gt 'autotraidF', 'manager1'

		act 'View cars put up for sale':gt 'autotraidF', 'car'
	end

	act 'Leave':gt 'Nord'
end

if $ARGS[0] = 'manager1':
	$metka = $ARGS[0]
	$loc = $CURLOC
	cla
	*clr
	minut += 5
	gs 'stat'
	'<center><b>Car</b></center>'
	'<center><img src="images/etogame/autotraid.jpg"></center>'
	gs 'avb'

	if cardrive = 9 and car > 0:
		'Fence walked around the car and offered you for it <<bupay>> <b>₽</b>'

		act 'Sell ​​for (<<bupay>> <b>₽</b>) (1:00)':
			cla
			minut += 60
			money = money + bupay
			car = 0
			'You sold your car.'

			act 'Leave':gt 'Nord'
		end
	elseif cardrive ! 9:
		'Fence says that he needs to look at the car before you a price, and if you want, it will call a tow truck for 2500 that would take your car to the market.'

		if money >= 2500:
			act 'Pay for towing service to the car market (2,500 <b>₽</b>) (1:00)':
				cla
				minut += 60
				cardrive = 9
				money -= 2500
				'You gave the money and waited for an hour and when you bring a car, you will finally see her tow truck unloaded near the market.'

				act 'Go to car salesman':gt 'autotraidF', 'manager1'
			end
		end
	end

	act 'Leave':gt 'Nord'
end

if $ARGS[0] = 'car':
	$metka = $ARGS[0]
	$loc = $CURLOC
	cla
	*clr
	minut += 5
	carT = 0
	gs 'stat'
	'<center><b>Car</b></center>'
	'<center><img src="images/etogame/autotraid.jpg"></center>'
	'So many cars in the parking lot that you can spend a lifetime and never osmotrish all machines, even if the machines on the go, you can understand their technical condition, the machine moves is not a cat in a bag can be a bargain, and can be a waste money, and do not forget, you still deliver it to the service will need.'

	if hour <= 17:
		act 'Inspect 2107 (on the go)':
			cla
			*clr
			'<center><b>2107 (on the move)</b></center>'
			'<center><img src="images/picar/car.jpg"></center>'
			tehNT = 200
			tehT = rand(10, tehNT)
			carT = 1
			gs 'avt'
			'<<$tehT>> The dealer wants <<bupay>> <b>₽</b>'

			act 'Leave':gt 'autotraidF', 'car'

			if car = 0 and prava = 1 and money >= bupay:
				act 'Buy (<<bupay>> <b>₽</b>)':
					cla
					money -= bupay
					$car = '2107'
					car = 1
					benz = 3
					cardrive = 9
					teh = tehT
					tehcar = 200
					wrek = 0
					'You pay <<bupay>> <b>₽</b> and bought a car. Merchant put her near the market and warned that there is little gasoline.'

					act 'Leave':gt 'Nord'
				end
			end
		end

		act 'Inspect 2107 (doesn''t move)':
			cla
			*clr
			tehNT = 200
			tehT = rand(10, tehNT)
			bupay = rand(10000, 50000)
			'The machine is not on the move. Merchant wants to <<bupay>> <b>₽</b>'

			act 'Leave':gt 'autotraidf', 'car'

			if car = 0 and prava = 1 and money >= bupay:
				act 'Buy <<bupay>><b>₽</b>':
					cla
					money -= bupay
					$car = '2107'
					car = 1
					benz = 3
					cardrive = 9
					teh = tehT
					tehcar = 200
					wrek = 1
					'You pay <<bupay>> <b>₽</b> and bought a car. Merchant put her near the market.'

					act 'Leave':gt 'Nord'
				end
			end
		end
		act 'Inspect VAZ 2115 (underway)':
			cla
			*clr
			tehNT = 300
			tehT = RAND(10,tehNT)
			carT = 1

			'<center><b>VAZ 2115 (underway)</b></center>'
			'<center><img src="images/picar/car2.jpg"></center>'

			gs'avt'

			'<<$tehT>> Merchant wants <<bupay>> <b>₽</b>'

			act 'Escape':gt'autotraidF','car'

			if car = 0 and prava = 1 and money >= bupay:
				act 'Buy for <<bupay>> <b>₽</b>':
					cla
					money = money - bupay
					$car = 'VAZ 2115'
					car = 2
					benz = 3
					cardrive = 9
					teh = tehT
					tehcar = 300
					wrek = 0

					'You paid <<bupay>> <b>₽</b> and bought a car. The merchant put it near the market and warned, that there is little petrol.'

					act 'Escape':gt'Nord'
				end
			end
		end
		act 'Inspect VAZ 2113 (underway)':
			cla
			*clr
			tehNT = 290
			tehT = RAND(10,tehNT)
			carT = 1

			'<center><b>VAZ 2113 (underway)</b></center>'
			'<center><img src="images/picar/car3.jpg"></center>'

			gs'avt'

			'<<$tehT>> Merchant wants <<bupay>> <b>₽</b>'

			act 'Escape':gt'autotraidF','car'

			if car = 0 and prava = 1 and money >= bupay:
				act 'Buy for <<bupay>> <b>₽</b>':
					cla
					money = money - bupay
					$car = 'VAZ 2113'
					car = 3
					benz = 3
					cardrive = 9
					teh = tehT
					tehcar = 290
					wrek = 0

					'You paid <<bupay>> <b>₽</b> and bought a car. The merchant put it near the market and warned, that there is little petrol.'

					act 'Escape':gt'Nord'
				end
			end
		end
		act 'Inspect VAZ 2114 (underway)':
			cla
			*clr
			tehNT = 300
			tehT = RAND(10,tehNT)
			carT = 1

			'<center><b>VAZ 2114 (underway)</b></center>'
			'<center><img src="images/picar/car4.jpg"></center>'

			gs'avt'

			'<<$tehT>> Merchant wants <<bupay>> <b>₽</b>'

			act 'Escape':gt'autotraidF','car'

			if car = 0 and prava = 1 and money >= bupay:
				act 'Buy for <<bupay>> <b>₽</b>':
					cla
					money = money - bupay
					$car = 'VAZ 2114'
					car = 4
					benz = 3
					cardrive = 9
					teh = tehT
					tehcar = 300
					wrek = 0

					'You paid <<bupay>> <b>₽</b> and bought a car. The merchant put it near the market and warned, that there is little petrol.'

					act 'Escape':gt'Nord'
				end
			end
		end
		act 'Inspect VAZ 2110 (underway)':
			cla
			*clr
			tehNT = 350
			tehT = RAND(10,tehNT)
			carT = 1

			'<center><b>VAZ 2110 (underway)</b></center>'
			'<center><img src="images/picar/car5.jpg"></center>'

			gs'avt'

			'<<$tehT>> Merchant wants <<bupay>> <b>₽</b>'

			act 'Escape':gt'autotraidF','car'

			if car = 0 and prava = 1 and money >= bupay:
				act 'Buy for <<bupay>> <b>₽</b>':
					cla
					money = money - bupay
					$car = 'VAZ 2110'
					car = 5
					benz = 3
					cardrive = 9
					teh = tehT
					tehcar = 350
					wrek = 0

					'You paid <<bupay>> <b>₽</b> and bought a car. The merchant put it near the market and warned, that there is little petrol.'

					act 'Escape':gt'Nord'
				end
			end
		end

		act 'Inspect GAZ 3102 (on the go)':
			cla
			*clr
			'<center><b>3102 GAS (on the move)</b></center>'
			'<center><img src="images/picar/car11.jpg"></center>'
			tehNT = 1000
			tehT = rand(10, tehNT)
			carT = 2
			gs 'avt'
			'<<$tehT>> The dealer wants <<bupay>> <b>₽</b>'

			act 'Leave':gt 'autotraidf', 'car'

			if car = 0 and prava = 1 and money >= bupay:
				act 'Buy <<bupay>><b>₽</b>':
					cla
					money -= bupay
					$car = 'GAZ 3102'
					car = 11
					benz = 5
					cardrive = 9
					teh = tehT
					tehcar = 1000
					wrek = 0
					'You pay <<bupay>> <b>₽</b> and bought a car. Merchant put her near the market and warned that there is little gasoline.'

					act 'Leave':gt 'Nord'
				end
			end
		end

		act 'Inspect 3110 (on the go)':
			cla
			*clr
			'<center><b>3110 (on the move)</b></center>'
			'<center><img src="images/picar/car12.jpg"></center>'
			tehNT = 800
			tehT = rand(10, tehNT)
			carT = 2
			gs 'avt'
			'<<$tehT>> The dealer wants <<bupay>> <b>₽</b>'

			act 'Leave':gt 'autotraidF', 'car'

			if car = 0 and prava = 1 and money >= bupay:

			act 'Buy (<<bupay>> <b>₽</b>)':
					cla
					money -= bupay
					$car = '3110'
					car = 12
					benz = 5
					cardrive = 9
					teh = tehT
					tehcar = 800
					wrek = 0
					'You pay <<bupay>> <b>₽</b> and bought a car. Merchant put her near the market and warned that there is little gasoline.'

					act 'Leave':gt 'Nord'
				end
			end
		end
	end

	act 'Leave':gt 'Nord'
end

--- autotraidF ---------------------------------

