> For the complete documentation index, see [llms.txt](https://lessons.sannybuilder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lessons.sannybuilder.com/00100/00200/igrok/00021.-odezhda-szh.md).

# 00021. Одежда СЖ

Одежда СЖ|В этом уроке Вы узнаете как одеть CJ в одежду.|wmysterio|wmysterio||||Как видим наш, в нашем предыдущем скрипте, СЖ был в трусах. Это не совсем красиво ))) Поэтому давайте его приоденем как следует :)

В первую очередь вам нужно знать о переменной $PLAYER\_CHAR. Эта переменная игрока, то есть того, за кого мы сейчас играем. Что бы одеть СЖ нужно использовать опкод:

```
Player.SetClothes($PLAYER_CHAR, "WORKTRCAMOGRN", "WORKTR", 2)
```

Здесь: $PLAYER\_CHAR — переменная игрока, которого мы одеваем\
"WORKTRCAMOGRN" - имя текстуры модели\
"WORKTR" - имя самой модели\
2 - тип одежды ( см. в нашей [базе данных](https://github.com/wmysterio/scm-scripting-lessons/blob/main/dir/gta_sa/chasti_tela_igroka/1-1-0-37/README.md) )× \*\*ВАЖНО:\*\* Так одеть можно только CJ'я!

Давайте всё же оденем нормально игрока. Вот я подобрал на скорую руку одежду:

```
Player.SetClothes($PLAYER_CHAR, "WORKTRCAMOGRN", "WORKTR", 2)
Player.SetClothes($PLAYER_CHAR, "SNEAKERBINCGANG", "SNEAKER", 3)
Player.SetClothes($PLAYER_CHAR, "TSHIRTERISORN", "TSHIRT", 0)
```

Мы должны сначала перечислить всю одежду, которую мы хотим видеть на СЖ. В результате мы получим такой вид СЖ:

![](https://github.com/wmysterio/scm-scripting-lessons/raw/resources/_pu/0/43381799.png)

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

```
Player.Build($PLAYER_CHAR)
```

Давайте наш мини-код добавим в наш скрипт:

```
// 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
end_thread
```

Теперь компилируем, и заходим в игру, проверяем :) Экспериментируйте с одеждой, добавляйте больше примочек! Главное, что бы список был **до** опкода Player.Build($PLAYER\_CHAR).

× \*\*Примечание:\*\* если мы укажем в списке одежды одинаковые типы, то СЖ будет одет в ту, которая написанна ниже по коду.× \*\*Примечание:\*\* Закрепить одежду недостаточно, так как при смерти СЖ опять появится в трусах. Сохранить одежду можно опкодом:

```
0793: save_player_clothes
```

Я не стал включать его в код скрипта, так как в нём пока нет необходимости.

|1585|1|0|43381799\`png\`640\`400\`400\`250\`\`\\||odezhda\_szh|1498567660


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://lessons.sannybuilder.com/00100/00200/igrok/00021.-odezhda-szh.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
