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

BlackKnigga

Известный
BH Team
922
444
CLEO:
:START
wait 0
if
0AB0:   key_pressed 113
jf @START
if
0AB1: call @nearid 0 retr_to fdist 0@ sid 1@
jf @START
0AF9: "/iznas %d" 1@
wait 100
0C72: set_virtual_key 0x7A down true
wait 100
0C72: set_virtual_key 0x7A down false
wait 1000
jump @START

:nearid
3@ = 1000.0
4@ = 0xFFFFFF
0A8D: 0@ = read_memory 0xB74490 size 4 virtual_protect 0
0@ += 4
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
for 1@ = 0 to 35584 step 0x100
    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
    0@++
    if and
        2@ >= 0x00
        2@ < 0x80
    then
        005A: 2@ += 1@
        if or
            003C: $PLAYER_ACTOR == 2@
            856D: NOT actor 2@ defined
        then continue
        end
  
        0AB1: call @dist 1 remote_player_handle 2@ retr_dist_to 5@
        if 0025: 3@ > 5@
        then
            0087: 3@ = 5@
            0085: 4@ = 2@
        end
    end
end
if 4@ = SAMP.GetSAMPPlayerIDByActorHandle(4@)
then
    0485:  return_true
else
    059A:  return_false
end
0AB2: ret 2 3@ 4@
:dist
Actor.StorePos(0@, 1@, 2@, 3@)
Actor.StorePos($PLAYER_ACTOR, 4@, 5@, 6@)
050A: 7@ = distance_between_XYZ 4@ 5@ 6@ and_XYZ 1@ 2@ 3@
0AB2: ret 1 7@
Выдает ошибку нулевой оффсет.
0000: в начале добавь
 

LokoLoyKoo

Новичок
103
8
0000: в начале добавь
А как добавить сюда вот эту часть кода?
CLEO:
 0665: get_actor 1@ model_to 7@
    if or
    not 7@ == 280
    not 7@ == 281
    not 7@ == 282
    not 7@ == 283
    not 7@ == 284
    not 7@ == 285
    not 7@ == 288
    not 7@ == 300 
    then
    if or
    not 7@ == 301
    not 7@ == 302
    not 7@ == 306
    not 7@ == 307
    not 7@ == 309
    not 7@ == 310
    not 7@  == 311
    then
 

BlackKnigga

Известный
BH Team
922
444
А как добавить сюда вот эту часть кода?
CLEO:
 0665: get_actor 1@ model_to 7@
    if or
    not 7@ == 280
    not 7@ == 281
    not 7@ == 282
    not 7@ == 283
    not 7@ == 284
    not 7@ == 285
    not 7@ == 288
    not 7@ == 300
    then
    if or
    not 7@ == 301
    not 7@ == 302
    not 7@ == 306
    not 7@ == 307
    not 7@ == 309
    not 7@ == 310
    not 7@  == 311
    then
Что куда добавить?
Если про 0000: то он там не нужен.
 

LokoLoyKoo

Новичок
103
8
CLEO:
:START
wait 0
if
0AB0:   key_pressed 113
jf @START
if
0AB1: call @nearid 0 retr_to fdist 0@ sid 1@
jf @START
0AF9: "/iznas %d" 1@
wait 100
0C72: set_virtual_key 0x7A down true
wait 100
0C72: set_virtual_key 0x7A down false
wait 1000
jump @START

:nearid
3@ = 1000.0
4@ = 0xFFFFFF
0A8D: 0@ = read_memory 0xB74490 size 4 virtual_protect 0
0@ += 4
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
for 1@ = 0 to 35584 step 0x100
    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
    0@++
    if and
        2@ >= 0x00
        2@ < 0x80
    then
        005A: 2@ += 1@
        if or
            003C: $PLAYER_ACTOR == 2@
            856D: NOT actor 2@ defined
        then continue
        end
  
        0AB1: call @dist 1 remote_player_handle 2@ retr_dist_to 5@
        if 0025: 3@ > 5@
        then
            0087: 3@ = 5@
            0085: 4@ = 2@
        end
    end
end
if 4@ = SAMP.GetSAMPPlayerIDByActorHandle(4@)
then
    0485:  return_true
