Дрифт v2.0
Наверное последняя версия моего дрифта.
Изменений много. Пожалуй основное - скрипт теперь основан на скрипте генерируемом при помощи SARMC v1.0 ([url=http://gtamaps.net/forum/index.php?showtopic=9555]Тема на форуме[/url]).
Чтобы изменить трассу просто генерируете "гонку на время" , удаляете закомментированные (у меня) строки и вставляете те, после которых стоит пустой комментарий. Перед созданием уберите в SARMC флаг "Все машины пуленеробиваемые".
//This script was created by 'GTA: San Andreas Race Mission Creator v1.0'
:Lap_Example
$Lap_Example_XCoord = 2480.55
$Lap_Example_YCoord = -1666.06
$Lap_Example_ZCoord = 13.34
$Lap_Example_Marker = Marker.CreateIconAndSphere(53, $Lap_Example_XCoord, $Lap_Example_YCoord, $Lap_Example_ZCoord)
:Lap_Example_1349
wait 25 ms
Player.Defined($PLAYER_CHAR)
jf @Lap_Example_1349
0101: actor $PLAYER_ACTOR stopped_near_point $Lap_Example_XCoord $Lap_Example_YCoord $Lap_Example_ZCoord radius 3.0 3.0 3.0 sphere 0
jf @Lap_Example_1349
Player.Controllable($PLAYER_CHAR)
jf @Lap_Example_1349
$ONMISSION == 0 // integer values
jf @Lap_Example_1349
Marker.Disable($11192)
054C: use_GXT_table 'RACETOR'
00BA: text_styled 'RACES_0' 1500 ms 2
0169: set_fade_color 0 0 0
fade 0 (in) 2500 ms
:Lap_Example_1492
wait 0 ms
not fading
jf @Lap_Example_1492
Marker.Disable($11192)
00BE: text_clear_all
03E6: remove_text_box
if $DRIFT_MISSION_PASSED == 0//
then $hiscore = 150// Начальное кол-во очков, необходимых для победы //
end//
start_mission 0
end_thread
//-------------Mission 0---------------
:Lap_Example_000
thread 'EXAMPL1'
gosub @Lap_Example_47
wasted_or_busted
jf @Lap_Example_38
gosub @Lap_Example_2497
:Lap_Example_38
gosub @Lap_Example_2762
end_thread
:Lap_Example_47
increment_mission_attempts
$ONMISSION = 1
Player.ClearWantedLevel($PLAYER_CHAR)
00BE: text_clear_all
{Мои переменные и константы}
const//
PLAYER_CAR = $car[1]//
TEMP_SCORE = 8@//
BONUS = 9@//
DRIFT_ANGLE = 15.0//
CAR_HEALTH = 10@//
CAR_SPEED = 7@//
SPEED_LIMIT = 10.0//
DRIFTING_ANGLE = 15@//
end//
var//
1@:float//
2@:float//
3@:float//
4@:float//
5@:float//
6@:float//
7@:float//
8@:int//
9@:int//
10@:int//
11@:int//
12@:int//
13@:int//
14@:int//
15@:int//
$score:int//
end//
var
$nar : Integer
$tar : Integer
$time : Integer = 1000
$dist : Float
$dist2 : Float
$pos : Integer = 1
$pos2 : Integer = 1
$stage : Array 5 of Integer
$car : Array 5 of Car
$model : Array 5 of Model
$act : Array 5 of Actor
$mark : Array 5 of Marker
$carx : Array 5 of Float
$cary : Array 5 of Float
$carz : Array 5 of Float
$angle : Array 5 of Float
$paintjob : Array 5 of Integer
$pointx : Array 17 of Float
$pointy : Array 17 of Float
$pointz : Array 17 of Float
$speed : Array 17 of Float
$type : Array 17 of Integer
$components : Array 9 of Model
$component1 : Array 9 of Model
$component2 : Array 9 of Model
$component3 : Array 9 of Model
$component4 : Array 9 of Model
$component5 : Array 9 of Model
$component6 : Array 9 of Model
$component7 : Array 9 of Model
$component8 : Array 9 of Model
$component9 : Array 9 of Model
$component10 : Array 9 of Model
end
for $par = 1 to 1
$stage[$par] = 1
end
$pointx[1] = 2372.91
$pointy[1] = -1658.93
$pointz[1] = 13.38
$speed[1] = 100.0
$type[1] = 3
$pointx[2] = 2342.61
$pointy[2] = -1580.44
$pointz[2] = 23.76
$speed[2] = 50.0
$type[2] = 3
$pointx[3] = 2342.81
$pointy[3] = -1538.50
$pointz[3] = 23.84
$speed[3] = 100.0
$type[3] = 3
$pointx[4] = 2228.25
$pointy[4] = -1484.19
$pointz[4] = 23.23
$speed[4] = 100.0
$type[4] = 3
$pointx[5] = 2212.02
$pointy[5] = -1398.15
$pointz[5] = 23.34
$speed[5] = 100.0
$type[5] = 3
$pointx[6] = 2068.81
$pointy[6] = -1278.58
$pointz[6] = 23.34
$speed[6] = 100.0
$type[6] = 3
$pointx[7] = 1792.85
$pointy[7] = -1273.45
$pointz[7] = 12.98
$speed[7] = 100.0
$type[7] = 3
$pointx[8] = 1792.85
$pointy[8] = -1273.45
$pointz[8] = 12.98
$speed[8] = 50.0
$type[8] = 3
$pointx[9] = 1715.13
$pointy[9] = -1417.16
$pointz[9] = 12.90
$speed[9] = 100.0
$type[9] = 3
$carx[1] = 2457.08
$cary[1] = -1656.42
$carz[1] = 13.30
$angle[1] = 90.0
$paintjob[1] = 0
$model[1] = #ELEGY
$components[1] = 7
$component1[1] = #WG_L_A_L
$component2[1] = #EXH_C_L
$component3[1] = #RF_C_L
$component4[1] = #SPL_C_L_B
$component5[1] = #RBMP_C_L
$component6[1] = #FBMP_C_L
$component7[1] = #WG_L_C_L
for $par = 1 to 1
$model[$par].Load
end
06E9: request_car_component $component1[1]
06E9: request_car_component $component2[1]
06E9: request_car_component $component3[1]
06E9: request_car_component $component4[1]
06E9: request_car_component $component5[1]
06E9: request_car_component $component6[1]
06E9: request_car_component $component7[1]
wait 1000 ms
:Lap_Example_111
wait 0 ms
for $par = 1 to 1
$model[$par].Available
jf @Lap_Example_111
end
if and
06EA: car_component $component1[1] available
06EA: car_component $component2[1] available
06EA: car_component $component3[1] available
06EA: car_component $component4[1] available
06EA: car_component $component5[1] available
06EA: car_component $component6[1] available
06EA: car_component $component7[1] available
jf @Lap_Example_111
01EB: set_traffic_density_to 0.0
0395: clear_area 1 at $carx[1] $cary[1] $carz[1] range 300.0
for $par = 1 to 1
$car[$par] = Car.Create($model[$par], $carx[$par], $cary[$par], $carz[$par])
Car.Angle($car[$par]) = $angle[$par]
// Car.SetImmunities($car[$par], 1, 1, 1, 1, 1)
07EE: car $car[$par] enable_tire_marks 1
Car.DoorStatus($car[$par]) = 2
if $components[$par] >= 1
then
06E7: $cmpnent = add_car_component $component1[$par] to_car $car[$par]
if $components[$par] >= 2
then
06E7: $cmpnent2 = add_car_component $component2[$par] to_car $car[$par]
if $components[$par] >= 3
then
06E7: $cmpnent3 = add_car_component $component3[$par] to_car $car[$par]
if $components[$par] >= 4
then
06E7: $cmpnent4 = add_car_component $component4[$par] to_car $car[$par]
if $components[$par] >= 5
then
06E7: $cmpnent5 = add_car_component $component5[$par] to_car $car[$par]
if $components[$par] >= 6
then
06E7: $cmpnent6 = add_car_component $component6[$par] to_car $car[$par]
if $components[$par] >= 7
then
06E7: $cmpnent7 = add_car_component $component7[$par] to_car $car[$par]
if $components[$par] >= 8
then
06E7: $cmpnent8 = add_car_component $component8[$par] to_car $car[$par]
if $components[$par] >= 9
then
06E7: $cmpnent9 = add_car_component $component9[$par] to_car $car[$par]
if $components[$par] >= 10
then
06E7: $cmpnent10 = add_car_component $component10[$par] to_car $car[$par]
end
end
end
end
end
end
end
end
end
end
if $paintjob[$par] <> -1
then
06ED: set_car $car[$par] paintjob $paintjob[$par]
end
end
036A: put_actor $PLAYER_ACTOR in_vehicle $car[1]
0407: create_coordinate $camx $camy $camz from_car $car[1] offset 0.0 -23.7 14.1
Camera.SetPosition($camx, $camy, $camz, 0.0, 0.0, 0.0)
Camera.OnVehicle($car[1], 15, 1)
Player.CanMove($PLAYER_CHAR) = False
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 1
03F4: set_all_vehicles_apply_damage_rules 0
wait 2500 ms
fade 1 (out) 1000 ms
wait 1000 ms
00BA: text_styled 'RACES_4' 1100 ms 4 // 3
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
0407: create_coordinate $camx2 $camy2 $camz2 from_car $car[1] offset 0.0 -13.7 7.1
Camera.SetPosition($camx2, $camy2, $camz2, 0.0, 0.0, 0.0)
Camera.OnVehicle($car[1], 15, 1)
0460: set_camera_pointing_time 0.0 2000
00BA: text_styled 'RACES_5' 1100 ms 4 // 2
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
0407: create_coordinate $camx3 $camy3 $camz3 from_car $car[1] offset 0.0 -6.7 3.1
Camera.SetPosition($camx3, $camy3, $camz3, 0.0, 0.0, 0.0)
Camera.OnVehicle($car[1], 15, 1)
0460: set_camera_pointing_time 0.0 2000
00BA: text_styled 'RACES_6' 1100 ms 4 // 1
097A: at 0.0 0.0 0.0 play_sound 1056
wait 1100 ms
00BA: text_styled 'RACES_7' 800 ms 4 // GO!
097A: at 0.0 0.0 0.0 play_sound 1057
01BD: 11@ = current_time_in_ms
Player.CanMove($PLAYER_CHAR) = True
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 0
03F4: set_all_vehicles_apply_damage_rules 1
01EB: set_traffic_density_to 0.0
Camera.SetBehindPlayer
Camera.Restore
//03C3: set_timer_with_text_to $time type 1 text 'TIMER' // TIME
14@ = car.Health(PLAYER_CAR)//
for $kar = 1 to 9
$nar = $kar // integer values
$nar += 1 // integer values
018A: $chekp = create_checkpoint_at $pointx[$kar] $pointy[$kar] $pointz[$kar]
0168: show_on_radar $chekp 4
if
$kar == 9 // integer values
then
1@ = 1
Marker.SetColor($chekp, 0)
end
06D5: $rchekp = create_racing_checkpoint_at $pointx[$kar] $pointy[$kar] $pointz[$kar] point_to $pointx[$nar] $pointy[$nar] $pointz[$nar] type 1@ radius 6.0
while 8100: not actor $PLAYER_ACTOR near_point_in_vehicle $pointx[$kar] $pointy[$kar] $pointz[$kar] radius 12.0 12.0 12.0 sphere 0
// if
// $time <= 0
// then
// jump @Lap_Example_2497
// end
gosub @drift//
03F0: toggle_text_draw 1//
033F: set_text_draw_letter_size 0.7 0.933//
0340: set_text_draw_RGBA 255 255 255 255//
0348: toggle_text_draw_proportional 1//
0349: set_text_draw_font 2//
060D: draw_text_shadow 1 color_RGBA 0 0 0 255//
045A: draw_text_1number 130.0 415.0 GXT 'NUMBER' number DRIFTING_ANGLE//
08DA: remove_panel 16@//
08D4: 16@ = create_panel_with_title 'DRIFT' position 29.0 30.0 width 35.0 columns 2 interactive 0 background 1 alignment 1//
09DB: set_panel 16@ column 0 width 120//
08DB: set_panel 16@ column 0 header 'DUMMY' data 'DRIFTHI' 'DRIFYOU' 'DUMMY' 'DRIFBON' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'//
08DB: set_panel 16@ column 1 header 'DUMMY' data 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY' 'DUMMY'//
08EE: set_panel 16@ column 1 row 0 text_1number GXT 'NUMBER' number $hiscore//
08EE: set_panel 16@ column 1 row 1 text_1number GXT 'NUMBER' number $score//
08EE: set_panel 16@ column 1 row 3 text_1number GXT 'DRIFBNN' number BONUS//
if TEMP_SCORE > 0//
then//
033F: set_text_draw_letter_size 1.3 1.7//
0340: set_text_draw_RGBA 217 222 12 150//
0348: toggle_text_draw_proportional 1//
0349: set_text_draw_font 3//
060D: draw_text_shadow 0 color_RGBA 0 0 0 125//
0912: unknown_text_draw_flag 1 height 355 width 370//
0342: toggle_text_draw_centered 1//
045A: draw_text_1number 280.0 100.0 GXT 'NUMBER' number TEMP_SCORE//
end//
if and
$pos = 1 // integer values
not Actor.InCar($PLAYER_ACTOR, $car[1])
then
jump @Lap_Example_2497
end
if or
Car.Wrecked($car[1])
02BF: car $car[1] sunk
then
jump @Lap_Example_2497
end
// wait 0 ms
end
Marker.Disable($chekp)
06D6: delete_racing_checkpoint $rchekp
097A: at 0.0 0.0 0.0 play_sound 1058
end
jump @Lap_Example_2491
:Lap_Example_2491
gosub @Lap_Example_REMOVE
if
// $pos2 == 1
002c: $score >= $hiscore//
then
$DRIFT_MISSION_PASSED = 1//
0084: $hiscore = $score//
$score = 0//
00BA: text_styled 'RACES18' 3000 ms 1 // Winner!
wait 3000 ms
01E3: text_1number_styled 'M_PASS' 3000 4000 ms 1 // MISSION PASSED!~n~~w~$~1~
Player.Money($PLAYER_CHAR) += 3000
// 01BD: 12@ = current_time_in_ms
// 0085: 13@ = 12@ // integer values and handles
// 0062: 13@ -= 11@ // integer values
// 13@ /= 1000.0 // floating-point values
// 0085: 452@ = 13@ // integer values and handles
// 452@ /= 60 // integer values
// 0085: 36@ = 452@ // integer values and handles
// 36@ *= 60 // integer values
// 0085: 453@ = 13@ // integer values and handles
// 0062: 453@ -= 36@ // integer values
0394: play_music 1
// 02FD: text_2numbers_lowpriority 'TIME' 452@ 453@ 8000 ms 1 // ~1~:~1~
else
01E3: text_1number_styled 'RACES_8' 200 5000 ms 1 // Loser!
create_thread @Lap_Example
// 01BD: 12@ = current_time_in_ms
// 0085: 13@ = 12@ // integer values and handles
// 0062: 13@ -= 11@ // integer values
// 13@ /= 1000.0 // floating-point values
// 0085: 452@ = 13@ // integer values and handles
// 452@ /= 60 // integer values
// 0085: 36@ = 452@ // integer values and handles
// 36@ *= 60 // integer values
// 0085: 453@ = 13@ // integer values and handles
// 0062: 453@ -= 36@ // integer values
// 02FD: text_2numbers_lowpriority 'TIME' 452@ 453@ 8000 ms 1 // ~1~:~1~
end
0318: set_latest_mission_passed_to 'RACES_0'
Player.ClearWantedLevel($PLAYER_CHAR)
create_thread @Lap_Example
gosub @Lap_Example_38
return
:Lap_Example_2497
gosub @Lap_Example_REMOVE
00BA: text_styled 'RACES_8' 5000 ms 1 // Loser!
create_thread @Lap_Example
return
:Lap_Example_REMOVE
01EB: set_traffic_density_to 1.0
Car.DoorStatus($car[1]) = 0
for $par = 1 to 1
if
$car[$par] <> -1
then
Car.SetImmunities($car[$par], 0, 0, 0, 0, 0)
Model.Destroy($model[$par])
Car.RemoveReferences($car[$par])
if
$par <> 1
then
Marker.Disable($mark[$par])
Actor.RemoveReferences($act[$par])
end
end
end
06EB: release_car_component $component1[1]
06EB: release_car_component $component2[1]
06EB: release_car_component $component3[1]
06EB: release_car_component $component4[1]
06EB: release_car_component $component5[1]
06EB: release_car_component $component6[1]
06EB: release_car_component $component7[1]
Marker.Disable($chekp)
06D6: delete_racing_checkpoint $rchekp
03F0: toggle_text_draw 0
014F: delete_timer $time
01B7: release_weather
00BE: text_clear_all//
$score += TEMP_SCORE//
08DA: remove_panel 16@//
return
:Lap_Example_2762
$ONMISSION = 0 // integer values
mission_cleanup
return
{Все последующие строки - мой код.
Их тоже необходимо вставлять в файл.}
:drift
//wait 0
11@ = TEMP_SCORE
gosub @drifted
if
TEMP_SCORE > 11@
then
12@ = 0
13@ = 0
else
if 12@ == 0
then
01BD: 12@ = current_time_in_ms
end
if
13@ <= 2000
then
01BD: 13@ = current_time_in_ms
13@ -= 12@
else
$score += TEMP_SCORE
TEMP_SCORE = 0
12@ = 0
13@ = 0
end
end
CAR_HEALTH = car.Health(PLAYER_CAR)
if
CAR_HEALTH < 14@
then
TEMP_SCORE = 0
12@ = 0
13@ = 0
14@ = CAR_HEALTH
//0A30: repair_car PLAYER_CAR //раскомментируйте эти строки, если необходимо установить на авто иммунитеты //
//14@ = car.Health(PLAYER_CAR) //
00BE: text_clear_all
wait 2000
end
return
:drifted
car.StorePos(PLAYER_CAR,1@,2@,3@)
wait 0
car.StorePos(PLAYER_CAR,3@,4@,5@)
3@ -= 1@
4@ -= 2@
02F8: get_car PLAYER_CAR Z_angle_cosine_to 5@
02F9: get_car PLAYER_CAR Z_angle_sine_to 6@
05A4: get_angle_between_vectors_origin_to 5@ 6@ and_origin_to 3@ 4@ store_to 5@
0087: DRIFTING_ANGLE = 5@
0092: DRIFTING_ANGLE = float DRIFTING_ANGLE to_integer
02E3: CAR_SPEED = car PLAYER_CAR speed
if and
CAR_SPEED >= SPEED_LIMIT
81F4: not car PLAYER_CAR flipped
8119: not car PLAYER_CAR wrecked
82BF: not car PLAYER_CAR sunk
81F3: not car PLAYER_CAR in_air
then
BONUS = 1
if CAR_SPEED >= 19.0
then
BONUS = 2
end
if CAR_SPEED >= 31.0
then
BONUS = 3
end
if CAR_SPEED >= 46.0
then
BONUS = 4
end
if CAR_SPEED >= 63.0
then
BONUS = 5
end
if and
TEMP_SCORE >=50
TEMP_SCORE <150
then
BONUS *= 2
end
if and
TEMP_SCORE >=150
TEMP_SCORE <500
then
BONUS *= 3
end
if and
TEMP_SCORE >=500
TEMP_SCORE <1000
then
BONUS *= 4
end
if TEMP_SCORE >=1000
then
BONUS *= 5
end
if and
5@ >= DRIFT_ANGLE
5@ <= 90.0
then inc(TEMP_SCORE,BONUS)
end
end
return
=------------
В .fxt файл (CLEO_TEXT плагин) необходимо добавить следующее:
DRIFT Drift
DRIFTHI Need to win:
DRIFYOU Your score:
DRIFBON Bonus:
DRIFBNN x~1~
Комментарии
#1 |
01.12.2007 - 18:59:06
#2 |
09.12.2007 - 00:34:43
#3 |
19.12.2007 - 21:45:17
#4 |
09.02.2008 - 19:12:04
#5 |
10.02.2008 - 14:49:40
#6 |
13.02.2008 - 09:54:06
Добавить комментарий
Пожалуйста, залогиньтесь для добавления комментария.
Рейтинги
Рейтинг доступен только для пользователей.
Пожалуйста, залогиньтесь или зарегистрируйтесь для голосования.
Нет данных для оценки.