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

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,460
Скорее всего, нет константы DIALOG_STYLE_MSGBOX
 

Mossberg

Новичок
48
0
Есть такое баг после телепорта, что когда садишься в машину, тебя кидает в загрузку. Как его исправить ? Вроде какой то опкод есть
 

StefanWW

Новичок
93
11
Если ты поднимал пикап только тогда, когда подходил к нему, то возможно, что стоит защита на поднятие пикапа с расстояния.
К тому же, есть легче способ, опкодом: 0BD1: samp send_picked_up_pickup 3@


Создай объект на необх. позиции, телепортируй туда актера и меняй позицию объекта вместе с углом поворота исходя из данных игрока.
Есть другой способ, но мне кажется он будет куда хуже.

вот что получилось. Но она не помогает, какой опкод или как сделать, чтобы я по нему ходить мог?
PHP:
{$CLEO }
0000:
wait 1750
 
0B34: samp register_client_command "model" to_label @model
model.Load(2567)
038B: load_requested_models
 
while true
wait 0
if 0@ == 1
then
    0@ = 0
//    actor.StorePos($PLAYER_ACTOR, 2@, 3@, 4@)
    0172: 5@ = actor $PLAYER_ACTOR Z_angle
//    0107: 1@ = create_object  2@ 3@ 4@
//    1@ = Object.Init(2567, 2@, 3@, 4@)
//    4@ -= 2.0
//    01BB: store_object 1@ position_to 2@ 3@ 4@
    0177: set_object 1@ Z_angle_to 5@
    070A: AS_actor $PLAYER_ACTOR attach_to_object 1@ offset 0.0 0.0 -3.0 on_bone 6 9 perform_animation "NULL" IFP_file "NULL" time -1
end
end
 
 
:model
if model.Available(2567)
then
1@ = Object.Init(2567, 2@, 3@, 4@)
model.Destroy(2567)
0@ = 1
end
samp.CmdRet()
 

StefanWW

Новичок
93
11
вот что получилось. Но она не помогает, какой опкод или как сделать, чтобы я по нему ходить мог?
PHP:
{$CLEO }
0000:
wait 1750
 
0B34: samp register_client_command "model" to_label @model
model.Load(2567)
038B: load_requested_models
 
while true
wait 0
if 0@ == 1
then
    0@ = 0
//    actor.StorePos($PLAYER_ACTOR, 2@, 3@, 4@)
    0172: 5@ = actor $PLAYER_ACTOR Z_angle
//    0107: 1@ = create_object  2@ 3@ 4@
//    1@ = Object.Init(2567, 2@, 3@, 4@)
//    4@ -= 2.0
//    01BB: store_object 1@ position_to 2@ 3@ 4@
    0177: set_object 1@ Z_angle_to 5@
    070A: AS_actor $PLAYER_ACTOR attach_to_object 1@ offset 0.0 0.0 -3.0 on_bone 6 9 perform_animation "NULL" IFP_file "NULL" time -1
end
end
 
 
:model
if model.Available(2567)
then
1@ = Object.Init(2567, 2@, 3@, 4@)
model.Destroy(2567)
0@ = 1
end
samp.CmdRet()

Сделал так.
PHP:
{$CLEO }
0000:
wait 1750
 
0B34: samp register_client_command "model" to_label @model
 
while true
wait 0
if 0@ == 1
then
    actor.StorePos($PLAYER_ACTOR, 2@, 3@, 4@)
    0172: 5@ = actor $PLAYER_ACTOR Z_angle
//    0107: 1@ = create_object  2@ 3@ 4@
//    1@ = Object.Init(2567, 2@, 3@, 4@)
    4@ -= 2.8
//    01BB: store_object 1@ position_to 2@ 3@ 4@
    0177: set_object 1@ Z_angle_to 5@
    01BC: put_object 1@ at 2@ 3@ 4@
//    070A: AS_actor $PLAYER_ACTOR attach_to_object 1@ offset 0.0 0.0 -2.5 on_bone 6 9 perform_animation "NULL" IFP_file "NULL" time -1
//    0382: set_object 1@ collision_detection 0
end
end
 
 
:model
model.Load(2567)
038B: load_requested_models
if model.Available(2567)
then
1@ = object.Create(2567, 2@, 3@, 4@)
//1@ = Object.Init(2567, 2@, 3@, 4@)
model.Destroy(2567)
0@ = 1
end
samp.CmdRet()

