Рейтинг - 3.0 (3)

Итак, в этом уроке мы научимся создавать пешеходов, они же актёры. Также научимся загружать необходимые модели.

Любой пешеход в игре является актёром. Начнём с того, что ознакомимся с опкодами, с помощью которых он будет создаваться.

В первую очередь нужно загрузить в память модель актёра. Начинающим скриптерам, да и опытным, очень помогает программа Ped Editor ( вот урок для тех, кто не читал ), в которой можно просмотреть модели всех пешеходов. Давайте найдём нужную модель. Запускаем программу и выберем в списке интересующую нас модель. Вот, например я выбрал такую:

Как видите я хочу создать актёра, модель которого: BMYPOL1, что бы загрузить такую модель, нужно воспользоваться опкодом:

Model.Load(#BMYPOL1)
Здесь:
#BMYPOL1 - выбранная нами модель

Обратите внимание на то, что перед именем модели всегда пишется знак "диез" или, как в народе говорят, решетки. Также есть возможность загрузки модели по её ID, как видите, в нашем случаи, ID этой модели - 66 ( выделено зелёным цветом ). Написанный нами опкод выше — всё равно, что: Model.Load(66). Если вы будете набирать модель, то вы обязательно можете узнать её ID ( см. картинку ниже ).

Этот опкод перечисляет модели, которые нужно загрузить. Сама загрузка начитается опкодом:

038B: load_requested_models

Таким образом результат должен быть такой:

Model.Load(#BMYPOL1)
038B: load_requested_models

После этого нам нужно проверять на загрузку модели. Проверка загрузки делается опкодом:

Model.Available(#BMYPOL1)
Здесь:
#BMYPOL1 - выбранная нами модель

Давайте рассмотрим полный пример загрузки модели:

:MODEL
wait 0
model.Load(#BMYPOL1)
038B: load_requested_models

:MODEL_1
wait 0
if
model.Available(#BMYPOL1)
jf @MODEL_1

Если нам необходимо загрузить несколько моделей, то можно использовать такой пример:

:MODEL
wait 0
model.Load(#BMYPOL1)
model.Load(#FAM1)
model.Load(#FAM2)
038B: load_requested_models

:MODEL_1
wait 0
if AND
model.Available(#BMYPOL1)
model.Available(#FAM1)
model.Available(#FAM2)
jf @MODEL_1

Достаточно часто пишут такие варианты:

Вариант 1Вариант 2
:MODEL
wait 0
model.Load(#BMYPOL1)
038B: load_requested_models
model.Load(#FAM1)
038B: load_requested_models
model.Load(#FAM2)
038B: load_requested_models

:MODEL_1
wait 0
if AND
model.Available(#BMYPOL1)
model.Available(#FAM1)
model.Available(#FAM2)
jf @MODEL_1
:MODEL
wait 0
model.Load(#FAM1)
model.Load(#FAM1)
038B: load_requested_models

:MODEL_1
wait 0
if AND
model.Available(#FAM1)
model.Available(#FAM1)
jf @MODEL_1

1-й вариант ещё допустим, но он не рационален. 2-й вариант вовсе бредовый. Почему? Потому, что если мы загружаем одну модель, то она всегда будет хранится в памяти, и мы можем в любой момент использовать её. Вариант 2 дважды загружает одну и туже модель, а этого делать не нужно. Поэтому можете использовать мои примеры, что бы оптимизировать Ваш код.

Если есть загрузка, то есть и удаление ( очищение ). Что бы не грузить память, так же нужно удалять модель после использования. Делается это командой:

Model.Destroy(#BMYPOL1)
Здесь:
#BMYPOL1 - выбранная нами модель

Итак, с загрузкой моделей разобрались. Наша цель - создать актёра. Прежде чем приступать, определим координаты. Заходим в игру и ищем нужное место. Далее сворачиваем игру ( клавиша WINDOWS ), и в Sanny Builder нажмём знакомые нам комбинации клавиш CTRL+SHIFT+C и CTRL+SHIFT+E. Я получил координаты: 2506.8359 -1669.4536 12.3772, а также угол поворота: 88.2883. Создадим нашего первого педа ( актёра )! Воспользуемся такой командой:

$IVAN = actor.Create(4, #BMYPOL1, 2506.8359, -1669.4536, 12.3772)
Здесь:
$IVAN — имя ( хендл ) переменной для нашего актёра, я назвал её человеческим именем, что бы Вам было понятнее
4 — тип актёра ( см. Типы пешеходов )
#BMYPOL1 — как вы уже догадались, модель актёра
2506.8359, -1669.4536, 12.3772 — мои координаты

А так же зададим ему угол поворота:

actor.Angle($IVAN) = 88.2883
Здесь:
$IVAN — имя ( хендл ) переменной для нашего актёра
88.2883 — угол поворота нашего педа

Обычно эти опкоды пушить в месте:

$IVAN = actor.Create(4, #BMYPOL1, 2506.8359, -1669.4536, 12.3772)
actor.Angle($IVAN) = 88.2883

Совсем не правильным будет такой вариант:

actor.Angle($IVAN) = 88.2883
$IVAN = actor.Create(4, #BMYPOL1, 2506.8359, -1669.4536, 12.3772)

Так, как вначале мы не создавали ранее актёра с именем "$IVAN", то игра вылетит, так как она не знает кого поворачивать. Но если такой актёр существует, то никакой ошибки не будет.

Давайте напишем примитивный скрипт, что бы при нажатии кнопки BACKSPACE, в наших координатах появлялся актёр. Для этого создадим новый поток с именем "@Model", и добавим код. Должно получится такое:

// WMYSTERIO, ru-script.3dn.ru
DEFINE OBJECTS 1
DEFINE OBJECT SANNY BUILDER 3.04 

DEFINE MISSIONS 0

DEFINE EXTERNAL_SCRIPTS 0

DEFINE UNKNOWN_EMPTY_SEGMENT 0

DEFINE UNKNOWN_THREADS_MEMORY 3072

{$VERSION 3.1.0027}

//-------------MAIN---------------
thread 'MAIN'
set_wb_check_to 0
set_weather 0
select_interior 0
fade 0 0
0180: set_on_mission_flag_to $ONMISSION
00C0: set_current_time_hours_to 8 minutes_to 0
04E4: unknown_refresh_game_renderer_at 2491.1572 -1670.3434
Camera.SetAtPos(2491.1572, -1670.3434, 12.3359)
$PLAYER_CHAR = Player.Create(#NULL, 2491.1572, -1670.3434, 12.3359)
$PLAYER_ACTOR = Actor.EmulateFromPlayer($PLAYER_CHAR)
Actor.Angle($PLAYER_ACTOR) = 66.3548
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
Camera.SetBehindPlayer
Player.SetClothes($PLAYER_CHAR, "WORKTRCAMOGRN", "WORKTR", 2)
Player.SetClothes($PLAYER_CHAR, "SNEAKERBINCGANG", "SNEAKER", 3)
Player.SetClothes($PLAYER_CHAR, "TSHIRTERISORN", "TSHIRT", 0)
Player.Build($PLAYER_CHAR)
Player.CanMove($PLAYER_CHAR) = True
fade 1 0
0879: enable_gang_wars 1
076C: set_zone 'GAN1' gang 1 density_to 40 
076C: set_zone 'GAN2' gang 1 density_to 80 
076C: set_zone 'IWD1' gang 0 density_to 40 
076C: set_zone 'IWD2' gang 0 density_to 80 
076C: set_zone 'IWD3A' gang 2 density_to 40 
076C: set_zone 'IWD3B' gang 2 density_to 80 
0237: set_gang 0 weapons_to 22 31 14 
0237: set_gang 1 weapons_to 30 28 17 
0237: set_gang 2 weapons_to 36 15 27 
0746: set_acquaintance 4 of_actors_pedtype 7 to_actors_pedtype 6
0746: set_acquaintance 4 of_actors_pedtype 8 to_actors_pedtype 6
0746: set_acquaintance 4 of_actors_pedtype 9 to_actors_pedtype 6
0746: set_acquaintance 4 of_actors_pedtype 6 to_actors_pedtype 7
0746: set_acquaintance 4 of_actors_pedtype 6 to_actors_pedtype 8
0746: set_acquaintance 4 of_actors_pedtype 6 to_actors_pedtype 9
0746: set_acquaintance 4 of_actors_pedtype 7 to_actors_pedtype 8
0746: set_acquaintance 4 of_actors_pedtype 7 to_actors_pedtype 9
0746: set_acquaintance 4 of_actors_pedtype 8 to_actors_pedtype 7
0746: set_acquaintance 4 of_actors_pedtype 8 to_actors_pedtype 9
0746: set_acquaintance 4 of_actors_pedtype 9 to_actors_pedtype 7
0746: set_acquaintance 4 of_actors_pedtype 9 to_actors_pedtype 8
0746: set_acquaintance 4 of_actors_pedtype 7 to_actors_pedtype 0
0746: set_acquaintance 0 of_actors_pedtype 8 to_actors_pedtype 0
0746: set_acquaintance 4 of_actors_pedtype 9 to_actors_pedtype 0
0767: set_zone 'MARKST' popcycle_group_for_peds_and_cars_to 14
0767: set_zone 'UNITY' popcycle_group_for_peds_and_cars_to 5
0767: set_zone 'LAIR1' popcycle_group_for_peds_and_cars_to 16 
0767: set_zone 'LAIR2A' popcycle_group_for_peds_and_cars_to 16 
0767: set_zone 'LAIR2B' popcycle_group_for_peds_and_cars_to 16 
0767: set_zone 'LBAG1' popcycle_group_for_peds_and_cars_to 19 
0767: set_zone 'LBAG2' popcycle_group_for_peds_and_cars_to 19 
0767: set_zone 'LBAG3' popcycle_group_for_peds_and_cars_to 19 
0767: set_zone 'BLUF1A' popcycle_group_for_peds_and_cars_to 10 
0767: set_zone 'BLUF2' popcycle_group_for_peds_and_cars_to 10 
0767: set_zone 'SUN1' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'SUN1' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'SUN3A' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'SUN3B' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'SUN3C' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'SUN4' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'COM1A' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'COM1B' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'COM2' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'COM3' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'COM4' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'PER1' popcycle_group_for_peds_and_cars_to 9
0767: set_zone 'CHC1A' popcycle_group_for_peds_and_cars_to 6 
0767: set_zone 'CHC1B' popcycle_group_for_peds_and_cars_to 6 
0767: set_zone 'CHC2A' popcycle_group_for_peds_and_cars_to 6 
0767: set_zone 'CHC2B' popcycle_group_for_peds_and_cars_to 6 
0767: set_zone 'CHC3' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'CHC4A' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'CHC4B' popcycle_group_for_peds_and_cars_to 7 
0874: set_zone 'CHC1A' popcycle_group_for_peds_to 9 
0874: set_zone 'CHC1B' popcycle_group_for_peds_to 9 
0874: set_zone 'CHC2A' popcycle_group_for_peds_to 9 
0874: set_zone 'CHC2B' popcycle_group_for_peds_to 9 
0874: set_zone 'CHC3' popcycle_group_for_peds_to 9 
0874: set_zone 'CHC4A' popcycle_group_for_peds_to 9 
0874: set_zone 'CHC4B' popcycle_group_for_peds_to 9 
0767: set_zone 'CONF1A' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'CONF1B' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'THALL1' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'LDOC1A' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'LDOC1B' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'LDOC2' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'LDOC3A' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'LDOC3B' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'LDOC3C' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'LDOC4' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'LDT1A' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'LDT1B' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'LDT1C' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'LDT3' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'LDT4' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'LDT5' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'LDT6' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'LDT7' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'EBE1' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'EBE2A' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'EBE2B' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'EBE3C' popcycle_group_for_peds_and_cars_to 8 
0767: set_zone 'ELCO1' popcycle_group_for_peds_and_cars_to 6 
0767: set_zone 'ELCO2' popcycle_group_for_peds_and_cars_to 7 
0874: set_zone 'ELCO1' popcycle_group_for_peds_to 9 
0874: set_zone 'ELCO2' popcycle_group_for_peds_to 9 
0767: set_zone 'GAN1' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'GAN2' popcycle_group_for_peds_and_cars_to 7 
0874: set_zone 'GAN1' popcycle_group_for_peds_to 1 
0874: set_zone 'GAN2' popcycle_group_for_peds_to 1 
0767: set_zone 'GLN1' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'GLN2A' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'LIND1A' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'LIND1B' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'LIND2A' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'LIND2B' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'LIND3' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'IWD1' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'IWD2' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'IWD3A' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'IWD3B' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'IWD4' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'IWD5' popcycle_group_for_peds_and_cars_to 7 
0874: set_zone 'IWD1' popcycle_group_for_peds_to 1 
0874: set_zone 'IWD2' popcycle_group_for_peds_to 1 
0874: set_zone 'IWD3A' popcycle_group_for_peds_to 1 
0874: set_zone 'IWD3B' popcycle_group_for_peds_to 1 
0874: set_zone 'IWD4' popcycle_group_for_peds_to 1 
0874: set_zone 'IWD5' popcycle_group_for_peds_to 1 
0767: set_zone 'JEF1A' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JEF1B' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JEF2' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JEF3A' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JEF3B' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JEF3C' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'LFL1A' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'LFL1B' popcycle_group_for_peds_and_cars_to 7 
0874: set_zone 'LFL1A' popcycle_group_for_peds_to 9 
0874: set_zone 'LFL1B' popcycle_group_for_peds_to 9 
0767: set_zone 'LMEX1A' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'LMEX1B' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'ELS1A' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'ELS1B' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'ELS2' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'ELS3A' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'ELS3B' popcycle_group_for_peds_and_cars_to 7 
0767: set_zone 'ELS4' popcycle_group_for_peds_and_cars_to 7 
0874: set_zone 'ELS1A' popcycle_group_for_peds_to 10 
0874: set_zone 'ELS1B' popcycle_group_for_peds_to 10 
0874: set_zone 'ELS2' popcycle_group_for_peds_to 10 
0874: set_zone 'ELS3A' popcycle_group_for_peds_to 10 
0874: set_zone 'ELS3B' popcycle_group_for_peds_to 10 
0874: set_zone 'ELS4' popcycle_group_for_peds_to 10 
0767: set_zone 'MAR1' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'MAR2' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'MAR3' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'MKT1' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'MKT2' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'MKT3' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'MKT4' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'MUL1A' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'MUL1B' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'MUL1C' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'MUL2A' popcycle_group_for_peds_and_cars_to 10 
0767: set_zone 'MUL2B' popcycle_group_for_peds_and_cars_to 10 
0767: set_zone 'MUL3' popcycle_group_for_peds_and_cars_to 10 
0767: set_zone 'MUL4' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'MUL5A' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'MUL5B' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'MUL5C' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'MUL6' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'MUL7A' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'MUL7B' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'PLS' popcycle_group_for_peds_and_cars_to 8
0767: set_zone 'RIH1A' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'RIH1B' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'RIH2' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'RIH3A' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'RIH3B' popcycle_group_for_peds_and_cars_to 15 
0767: set_zone 'RIH4' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'RIH5A' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'RIH6B' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'RIH5A' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'RIH6B' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'ROD1A' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'ROD1B' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'ROD1C' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'ROD2A' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'ROD2B' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'ROD3A' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'ROD3B' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'ROD4A' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'ROD4B' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'ROD4C' popcycle_group_for_peds_and_cars_to 14 
0767: set_zone 'ROD5A' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'ROD5B' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'SMB1' popcycle_group_for_peds_and_cars_to 8 
0767: set_zone 'SMB2' popcycle_group_for_peds_and_cars_to 8 
0767: set_zone 'VIN2' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'VIN3' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'VIN1A' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'VIN1B' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'VERO1' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'VERO2' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'VERO3' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'VERO4A' popcycle_group_for_peds_and_cars_to 8 
0767: set_zone 'VERO4B' popcycle_group_for_peds_and_cars_to 8 
0767: set_zone 'CRANB' popcycle_group_for_peds_and_cars_to 5
0767: set_zone 'CALT' popcycle_group_for_peds_and_cars_to 5
0767: set_zone 'SUNMA' popcycle_group_for_peds_and_cars_to 4
0767: set_zone 'SUNNN' popcycle_group_for_peds_and_cars_to 5
0767: set_zone 'BATTP' popcycle_group_for_peds_and_cars_to 2
0767: set_zone 'ESPN1' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'ESPN2' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'ESPN3' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'BAYV' popcycle_group_for_peds_and_cars_to 5
0767: set_zone 'PARA' popcycle_group_for_peds_and_cars_to 4
0767: set_zone 'JUNIHO' popcycle_group_for_peds_and_cars_to 5
0767: set_zone 'JUNIHI' popcycle_group_for_peds_and_cars_to 5
0767: set_zone 'CIVI' popcycle_group_for_peds_and_cars_to 5
0767: set_zone 'CHINA' popcycle_group_for_peds_and_cars_to 9
0874: set_zone 'CHINA' popcycle_group_for_peds_to 6
0767: set_zone 'SFDWT1' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'SFDWT2' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'SFDWT3' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'SFDWT4' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'SFDWT5' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'SFDWT6' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'FINA' popcycle_group_for_peds_and_cars_to 0
0767: set_zone 'CITYS' popcycle_group_for_peds_and_cars_to 0
0767: set_zone 'WESTP1' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'WESTP2' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'WESTP3' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'THEA1' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'THEA2' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'THEA3' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'GARC' popcycle_group_for_peds_and_cars_to 7
0767: set_zone 'HASH' popcycle_group_for_peds_and_cars_to 6
0767: set_zone 'OCEAF1' popcycle_group_for_peds_and_cars_to 8 
0767: set_zone 'OCEAF2' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'OCEAF3' popcycle_group_for_peds_and_cars_to 8 
0767: set_zone 'DOH1' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'DOH2' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'CUNTC1' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'CUNTC2' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'CUNTC3' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'SFGLF1' popcycle_group_for_peds_and_cars_to 17 
0767: set_zone 'SFGLF2' popcycle_group_for_peds_and_cars_to 17 
0767: set_zone 'SFGLF3' popcycle_group_for_peds_and_cars_to 17 
0767: set_zone 'SFGLF4' popcycle_group_for_peds_and_cars_to 17 
0767: set_zone 'HILLP' popcycle_group_for_peds_and_cars_to 10
0767: set_zone 'SILLY1' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'SILLY2' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'SILLY3' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'SILLY4' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'SFAIR1' popcycle_group_for_peds_and_cars_to 16 
0767: set_zone 'SFAIR2' popcycle_group_for_peds_and_cars_to 16 
0767: set_zone 'SFAIR3' popcycle_group_for_peds_and_cars_to 16 
0767: set_zone 'SFAIR4' popcycle_group_for_peds_and_cars_to 16 
0767: set_zone 'SFAIR5' popcycle_group_for_peds_and_cars_to 16 
0767: set_zone 'SFBAG1' popcycle_group_for_peds_and_cars_to 19 
0767: set_zone 'SFBAG2' popcycle_group_for_peds_and_cars_to 19 
0767: set_zone 'SFBAG3' popcycle_group_for_peds_and_cars_to 19 
0767: set_zone 'EASB1' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'EASB2' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'ESPE1' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'ESPE2' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'ESPE3' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'LINDEN' popcycle_group_for_peds_and_cars_to 5
0767: set_zone 'YELLOW' popcycle_group_for_peds_and_cars_to 4
0767: set_zone 'BFC1' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'BFC2' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'RIE' popcycle_group_for_peds_and_cars_to 0
0767: set_zone 'LDM' popcycle_group_for_peds_and_cars_to 6
0767: set_zone 'RSW1' popcycle_group_for_peds_and_cars_to 6 
0767: set_zone 'RSW2' popcycle_group_for_peds_and_cars_to 6 
0767: set_zone 'RSE' popcycle_group_for_peds_and_cars_to 6
0767: set_zone 'LDS' popcycle_group_for_peds_and_cars_to 11
0767: set_zone 'SRY' popcycle_group_for_peds_and_cars_to 5
0767: set_zone 'JTS1' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTS2' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'LVA1' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'LVA2' popcycle_group_for_peds_and_cars_to 18 
0767: set_zone 'LVA3' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'LVA4' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'VAIR1' popcycle_group_for_peds_and_cars_to 16 
0767: set_zone 'VAIR2' popcycle_group_for_peds_and_cars_to 16 
0767: set_zone 'VAIR3' popcycle_group_for_peds_and_cars_to 16 
0767: set_zone 'LVBAG' popcycle_group_for_peds_and_cars_to 19 
0767: set_zone 'GGC1' popcycle_group_for_peds_and_cars_to 10 
0767: set_zone 'GGC2' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'BFLD1' popcycle_group_for_peds_and_cars_to 10 
0767: set_zone 'BFLD2' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'WWE' popcycle_group_for_peds_and_cars_to 5
0767: set_zone 'WWE1' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'PINT' popcycle_group_for_peds_and_cars_to 5
0767: set_zone 'YBELL2' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'YBELL1' popcycle_group_for_peds_and_cars_to 17 
0767: set_zone 'JTW1' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTW2' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTN1' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTN2' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTN3' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTN4' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTN5' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTN6' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTN7' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTN8' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTE1' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTE2' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTE3' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'JTE4' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'HGP' popcycle_group_for_peds_and_cars_to 4
0767: set_zone 'SPIN' popcycle_group_for_peds_and_cars_to 11
0767: set_zone 'BINT1' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'BINT2' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'BINT3' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'BINT4' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'PRP1' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'PRP2' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'PRP3' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'PRP4' popcycle_group_for_peds_and_cars_to 4 
0767: set_zone 'REDE1' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'REDE2' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'REDE3' popcycle_group_for_peds_and_cars_to 2 
0767: set_zone 'REDW1' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'REDW2' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'REDW3' popcycle_group_for_peds_and_cars_to 11 
0767: set_zone 'REDW4' popcycle_group_for_peds_and_cars_to 5 
0767: set_zone 'ROCE1' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'ROCE2' popcycle_group_for_peds_and_cars_to 0 
0767: set_zone 'OVS' popcycle_group_for_peds_and_cars_to 12
0767: set_zone 'CREE' popcycle_group_for_peds_and_cars_to 9
0767: set_zone 'STRIP1' popcycle_group_for_peds_and_cars_to 12 
0767: set_zone 'STRIP2' popcycle_group_for_peds_and_cars_to 12
0767: set_zone 'STRIP3' popcycle_group_for_peds_and_cars_to 12 
0767: set_zone 'STRIP4' popcycle_group_for_peds_and_cars_to 12 
0767: set_zone 'PILL1' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'PILL2' popcycle_group_for_peds_and_cars_to 9 
0767: set_zone 'RING' popcycle_group_for_peds_and_cars_to 12
0767: set_zone 'ISLE' popcycle_group_for_peds_and_cars_to 12
0767: set_zone 'STAR1' popcycle_group_for_peds_and_cars_to 12 
0767: set_zone 'STAR2' popcycle_group_for_peds_and_cars_to 12 
0767: set_zone 'ROY' popcycle_group_for_peds_and_cars_to 12
0767: set_zone 'CAM' popcycle_group_for_peds_and_cars_to 12
0767: set_zone 'LOT' popcycle_group_for_peds_and_cars_to 12
0767: set_zone 'PIRA' popcycle_group_for_peds_and_cars_to 12
0767: set_zone 'VISA1' popcycle_group_for_peds_and_cars_to 12 
0767: set_zone 'VISA2' popcycle_group_for_peds_and_cars_to 12 
0767: set_zone 'CALI1' popcycle_group_for_peds_and_cars_to 12 
0767: set_zone 'CALI2' popcycle_group_for_peds_and_cars_to 12 
0767: set_zone 'DRAG' popcycle_group_for_peds_and_cars_to 12
0767: set_zone 'PINK' popcycle_group_for_peds_and_cars_to 12
0767: set_zone 'HIGH' popcycle_group_for_peds_and_cars_to 12
0767: set_zone 'CONST1' popcycle_group_for_peds_and_cars_to 18 
0767: set_zone 'ANGPI' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'SHACA' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'BACKO' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'BEACO' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'FARM' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'PALO' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'MONT' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'MONT1' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'MTCHI1' popcycle_group_for_peds_and_cars_to 3 
0767: set_zone 'MTCHI2' popcycle_group_for_peds_and_cars_to 3 
0767: set_zone 'MTCHI3' popcycle_group_for_peds_and_cars_to 3 
0767: set_zone 'MTCHI4' popcycle_group_for_peds_and_cars_to 3 
0767: set_zone 'HBARNS' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'DILLI' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'TOPFA' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'BLUEB' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'BLUEB1' popcycle_group_for_peds_and_cars_to 3 
0767: set_zone 'PANOP' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'BLUAC' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'CREEK' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'CREEK1' popcycle_group_for_peds_and_cars_to 3 
0767: set_zone 'MAKO' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'TOPFA' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'FERN' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'NROCK' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'HANKY' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'LEAFY' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'RED' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'FLINTC' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'WHET' popcycle_group_for_peds_and_cars_to 3
0767: set_zone 'BIGE' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'ELQUE' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'BARRA' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'CARSO' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'PAYAS' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'PROBE' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'ELCA' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'FLINTR' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'ARCO' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'VALLE' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'FLINTI' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'MONINT' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'ROBINT' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'TOM' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'ALDEA' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'BRUJA' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'ROBAD' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'BONE' popcycle_group_for_peds_and_cars_to 1
0767: set_zone 'HAUL' popcycle_group_for_peds_and_cars_to 18
0767: set_zone 'QUARY' popcycle_group_for_peds_and_cars_to 18
0767: set_zone 'OCTAN' popcycle_group_for_peds_and_cars_to 18
0767: set_zone 'PALMS' popcycle_group_for_peds_and_cars_to 18
0767: set_zone 'EBAY' popcycle_group_for_peds_and_cars_to 18
0767: set_zone 'EBAY2' popcycle_group_for_peds_and_cars_to 18 
0767: set_zone 'DAM' popcycle_group_for_peds_and_cars_to 18
create_thread @SAVE 
create_thread @MODEL // Наш новый код! 
end_thread 

:SAVE
thread 'SAVE'
wait 0
if AND
$ONMISSION == 0
0AB0: key_pressed 115
then
03D8: show_save_screen 
wait 250
end
jump @SAVE

// начало нового кода
:MODEL
thread 'MODEL'
wait 0
if
0AB0: key_pressed 8
then
gosub @MODEL_1
$IVAN = actor.Create(4, #BMYPOL1, 2506.8359, -1669.4536, 12.3772)
actor.Angle($IVAN) = 88.2883 
model.Destroy(#BMYPOL1)
jump @MODEL_3
end
jump @MODEL

:MODEL_3
wait 0
end_thread

:MODEL_1
wait 0
model.Load(#BMYPOL1)
038B: load_requested_models 

:MODEL_2
wait 0
if
model.Available(#BMYPOL1)
jf @MODEL_2
return
// конец нового кода

Компилируем и начинаем новую игру. После нажатия нужной кнопки, я получил такое:

То есть свою задачу я выполнил - создал актёра. Но на этом скрипт и заканчиваться. Так же он одноразовый, то есть больше такой возможности не будет, так, как судя по скрипту, поток заканчивается после создания актёра. Рассмотрим наш код в графическом варианте:



Здесь:
Зелёные стрелки указывают на, что условие выполнилось
Красные стрелки - прыжки когда условие не выполнилось ( или просто прыжки )
Фиолетовые - прыжки с возвратом

В следующих уроках я расскажу о командах, которые можно применить к актёрам.

Вход на сайт

Поиск
Категории раздела
Мини-чат
Пожалуйста, все вопросы по скриптингу задавать на форуме!
Наш опрос
Кто из главных героев GTA 5 круче?
Всего ответов: 5
Активность на сайте
Пожертвования
Кошельки WebMoney:
U859420971000
R407741810602
Z331072372430
E314272616890
Друзья сайта
Полезные ресурсы
Статистика

Онлайн всего: 1
Гостей: 1
Пользователей: 0

Сегодня нас посетили:
wmysterio
Реклама