Коробка передач v2
Немного переделал мою Коробку передач.
Исправления:
1. Убраны проблемы с задним ходом. При движении назад передача автоматич. переключатсяна заднюю(отображается как 0). Когда после этого едете вперед - возвращаетсяна 1-ю.
2. Теперь весь скрипт в одном потоке. Можно компилировать как .cs.
:KPP
wait 0
if $PLAYER_CHAR.Defined
then
if and
$PLAYER_ACTOR.Driving
84A7: not actor $PLAYER_ACTOR driving_boat
84C8: not actor $PLAYER_ACTOR driving_flying_vehicle
then
04F7: status_text $peredacha type 0 line 1 GXT 'speedo' // global_variable // Score
03C0: 1@ = actor $PLAYER_ACTOR car
0494: get joystick data 0 $left_x $left_y $rigth_x $rigth_y
if and
00E1: player 0 pressed_key 3
$rigth_y == -128
$peredacha < 6
then
$peredacha += 1
081D: set_car 1@ engine_operation 1
wait 500
02E3: 2@ = car 1@ speed
081D: set_car 1@ engine_operation 0
036A: put_actor $PLAYER_ACTOR in_car 1@
car.SetSpeedInstantly(1@,2@)
end
0494: get joystick data 0 $left_x $left_y $rigth_x $rigth_y
if and
00E1: player 0 pressed_key 3
$rigth_y == 128
$peredacha > 1
then
$peredacha -= 1
081D: set_car 1@ engine_operation 1
wait 500
02E3: 2@ = car 1@ speed
081D: set_car 1@ engine_operation 0
036A: put_actor $PLAYER_ACTOR in_car 1@
car.SetSpeedInstantly(1@,2@)
end
if and
9@ 0.0
8@ < 0.0
then
$peredacha = 0
end
if and
9@ = 90.0
7@ > 0.0
8@ > 0.0
then
$peredacha = 0
end
if and
9@ = 180.0
7@ < 0.0
8@ > 0.0
then
$peredacha = 0
end
if and
9@ >= 270.0
7@ < 0.0
8@ < 0.0
then
$peredacha = 0
end
if and
9@ = 0.0
$peredacha == 0
then
$peredacha = 1
end
02E3: 2@ = car 1@ speed
if and
$peredacha == 1
2@ > 8.0
81F3: not car 1@ in_air
then
car.SetSpeedInstantly(1@,8.0)
end
if and
$peredacha == 2
2@ > 19.0
81F3: not car 1@ in_air
then
car.SetSpeedInstantly(1@,19.0)
end
if and
$peredacha == 3
2@ > 31.0
81F3: not car 1@ in_air
then
car.SetSpeedInstantly(1@,31.0)
end
if and
$peredacha == 4
2@ > 46.0
81F3: not car 1@ in_air
then
car.SetSpeedInstantly(1@,46.0)
end
if and
$peredacha == 5
2@ > 63.0
81F3: not car 1@ in_air
then
car.SetSpeedInstantly(1@,63.0)
end
02E3: 3@ = car 1@ speed
wait 50
02E3: 2@ = car 1@ speed
0087: 4@ = 2@
0063: 4@ -= 3@
if and
$peredacha == 2
4@ > 0.75
81F3: not car 1@ in_air
then
02E3: 2@ = car 1@ speed
2@ -= 1.5
car.SetSpeedInstantly(1@,2@)
end
if and
$peredacha == 3
4@ > 0.65
81F3: not car 1@ in_air
then
02E3: 2@ = car 1@ speed
2@ -= 1.5
car.SetSpeedInstantly(1@,2@)
end
if and
$peredacha == 4
4@ > 0.6
81F3: not car 1@ in_air
then
02E3: 2@ = car 1@ speed
2@ -= 1.5
car.SetSpeedInstantly(1@,2@)
end
if and
$peredacha == 5
4@ > 0.45
81F3: not car 1@ in_air
then
02E3: 2@ = car 1@ speed
2@ -= 1.5
car.SetSpeedInstantly(1@,2@)
end
if and
$peredacha == 6
4@ > 0.35
81F3: not car 1@ in_air
then
02E3: 2@ = car 1@ speed
2@ -= 1.5
car.SetSpeedInstantly(1@,2@)
end
else
car.RemoveReferences(1@)
0151: remove_status_text $peredacha
$peredacha = 1
end
end
jump @KPP