Только опкод какой удаляет объект, не вспомнить и альт 2 ктрл не поможет
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,460
Бедный код, что хочешь, то с ним и делай:
Код:
{$CLEO}
{$INCLUDE SF}
 
0001: wait 0 ms
0662: "by legend2360"
0662: "BlastHack - cheating is art"
 
while not SAMP.Available()
    wait 400
end
 
0B34: samp register_client_command "model" to_label @model
 
0@ = 0
 
while true
    wait 0
    if 0@ <> 0
    then
        if 0@ == 1
        then
            #AB_WAREHOUSESHELF.Load
           
            while not #AB_WAREHOUSESHELF.Available
                wait 0
            end
           
            1@ = Object.Create(#AB_WAREHOUSESHELF, 0.0, 0.0, 0.0)
            Object.SetImmunities(1@, 1, 1, 1, 1, 1)
            0750: set_object 1@ visibility true
            0382: set_object 1@ collision_detection true
 
            #AB_WAREHOUSESHELF.Destroy
           
            0@ = 2 // attach
            continue
        end
       
        if 0@ == 2
        then
            0AB1: call_scm_func @_attachObjectToPlayer 5 object 1@ offsetXYZ 0.0 0.0 -2.94 tp_actor false
        end
    end
end
 
:model
0@++
if 0@ > 2
then
    0@ = 0
    if 03CA: object 1@ exists
    then
        Object.Destroy(1@)
        1@ = 0
    end
end
0AD1: show_formatted_text_highpriority "~P~%d" time 1500 0@
0B43: samp cmd_ret
 
:_attachObjectToPlayer
// call_scm_func @_attachObjectToPlayer 5 object 0@ offsetXYZ 1@ 2@ 3@ tp_actor 4@
04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 1@ 2@ 3@
if 4@ == true
then 00A1: put_actor $PLAYER_ACTOR at 5@ 6@ 7@
end
0172: 8@ = actor $PLAYER_ACTOR Z_angle
 
// "Attach"
01BC: put_object 0@ at 5@ 6@ 7@
0177: set_object 0@ Z_angle_to 8@
0AB2: ret 0
 
  • Нравится
Реакции: StefanWW

StefanWW

Новичок
93
11
Бедный код, что хочешь, то с ним и делай:
Код:
{$CLEO}
{$INCLUDE SF}
 
0001: wait 0 ms
0662: "by legend2360"
0662: "BlastHack - cheating is art"
 
while not SAMP.Available()
    wait 400
end
 
0B34: samp register_client_command "model" to_label @model
 
0@ = 0
 
while true
    wait 0
    if 0@ <> 0
    then
        if 0@ == 1
        then
            #AB_WAREHOUSESHELF.Load
         
            while not #AB_WAREHOUSESHELF.Available
                wait 0
            end
         
            1@ = Object.Create(#AB_WAREHOUSESHELF, 0.0, 0.0, 0.0)
            Object.SetImmunities(1@, 1, 1, 1, 1, 1)
            0750: set_object 1@ visibility true
            0382: set_object 1@ collision_detection true
 
            #AB_WAREHOUSESHELF.Destroy
         
            0@ = 2 // attach
            continue
        end
     
        if 0@ == 2
        then
            0AB1: call_scm_func @_attachObjectToPlayer 5 object 1@ offsetXYZ 0.0 0.0 -2.94 tp_actor false
        end
    end
end
 
:model
0@++
if 0@ > 2
then
    0@ = 0
    if 03CA: object 1@ exists
    then
        Object.Destroy(1@)
        1@ = 0
    end
end
0AD1: show_formatted_text_highpriority "~P~%d" time 1500 0@
0B43: samp cmd_ret
 
:_attachObjectToPlayer
// call_scm_func @_attachObjectToPlayer 5 object 0@ offsetXYZ 1@ 2@ 3@ tp_actor 4@
04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 1@ 2@ 3@
if 4@ == true
then 00A1: put_actor $PLAYER_ACTOR at 5@ 6@ 7@
end
0172: 8@ = actor $PLAYER_ACTOR Z_angle
 
// "Attach"
01BC: put_object 0@ at 5@ 6@ 7@
0177: set_object 0@ Z_angle_to 8@
0AB2: ret 0

Спасибо, сойдет)
И это, аафк есть норм? Чтобы 0DBF: emul_key_press 32 is_up 0 работал в свернутом режиме?
 

Mossberg

Новичок
48
0
Есть такое баг после телепорта, что когда садишься в машину, тебя кидает в загрузку. Как его исправить ? Вроде какой то опкод есть
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,460
Там удерживать надо, а тут 1 раз нажимает, или в repeat кинуть?

В цикл

Есть такое баг после телепорта, что когда садишься в машину, тебя кидает в загрузку. Как его исправить ? Вроде какой то опкод есть

02EB: restore_camera_with_jumpcut
 
  • Нравится
Реакции: StefanWW и Mossberg

oolol

Новичок
16
1
То есть чтобы содержимое текстового файла вывелось в диалог? Если да, то вот:
PHP:
if
0A9A: 3@ = openfile "CLEO\file.txt" mode "rt"
then
    alloc 4@ 128
    alloc 5@ 2048
    0C11: memset destination 4@ value 0 size 128
    0C11: memset destination 5@ value 0 size 2048
    while not File.EOF(3@)
        if 0AD7: read_string_from_file 3@ to 4@ size 128
        then 0C15: strcat destination 5@ source 4@
        end
        0C11: memset destination 4@ value 0 size 128
    end
    0B3B: samp show_dialog id 225 caption 6@ text 5@ button_1 "Close" button_2 "" style 0
    free 4@
    free 5@
    File.Close(3@)
end
Что же тут не так?
PHP:
{$CLEO}
{$INCLUDE SF}
 
0000: nop
 
wait 2000
0B34: samp register_client_command "222" to_label @1
 
while true
    wait 0
    if 0@ == 1
    then
0A9A: 3@ = openfile "CLEO\file.txt mode" "rt"
 
    alloc 4@ 128
    alloc 5@ 2048
    0C11: memset destination 4@ value 0 size 128
    0C11: memset destination 5@ value 0 size 2048
    while not File.EOF(3@)
        if 0AD7: read_string_from_file 3@ to 4@ size 128
        then 0C15: strcat destination 5@ source 4@
        end
        0C11: memset destination 4@ value 0 size 128
    end
    0B3B: samp show_dialog id 225 caption 6@ text 5@ button_1 "Close" button_2 "" style 0
    free 4@
    free 5@
    File.Close(3@)
      0@ = 0
    end
end
 
:1
0B12: 0@ = 0@ XOR 1
if 0@ == 1
    then
        0AF8: samp add_message_to_chat "Âû çàïóñòèëè äèàëîã" color 0xFFD700
end
0B43: samp cmd_ret
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,460
Хенесси наркоман прост(. // hnnssy: чё это я наркоман? работает же :D
Ошибки/недочеты:
  1. Опкод 0A9A(открытие файла) лучше использовать как условие или проверять переменную 3@ на то, что число, которое хранится в переменной, больше нуля
  2. Следуя из первого недочета, можно убедиться, что в 3@ возвращается 0, т.к. файла CLEO\file.txt mode не существует
  3. При создании диалога, используется переменная 6@, которая не хранит даже указателя на выделенную память, где будет находится наименование диалога. Поэтому - либо выдели память или используй кавычки("")
 

fonarik

Известный
206
3
Помогите разобраться.Зачем нужен опкод 0C11 и почему не достаточно просто 0ac8: ?

alloc 4@ 128
alloc 5@ 2048
0C11
: memset destination 4@ value 0 size 128
0C11
: memset destination 5@ value 0 size 2048
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,460
Помогите разобраться.Зачем нужен опкод 0C11 и почему не достаточно просто 0ac8: ?

alloc 4@ 128
alloc 5@ 2048
0C11: memset destination 4@ value 0 size 128
0C11: memset destination 5@ value 0 size 2048

Лучше заполнить выделенную память нулями, чем в ней будет висеть какое-то дерьмо)
 
  • Нравится
Реакции: fonarik