else
    059A:  return_false
end
0AB2: ret 2 3@ 4@
:dist
Actor.StorePos(0@, 1@, 2@, 3@)
Actor.StorePos($PLAYER_ACTOR, 4@, 5@, 6@)
050A: 7@ = distance_between_XYZ 4@ 5@ 6@ and_XYZ 1@ 2@ 3@
0AB2: ret 1 7@
CLEO:
 0665: get_actor 1@ model_to 7@
    if or
    not 7@ == 280
    not 7@ == 281
    not 7@ == 282
    not 7@ == 283
    not 7@ == 284
    not 7@ == 285
    not 7@ == 288
    not 7@ == 300
    then
    if or
    not 7@ == 301
    not 7@ == 302
    not 7@ == 306
    not 7@ == 307
    not 7@ == 309
    not 7@ == 310
    not 7@  == 311
    then
[/QUOTE]
Эти два в один, что бы когда срабатывала команда /frisk не срабатывало на скины законников.
 

Zoxan_Twist

Новичок
126
29
Почему может не выполнять никаких действий на сервер? И диалог с таким id создан и все что только можно - сделано. Серверная часть на 5+, а скрипт не отправляет ничерта.
CLEO:
{$CLEO .cs}
0000: NOP

repeat
    wait 1000
until SAMP.Available()

0@ = 40
while true
    wait 0
    if 0AB0:   key_pressed 17
    then
        0BC9: samp send_dialog_response dialog 0@ button 1 listitem 2 input ""
        0AF8: samp add_message_to_chat "Yes" color -1
        wait 1000
    end
end
[SPOILER/]
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,695
1,448
Если сервер сам не отправлял запрос на ответ для данного диалога, то ни о каком успехе и речи быть не может.
 

Zoxan_Twist

Новичок
126
29
Если сервер сам не отправлял запрос на ответ для данного диалога, то ни о каком успехе и речи быть не может.
Это в случае если есть Anti Dialog Hider ибо это он не дает выполниться диалогу. Но может что-то поменяли после 0.3.7-R2 ибо раньше работало
 

FrediSaal

Известный
37
0
Как сделать вот такую менюшку? Пожалуйста помогите. Как на данном видео.
 

FrediSaal

Известный
37
0
А можно я скину код, а ты скажешь где и как ставить, но надо чтоб еще по клику ТПхало. И выдавала таблицу/
Код:
{$CLEO}
{$INCLUDE SF}

8AF7:   not samp 0@ = get_base
004D: jump_if_false @hnnssy_40
0A93: end_custom_thread

0AF8: samp add_message_to_chat "{FF0000}[INFO]: {A0A0A0}Чтоб открыть меню телепортов введите: {00FF00}>> {FF0000}/mhelp {00FF00}<<" 

0AC6: 0@ = label @Buffer offset
0B34: samp register_client_command "MHELP" to_label @CMD
0B34: samp register_client_command "mtp" to_label @M_TP1
0BDE: pause_thread 0



:CMD
0B3B: samp show_dialog id 420 caption "CLEO - TELEPORT (Для <M>)" text 0@ button_1 "Закрыть" button_2 "" style 0 {DIALOG_STYLE_MSGBOX}0
0B43: samp cmd_ret


:Buffer
HEX
"{FFFFFF}" A
"{FFFFFF}" A
"{FFFFFF}" A
"{FFFFFF}" A
"{FFFFFF}/mtp [{00ff00}1{FFFFFF}] — Мэрия" A
"{FFFFFF}/mtp [{00ff00}2{FFFFFF}] — Карьер" A
"{FFFFFF}/mtp [{00ff00}3{FFFFFF}] — КХ" A
"{FFFFFF}/mtp [{00ff00}4{FFFFFF}] — ДБ - 1" A
"{FFFFFF}/mtp [{00ff00}5{FFFFFF}] — ТП к Сборам" A
"{FFFFFF}/mtp [{00ff00}6{FFFFFF}] — ТП к Арене - Смерти" A
"{FFFFFF}/mtp [{00ff00}7{FFFFFF}] — ТП к DM Ballas(Возле дома баллас)" A
"{FFFFFF}/mtp [{00ff00}8{FFFFFF}] — ТП к Центральному аммо" A
"{FFFFFF}/mtp [{00ff00}9{FFFFFF}] — ТП к КФС VW" A
"{FFFFFF}/mtp [{00ff00}10{FFFFFF}] — ТП к КПП" A
"{FFFFFF}/mtp [{00ff00}11{FFFFFF}] — ТП к Battlefield (Локация)" A
"{FFFFFF}/mtp [{00ff00}12{FFFFFF}] — ТП к K.A.C.C. (Локация)" A
"{FFFFFF}/mtp [{00ff00}13{FFFFFF}] — ТП к Kickstart (Локация)" A
"{FFFFFF}" A
"{FFFFFF}" A
"{FFFFFF}" A
"{FFFFFF}" 00
END

