Вопросы по CLEO-скриптингу

deddosouru

Смотрю аниме, служу Сатане
Друг
2,036
1,320
Ну вывод в чат при попадании работает. Чтобы звук был слышен, добавь громкость радио в игре и перезайди.
еще загрузку звука как вариант сделай в цикле, но это такое
у меня второй скрипт по этому же типу, только воспроизводит звук при смерти, и оно пашет. вывод в чат я удалял перед компилированием D:
upd1:
я не знаю что я сделал, но оно заработало
 
Последнее редактирование:

LokoLoyKoo

Новичок
103
8
Помогите крашит, промблема именно в этой части кода
CLEO:
:fr
0B35: samp 0@ = get_last_command_params
0AC8: 5@ = allocate_memory_size 256
if 0AD4: 0@ = scan_string 0@ format "%d" 1@
then
    if 0B23: samp is_player_connected 1@
    then
        0B65: samp 2@ = player 1@ score
        if and
        2@ >= 0
        2@ < 5
        then
        0AF0: 5@ = get_int_from_ini_file "cleo\lawyer.ini" section "prices" key "0-4 lvl"
        0af9: "/free %d %d" 1@ 5@
        end
        if and
        2@ > 4
        2@ < 10
        then
        0AF0: 5@ = get_int_from_ini_file "cleo\lawyer.ini" section "prices" key "5-9 lvl"
        0af9: "/free %d %d" 1@ 5@
        end
        if and
        2@ > 10
        2@ < 99
        then
        0AF0: 5@ = get_int_from_ini_file "cleo\lawyer.ini" section "prices" key "10+ lvl"
        0af9: "/free %d %d" 1@ 5@
        0AC9: free_allocated_memory 5@
        end
    end
    else 0af8: "Игрок с Id %d не подключен." -1 1@
end
0AC9: free_allocated_memory 5@
0B12: 21@ = 21@ XOR 1
Samp.CmdRet()
 

LokoLoyKoo

Новичок
103
8
тогда попробуй юзать ключи в ини без пробелов
upload_2016-11-5_16-44-31.png


Помогите срабатывает всего лишь 1 раз, на второй раз крашит
CLEO:
:fr
0B35: samp 0@ = get_last_command_params
if 0AD4: 0@ = scan_string 0@ format "%d" 1@
then
    if 0B23: samp is_player_connected 1@
    then
        0B65: samp 2@ = player 1@ score
        if and
        2@ >= 0
        2@ < 5
        then
        0AF0: 5@ = get_int_from_ini_file "cleo\lawyer.ini" section "prices" key "1"
        0af9: "/free %d %d" 1@ 5@
        end
        if and
        2@ > 4
        2@ < 10
        then
        0AF0: 5@v = get_int_from_ini_file "cleo\lawyer.ini" section "prices" key "2"
        0af9: "/free %d %d" 1@ 5@
        end
        if and
        2@ > 10
        2@ < 99
        then
        0AF0: 5@ = get_int_from_ini_file "cleo\lawyer.ini" section "prices" key "3"
        0af9: "/free %d %d" 1@ 5@
        end
    end
    else 0af8: "Игрок с Id %d не подключен." -1 1@
end
0B12: 21@ = 21@ XOR 1
Samp.CmdRet()
 
Последнее редактирование модератором:

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,463
Код:
:fr
0B35: samp 0@ = get_last_command_params
/* 3 */ if 0AD4: 0@ = scan_string 0@ format "%d" 1@
then
    if 0B23: samp is_player_connected 1@
    then
        0B65: samp 2@ = player 1@ score
        if and
        2@ >= 0
        2@ < 5
        then
        0AF0: 5@ = get_int_from_ini_file "cleo\lawyer.ini" section "prices" key "1"
        0af9: "/free %d %d" 1@ 5@
        end
        if and
        2@ > 4
        2@ < 10
        then
        /* 19 */ 0AF0: 5@v = get_int_from_ini_file "cleo\lawyer.ini" section "prices" key "2"
        0af9: "/free %d %d" 1@ 5@
        end
        if and
        2@ > 10
        2@ < 99
        then
        0AF0: 5@ = get_int_from_ini_file "cleo\lawyer.ini" section "prices" key "3"
        0af9: "/free %d %d" 1@ 5@
        end
    /* 29 */ end
    /* 30 */ else 0af8: "Игрок с Id %d не подключен." -1 1@