:M_TP1
0B35: samp 5@ = get_last_command_params
00D6: if
0AD4: 5@ = scan_string 5@ format "%d" 6@ 
00D6: if
0039:   6@ == 1
004D: jump_if_false @M_TP2
00A1: put_actor $PLAYER_ACTOR at -2173.4658 -2429.9907 30.6250 266.5249 0 0 0 0 0 0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP2
00D6: if
0039:   6@ == 2
004D: jump_if_false @M_TP3
00A1: put_actor $PLAYER_ACTOR at 791.2996 750.8868 25.7708 348.2014 0 0 0 0 0 0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP3
00D6: if
0039:   6@ == 3
004D: jump_if_false @M_TP4
00A1: put_actor $PLAYER_ACTOR at 2342.7764 34.0260 26.4355 23.6528 0 0 0 0 0 0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP4
00D6: if
0039:   6@ == 4
004D: jump_if_false @M_TP5
00A1: put_actor $PLAYER_ACTOR at -34.9047 73.1719 3.1172  0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP5
00D6: if
0039:   6@ == 5
004D: jump_if_false @M_TP6
00A1: put_actor $PLAYER_ACTOR at 722.6232 -1486.0343 1.9688 273.6273 0 0 0 0 0 0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP6
00D6: if
0039:   6@ == 6
004D: jump_if_false @M_TP7
00A1: put_actor $PLAYER_ACTOR at 2880.3230 2167.5469 10.8203 356.8105 0 0 0 0 0 0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP7
00D6: if
0039:   6@ == 7
004D: jump_if_false @M_TP8
00A1: put_actor $PLAYER_ACTOR at 1905.2421 -1118.0248 25.6641 178.3868 0 0 0 0 0 0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP8
00D6: if
0039:   6@ == 8
004D: jump_if_false @M_TP9
00A1: put_actor $PLAYER_ACTOR at 1354.1914 -1279.6649 13.3828 269.3660 0 0 0 0 0 0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP9
00D6: if
0039:   6@ == 9
004D: jump_if_false @M_TP10
00A1: put_actor $PLAYER_ACTOR at 1189.9327 -923.3535 43.1269 277.8885 0 0 0 0 0 0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP10
00D6: if
0039:   6@ == 10
004D: jump_if_false @M_TP11
00A1: put_actor $PLAYER_ACTOR at -91.9522 -1537.0022 2.6107 305.2326 0 0 0 0 0 0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP11
00D6: if
0039:   6@ == 11
004D: jump_if_false @M_TP12
00A1: put_actor $PLAYER_ACTOR at -1131.8187 1023.1565 1345.7217 287.4770 0 0 0 0 0 0
04BB: select_interior 10
0860: link_actor $PLAYER_ACTOR to_interior 10
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP12
00D6: if
0039:   6@ == 12
004D: jump_if_false @M_TP13
00A1: put_actor $PLAYER_ACTOR at 2558.9739 2786.9802 10.8203 125.4582 0 0 0 0 0 0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP13
00D6: if
0039:   6@ == 13
004D: jump_if_false @M_TP14
00A1: put_actor $PLAYER_ACTOR at -1412.25 1589.80 1052.53 14
04BB: select_interior 14
0860: link_actor $PLAYER_ACTOR to_interior 14
0AD1: show_formatted_text_highpriority "~g~Teleport" time 1000 
0B43: samp cmd_ret

:M_TP14
0B43: samp cmd_ret