end
0B12: 21@ = 21@ XOR 1
Samp.CmdRet()

Строки:
  • стр. 3 - какие мы экономичные, но здесь не стоит этого делать. Для возвращаемого значения возьми другую переменную.
  • стр. 19 - почему 5@v?
  • стр. 29-30 - местами перепутал.
 

LokoLoyKoo

Новичок
103
8
Код:
:fr
0B35: samp 0@ = get_last_command_params
/* 3 */ if 0AD4: 0@ = scan_string 0@ format "%d" 1@
then
    if 0B23: samp is_player_connected 1@
    then
        0B65: samp 2@ = player 1@ score
        if and
        2@ >= 0
        2@ < 5
        then
        0AF0: 5@ = get_int_from_ini_file "cleo\lawyer.ini" section "prices" key "1"
        0af9: "/free %d %d" 1@ 5@
        end
        if and
        2@ > 4
        2@ < 10
        then
        /* 19 */ 0AF0: 5@v = get_int_from_ini_file "cleo\lawyer.ini" section "prices" key "2"
        0af9: "/free %d %d" 1@ 5@
        end
        if and
        2@ > 10
        2@ < 99
        then
        0AF0: 5@ = get_int_from_ini_file "cleo\lawyer.ini" section "prices" key "3"
        0af9: "/free %d %d" 1@ 5@
        end
    /* 29 */ end
    /* 30 */ else 0af8: "Игрок с Id %d не подключен." -1 1@
end
0B12: 21@ = 21@ XOR 1
Samp.CmdRet()

Строки:
  • стр. 3 - какие мы экономичные, но здесь не стоит этого делать. Для возвращаемого значения возьми другую переменную.
  • стр. 19 - почему 5@v?
  • стр. 29-30 - местами перепутал.
С 3-ей строкой не понял, остальное исправил.
 

Perojek)0

Известный
205
3
Если у меня есть строка "AAA", как из неё сделать "aaa"?
upd: разобрался
 
Последнее редактирование:

DarkP1xel

Сила воли наше всё.
BH Team
3,635
4,965
Скажите как узнать ID ближайшего/рендомного 3D текста возле игрока?
CLEO:
{$CLEO}
0B34: samp register_client_command "CMD" to_label @CMD
0BDE: pause_thread 0

:CMD
FOR 0@ = 0 TO {MAX_3DTEXTS}2048 [STEP = 1]
    IF 0B46:     samp 3d_text 0@ defined
    THEN
    0C46: samp get_3d_text_info_by_id 0@ string_ptr 1@ color 2@ position 3@ 4@ 5@ view_distance 6@ show_behind_walls 7@ attached_to_player 8@ attached_to_vehicle 9@
    00A0: store_actor $PLAYER_ACTOR position_to 10@ 11@ 12@
    050A: 13@ = distance_between_XYZ 3@ 4@ 5@ and_XYZ 10@ 11@ 12@
        IF 8031:   NOT 13@ >= 10.0
        THEN 0AF8: samp add_message_to_chat "ID: %d" color 0xFFFFFF {ID}0@
        END
    END
END
0B43: samp cmd_ret
 
  • Нравится
Реакции: Coghweel

Coghweel

Новичок
76
0
CLEO:
{$CLEO}
0B34: samp register_client_command "CMD" to_label @CMD
0BDE: pause_thread 0

:CMD
FOR 0@ = 0 TO {MAX_3DTEXTS}2048 [STEP = 1]
    IF 0B46:     samp 3d_text 0@ defined
    THEN
    0C46: samp get_3d_text_info_by_id 0@ string_ptr 1@ color 2@ position 3@ 4@ 5@ view_distance 6@ show_behind_walls 7@ attached_to_player 8@ attached_to_vehicle 9@
    00A0: store_actor $PLAYER_ACTOR position_to 10@ 11@ 12@
    050A: 13@ = distance_between_XYZ 3@ 4@ 5@ and_XYZ 10@ 11@ 12@
        IF 8031:   NOT 13@ >= 10.0
        THEN 0AF8: samp add_message_to_chat "ID: %d" color 0xFFFFFF {ID}0@
        END
    END
END
0B43: samp cmd_ret
Вот спасибо, а я дурак забыл что так можно )
Еще вопрос: 2048 - это макс. возможный ID 3д текста?